ci: cancel superseded runs on main, not just on PRs - #663
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
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 push to
mainused a SHA-keyed concurrency group with no cancellation inci.yml,docs.yml, andpackage-preview.yml, so a burst of merges left one queued run per commit (18 queued runs after tonight's four merges). Only the tip matters, so the groups now key ongithub.event.pull_request.number || github.refwithcancel-in-progress: true: a PR push still cancels the superseded PR run, and amainpush (or dispatch) now cancels the supersededmainrun. Merge-queue entries and dispatches on other refs get their own ref-keyed group as before.ci.yml,package-preview.yml: ref-keyed groups, always cancel.docs.yml: ref-keyed group, butmainstays non-cancelling so the Pages deploy job is never killed mid-deployment (workflow-level cancellation would override the job's owncancel-in-progress: false). GitHub already drops superseded pending runs in a group, so themaindocs queue is at most one deep.release.ymlis unchanged:package-releasenever cancels a publish in flight.docs/preview-packages.md,website/docs/{en,zh}/guide/distribution/preview-packages.mdx,website/docs/{en,zh}/guide/start/installation.mdx: drop the "everymaincommit has an installable snapshot" promise — a commit overtaken before its preview published has none; the tip always does.AGENTS.md: notes that the post-merge run to watch is the tip's, since a later push cancels the superseded run.Trade-off accepted (owner request, 2026-09-06): intermediate
maincommits may have no completed CI/preview run.Validation
actionlint .github/workflows/{ci,docs,package-preview}.yml— clean.pnpm build && pnpm docs:site:build— green (website prose changed; dead-link and en/zh parity checks pass).skip-changeset.Deslop
Deslop: Claude Fable 5.1, 0 edits (comments rewritten to describe the new policy; no code).
Self-review
Reviewer:
gpt-5.6-sol-medium(generalPurpose). Five findings, all fixed:docs.yml— workflow-levelcancel-in-progress: truewould override the deploy job'scancel-in-progress: falseand could kill a Pages deployment mid-flight. Fixed —mainruns stay non-cancelling indocs.yml; only PR runs cancel.2–5.
website/docs/{en,zh}/guide/distribution/preview-packages.mdxandwebsite/docs/{en,zh}/guide/start/installation.mdxstill promised per-commit, uncancellablemainpreviews. Fixed — all four pages now describe ref-keyed cancellation and tell readers to pin the tip.Expression check per event (verified by the reviewer):
pull_request→ PR number;push/workflow_dispatchon main →refs/heads/main;merge_group→refs/heads/gh-readonly-queue/main/pr-N-<sha>(unique per entry). No cross-event collisions.Second pass (same reviewer): no merge risks found.