Skip to content

fix: pass the job when a newer run superseded this one - #6

Merged
finalerock44 merged 1 commit into
mainfrom
fix/superseded-runs
Sep 24, 2026
Merged

finalerock44 merged 1 commit into
mainfrom
fix/superseded-runs

Conversation

@finalerock44

@finalerock44 finalerock44 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Every dcd cloud flag is forwarded verbatim, so --cancel-previous already works through this wrapper (see #5). A newer run from the same CI context cancels the older run's queued tests, and /uploads/status rolls them up to FAILED. 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:

  • logs Superseded by <id> and the newer run's console link;
  • sets upload_status=SUPERSEDED;
  • exits 0, even if an older CLI exited 2.

This mirrors dcd cloud 5.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, supersededBy absent/null/empty, and the newer run's link.

  • tsc --noEmit --skipLibCheck is clean.

  • pnpm build is OK. I also ran the built bundle with stubbed npm/npx:

    Case Exit upload_status
    superseded, dcd exit 0 0 SUPERSEDED
    superseded, dcd exit 2 0 SUPERSEDED
    failed 1 FAILED
    passed 0 PASSED

dist/ is not committed here. As with #4, the Build Source workflow rebuilds it on main, 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 / shared DCD_GH_RUN_ID advice.

`--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.
@finalerock44
finalerock44 merged commit ca40036 into main Sep 24, 2026
2 checks passed
@finalerock44
finalerock44 deleted the fix/superseded-runs branch September 24, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant