Run production's E2E rollback in its own job, away from npm - #590
Conversation
This comment has been minimized.
This comment has been minimized.
33176c8 to
cd278f4
Compare
This comment has been minimized.
This comment has been minimized.
|
On the "dead parametrization" note: the Checked on cd278f4 by swapping that job's
With |
e2e-prod runs npm ci, and the same job handed SERVER_SSH_KEY (root on production) to its rollback step. Any install script in the npm tree ran first in the environment the key was later given to. The rollback is now rollback-production-on-e2e-failure: a job of its own, needing e2e-prod, and keyed on the test step's outcome exported as a job output rather than on the job's failure(), so a failed checkout, npm ci or Chrome report still leaves production alone. It is gated on !cancelled() rather than always(), so cancelling the run still stops it, as it stopped the in-job step. It takes production-deploy like the deploy-failure rollback it is modelled on, so a following run's deploy cannot be in the deploy directory while rollback.sh is. Its ssh-action is pinned to the same commit as every other use of that action, and it keeps the workflow's read-only token. test_deploy_workflows.py now holds every workflow to the rule that no job that installs packages, runs in a container or starts service containers can read a droplet key, and pins the new job's condition across refs, events and test outcomes. Checked against main's ci.yml, where the rule fails on e2e-prod. ClickUp 123zgec4mze. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cd278f4 to
ebedabb
Compare
This comment has been minimized.
This comment has been minimized.
|
Rebased onto What that changed here:
Verification on this head: the workflow, pin, permission and deploy-workflow tests and their neighbours pass (313), run under the shared suite lock, and pre-commit, actionlint included, is clean. |
|
On the review of ebedabb:
No change needed on either. |
|
Claude finished @jehanazad's task in 10m 31s —— View job Claude's review of PR #590
SummaryReviewed One thing worth a maintainer's attention, nothing else survived scrutiny of the diff: Findings
The disclosed gaps in the PR description (no lock held by Branch · |
ClickUp: 1.4 Run the production E2E rollback in its own job, away from npm
Why
e2e-prodrunsnpm ciand Playwright inside the Playwright image, and then, in the same job, handedSERVER_SSH_KEY(root on production) to its rollback step. Every install script in the npm tree, and the image itself, ran first in the environment the key was later given to.What changes
rollback-production-on-e2e-failure: its own job, on the runner,needs: e2e-prod.e2e-prodas the job outputtests, not on the job's result. A failed pull, checkout ornpm cistill leaves production alone, as before.!cancelled()rather thanalways(), so cancelling the run still stops it, as it stopped the in-job step.production-deploy, likerollback-production-on-deploy-failure, so a following run's deploy cannot be in the deploy directory whilerollback.shis.appleboy/ssh-actionis pinned by SHA (v1.2.5, whatv1points at today).test_deploy_workflows.pyholds every workflow to one rule: a job that installs packages, runs an action other than checkout or the ssh transport, runs in a container or starts service containers cannot read a droplet key. It also evaluates the new job'sif:across refs, events, test outcomes and cancellation. Againstmain'sci.ymlthe rule fails one2e-prod, and swapping!cancelled()foralways()fails the matrix.Known limits, closed later in this stack
production-smoke-testsande2e-prodstill hold no lock, so a following run's deploy can land while this run is still verifying, and its rollback would then act on that deploy. The next PR (1.1) runs the whole production chain under one calling job that holdsproduction-deploy, which also removes the rollbacks' own groups and with them the one-pending-job cancellation. 1.6 adds a per-run deploy record the rollback checks.e2e-prodafter a rollback could fire a second one if the re-run never reaches the test step. The secondrollback.shrestores the same snapshot.Verification
backend/tests/test_deploy_workflows.py, and the backend suite with CI's flags.deploy-test.ymlhas no E2E stage, so it cannot drive this job, androllback.shis unchanged. The first real exercise is a failing production E2E.ci.ymlhas no job holding a droplet key beside an install step, so it needs no mirror.🤖 Generated with Claude Code