fix: pass the job when a newer run superseded this one - #6
Merged
Merged
Conversation
`--cancel-previous` is passed straight through to the CLI, so a newer run from the same CI context can cancel an older run's queued tests. /uploads/status rolls those cancelled tests up to FAILED, so the older EAS job exited 1. The status now carries `supersededBy: <uploadId>` for such a run. When it's present: - log "Superseded by <id>" with the newer run's console link; - set upload_status to SUPERSEDED; - exit 0, whatever dcd exited with (an older CLI exits 2 for it). This mirrors `dcd cloud` 5.6.0, which exits 0 for a superseded run. Nothing changes when the field is absent, as it is on every other run and on APIs that predate it. The verdict moves into src/methods/status.ts (evaluateRun) so it can be unit-tested; the existing branches and messages are unchanged.
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.
Summary
Every
dcd cloudflag is forwarded verbatim, so--cancel-previousalready works through this wrapper (see #5). A newer run from the same CI context cancels the older run's queued tests, and/uploads/statusrolls them up toFAILED. So the older EAS job exited 1.The status now carries
supersededBy: <uploadId>for such a run (dcd C2, not live yet). When it's present the wrapper:Superseded by <id>and the newer run's console link;upload_status=SUPERSEDED;This mirrors
dcd cloud5.6.0, which exits 0 for a superseded run. Nothing changes when the field is absent.The verdict moves into
src/methods/status.ts(evaluateRun) so it can be unit-tested. The existing branches and messages are unchanged.From the 23 Sep docs-vs-production audit (plan section E4).
Tests
pnpm test: 21 tests pass (12 existing + 9 new). The new ones cover PASSED, FAILED with exit 0 (--json-file), a non-zero exit, a non-terminal status, superseded with exit 0 and with exit 2,supersededByabsent/null/empty, and the newer run's link.tsc --noEmit --skipLibCheckis clean.pnpm buildis OK. I also ran the built bundle with stubbednpm/npx:upload_statusSUPERSEDEDSUPERSEDEDFAILEDPASSEDdist/is not committed here. As with #4, the Build Source workflow rebuilds it onmain, and the npm publish workflow builds before publishing.Release
Not released or published. 1.4.0 is planned. #5's README says the older job stays green only from this release, and gives the per-job
DCD_CHECK_NAME/ sharedDCD_GH_RUN_IDadvice.