[5650] feat(ci): clone-based Railway previews behind a mode switch (WP3) - #5668
Conversation
|
Live verification transcript (WP3 acceptance) + legacy-equivalence note: Legacy byte-equivalence: with |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Acceptance evidence (real Actions run): workflow 48 run 30766969925 — 3 consecutive clone cycles with the production scripts, all green: cycle 1 total 133s / 27 API calls, cycle 2 total 86s / 24 calls, cycle 3 green (see run summary for the table). Every cycle passed all three smoke checks ( |
61fa874 to
0a9effd
Compare
6d1ddd4 to
d82bed4
Compare
Railway Preview Environment
Updated at 2026-08-03T06:56:11.690Z |
d82bed4 to
8cfd818
Compare
0a9effd to
ab0753b
Compare
8cfd818 to
22ef7cd
Compare
ab0753b to
c0d58e4
Compare
c0d58e4 to
e012e31
Compare
22ef7cd to
10b3a87
Compare
Part of the clone-based Railway preview redesign (#5650, WP3 of 3, final). Do not merge before #5665; merge order is bottom-up through the stack.
Today every preview is constructed imperatively (~75 Railway mutations per run), which is why previews keep failing in new ways. The spike (#5658) proved the replacement: clone a prepared template environment, patch the image tags in one batched mutation, deploy, delete on close. This PR wires that flow into the real preview workflows behind a switch, with the legacy path untouched.
What changes
modejob in workflow 14 resolvesvars.RAILWAY_PREVIEW_MODE || 'legacy'once per run and passes it down, so a single repo variable flips previews between modes, and rollback is flipping it back. The variable does not exist yet; everything defaults to legacy.preview-clone-create.sh: create-or-update of the per-PR clone environment. Fresh PR: clone the template (skipInitialDeploys, poll-by-name on ambiguous create), oneenvironmentPatchCommitfor all app images, ordered deploys (infra → migrations → rest, supertokens after alembic), one retry for a slow first Postgres deploy, then smoke checks. Subsequent push: just patch and redeploy.--verify-onlygives workflow 43 a mutation-free re-check that emits the same outputs the legacy deploy step did, so the tests job and PR comment work unchanged.preview-clone-destroy.sh: idempotent environment deletion plus a stale-clone sweep (--stale-hours) for the cleanup cron, withpr-templateandproductiondouble-protected.mode != 'clone'with their command lines byte-identical; clone steps added alongside. 45 also gains the stale-clone sweep in its daily cron (runs in both modes deliberately, so a rollback to legacy cannot strand clone environments).Verification
run/env/withblock is byte-identical; the only expressions that changed are output fallbacks (steps.deploy.X || steps.verify.X) that render identical values in legacy mode. Stated precisely in the equivalence note in the comment.Refs #5650
https://claude.ai/code/session_011zdniFW44QDqcs4Nz8n3hr