Repository navigation
fix(relay): run the same-cap headroom gate in the modes the job actually receives - #24343
Merged
Merged
Conversation
…lly receives The parent workflow collapses canary-apply and batch-apply into the job mode apply, so the headroom step's canary-apply/batch-apply condition never held and the gate was skipped on every real roll. Run it wherever the drain runs (apply, rollback before its restart) and in read-only verify; skip only a resumed rollback, which drains nothing. A new workflow-shape test fails on any job step comparing against a mode the parent cannot pass, and on a drain that can run without the headroom check. Claude-Session: ced32ebb-7155-4413-adad-1eccd14c2010
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

ELI5
Before the production relay workflow takes a server out of service, it is supposed to check that the other servers have room for the users that will be moved. That check never ran, because it waited for a mode name the step never receives. This PR makes it run.
What Changed
The production rollout workflow is split in two. The outer workflow takes a dispatch mode (
verify,canary-apply,batch-apply,rollback). Before calling the per-cell job, it turns both apply modes into the single job modeapply. The headroom check added in #24259 only ran when the job's mode wascanary-applyorbatch-apply, and the job never sees those names. So the check was skipped on every real roll; run 36839965464 shows it skipped while the cell drained.The step now runs on
env.ROLLBACK_RESUME != 'true'. Each dispatch mode now behaves like this:verifycanary-apply,batch-applyrollbackbefore its restartrollbackresuming after its restartThe check counts hosts connected to the cell right now. Verify now fails when there is not enough room. In a multi-cell verify, that failure stops the cells after it from being verified, the same as any other verify failure. A cell that a failed canary already drained has about zero. So a rollback of that cell passes the check and is not blocked from recovering.
A new test,
cloud/dev/scripts/relay-same-cap-job-mode-conditions.test.mjs, reads both workflow files and checks three things:inputs.modeagainst a value the job cannot receive.if:expressions. It also checks that verify runs the headroom step.With the old condition, the second and third checks fail.
The docs in
cloud/docs/relay-workflows.mdnow list the modes that run the check.Why
The fix is to tie the check to the drain, not to dispatch names. Two alternatives were rejected:
apply: that would fix this bug but still let rollback drain without a check.The test checks behavior, not one exact string, so the next renamed mode or new drain path fails CI instead of failing silently in production.
Linked Issue
Follow-up to #24259.
Visual Proof
N/A. This changes CI workflow conditions only, with no UI.
Testing
job compares against canary-applyanddrain without headroom check: apply/false.node --testfile in the cloud package passes exceptrelay-load-control-peer.test.mjs. That file fails locally because the lane install is missingtweetnacl, which is unrelated to this change.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Production relay CI only. This has no effect on the desktop app, SSH, mobile, or any platform.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)