Skip to content

fix(ci): dogfood gate passes cancelled runs through — a cancelled matrix is not a failed one - #3671

Merged
os-zhuang merged 1 commit into
mainfrom
claude/ci-performance-optimization-ms8ll6
Jul 27, 2026
Merged

fix(ci): dogfood gate passes cancelled runs through — a cancelled matrix is not a failed one#3671
os-zhuang merged 1 commit into
mainfrom
claude/ci-performance-optimization-ms8ll6

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #3668.

Why

With cancel-in-progress on, every consecutive push cancels the in-flight run — and the dogfood matrix, as the longest job in the workflow, is almost always the one still running. The gate's catch-all *) branch turned needs.dogfood.result == "cancelled" into exit 1, painting a false red on every superseded SHA (two observed on #3660 alone, logs identical: dogfood matrix aggregate result: cancelled). False reds on a regression gate train people and agents to ignore the one check that must never be ignored.

What

The issue's prescribed one-line fix: cancelled joins the pass branch —

success|skipped|cancelled) echo "Dogfood gate satisfied ($result)." ;;

— plus an inline comment recording the evidence and the rejected alternative.

Safety premise — verified experimentally before landing, per the issue's own ask

The fix is only safe if a real shard failure can never surface as an aggregate cancelled. Ran the experiment (run 30271824408, temporary workflow since removed from the branch): a fail-fast: true matrix where shard 1 exits 1 immediately and shard 2 sleeps until fail-fast cancels it mid-run — the harshest version of "failure and cancellation coexist".

Result: shard 1 concluded failure, shard 2 concluded cancelled, and the aggregate observer printed needs.matrix.result = failure. Failure dominates. An aggregate of cancelled therefore only occurs when the whole run is stopped from outside (concurrency supersession or manual cancel) with no leg having failed — passing it masks no regression.

Notes recorded in the inline comment:

  • Manual cancel of a head run now turns the gate green — the issue's accepted trade-off (the superseded-SHA case, which is the overwhelming majority, is irrelevant to merging since branch protection evaluates the latest SHA).
  • if: !cancelled() on the job was deliberately rejected (as the issue prescribes): a skipped gate publishes no required-check context on that SHA — the chore(ci): cut PR wall-clock ~9.5min → ~5-6min — dedupe dogfood, shard it, cache lint's build #3622 merge-deadlock again.
  • grep 'needs\..*\.result' .github/workflows/*.yml confirms this is the only aggregate gate of this shape, so no sibling occurrences to fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ECTCrcCdZpCHw5zFSgcmGt

…rix is not a failed one

Closes #3668. With cancel-in-progress on, every consecutive push cancelled
the in-flight dogfood matrix (the longest job in the workflow) and the
gate's catch-all branch turned that into a red X on the superseded SHA —
two observed on #3660 alone. False reds train everyone to ignore the one
check that must never be ignored.

Safety premise verified experimentally before landing (per the issue's own
ask): run 30271824408 executed a fail-fast matrix where shard 1 really
failed and fail-fast cancelled shard 2 mid-run — the aggregate
needs.<job>.result reads 'failure', not 'cancelled'. Failure dominates, so
an aggregate of 'cancelled' can only come from the whole run being stopped
externally (supersession or manual cancel) and passing it masks no real
regression. The manual-cancel case going green is the issue's accepted
trade-off; the rejected alternative (skipping the gate via !cancelled())
would republish the #3622 required-context deadlock.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ECTCrcCdZpCHw5zFSgcmGt
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 27, 2026 1:47pm

Request Review

@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation ci/cd tooling labels Jul 27, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 27, 2026 14:11
@os-zhuang
os-zhuang merged commit c2ecfda into main Jul 27, 2026
15 checks passed
@os-zhuang
os-zhuang deleted the claude/ci-performance-optimization-ms8ll6 branch July 27, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd documentation Improvements or additions to documentation size/s tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Dogfood Regression Gate 把 cancelled 当失败 —— 每次连续推送都产生一条假红

2 participants