Skip to content

ci: cancel superseded PR runs without canceling releases - #674

Merged
samgbafa merged 3 commits into
mainfrom
alex/ci-cancel-superseded-20261120
Nov 20, 2026
Merged

samgbafa merged 3 commits into
mainfrom
alex/ci-cancel-superseded-20261120

Conversation

@samgbafa

Copy link
Copy Markdown
Contributor

Authorization and scope

Sam's decision, 2026-11-20 15:21:24Z via Holden: “do the free fixes. yes tot he cache limte. and yes to the mac/ios changes. no blacksmith please”. Alex confirmed the production restore was over before these workflows were pushed.

Same design as js-sdk #1103, whose exact head 5bb19d6f1d07aa7df8c6112c3d7bef48872c219d passed applicable CI. No runner/vendor migration, retries, skips, continue-on-error, path gating, job changes, or reduced checks.

Change and non-cancellation proof

  • Add missing workflow concurrency to Docker Container and cargo-dist Release.
  • Preserve pending non-PR runs in the five existing PR concurrency groups: logship, personal-node, renewal-scheduler, Rust, write-probe-tests.
  • PR group: workflow name + github.ref; cancel-in-progress is true only for pull_request. New heads of one PR supersede that PR's old runs; different PR refs remain isolated.
  • Every other event uses workflow name + github.run_id, and cancellation is false. Main pushes, tag pushes, releases, merge_group and manual events therefore cannot cancel one another or replace another pending run. cancel-in-progress: false alone would not protect pending runs sharing a group.
  • Workflow diffs contain concurrency and explanatory comments only. Additional changes: cargo-dist preservation config and agent changelog. Jobs, steps, triggers, paths, permissions, check names and runners remain unchanged.

cargo-dist preservation and upgrade tradeoff

release.yml is generated by cargo-dist 0.32.0. Added [workspace.metadata.dist] allow-dirty = ["ci"] to preserve the custom concurrency block during normal generation. Dist no longer regenerates release.yml on upgrades: future dist bumps require a manual workflow update. To regenerate CI explicitly, temporarily remove "ci", regenerate, reapply the PR-only concurrency block, and review the result. This maintenance requirement is also recorded in Cargo.toml and agent.changelog.md.

Observed before: dist generate --check exited 255 because regeneration would delete the concurrency block. After: dist generate --check and normal dist generate passed; release.yml SHA-256 stayed identical. Existing warnings: no PowerShell target and no Homebrew homepage.

Verification

  • Rebased prepared branch onto fetched origin/main, without conflicts.
  • actionlint 1.7.12 -shellcheck= -pyflakes= passed all seven changed workflows.
  • Throwaway smoke using GitHub's @actions/expressions evaluator passed all seven changed blocks: same-PR group/cancellation, distinct-PR isolation, unique non-canceling groups for main/tag/release/merge_group/manual events.
  • YAML structural comparison proved every workflow field except concurrency unchanged; reviewed full diff/stat.
  • No extra push solely to manufacture supersession evidence. Actual precedent: #1103's implementation update canceled six still-running old-head workflows (Authority 44763458835, Web SDK 44763458941, Workspace 44763459011, TC-191 44763459283, TC-192 44763459120, Operations/MCP 44763458902). This PR's supersession is evaluator-proven, not claimed as a new observed cancellation.

Week-later measurement

Historical Nov 14–20 memo: node obsolete-head PR wall-minute share 8%; cache 10.01 GB / 225 entries. This overlaps earlier fixes, not a controlled baseline. No saved-minutes claim yet.

One week after merge, use a full seven-day interval after this change lands. Ordinary-priority GETs only; repeat each date to avoid GitHub's 1,000-result search ceiling:

repo=tinycloud-node
day=YYYY-MM-DD # substitute each date in the seven-day post-merge interval
gh api --paginate --slurp "repos/TinyCloudLabs/$repo/actions/runs?event=pull_request&created=$day&per_page=100"
gh api --paginate --slurp "repos/TinyCloudLabs/$repo/actions/runs/RUN_ID/jobs?filter=all&per_page=100"
gh api "repos/TinyCloudLabs/$repo/actions/cache/usage"
gh api -H 'X-GitHub-Api-Version: 2026-03-10' "repos/TinyCloudLabs/$repo/actions/cache/storage-limit"

Deduplicate run IDs/attempts; pair older/newer runs by workflow ID and PR number (fallback head repo + branch); exclude same-SHA reruns. Identify older runs active when a new-head run was created. Compute success/failure obsolete-head wall minutes divided by all success/failure PR wall minutes; separately report canceled runs and actual job minutes after supersession. Use job completed_at for end times, not mutable run updated_at. This is an explicit estimator, not an exact reproduction of the memo's unavailable weighting implementation.

No merges or manual deploys. No Sam click needed to open/test this PR; normal review/merge remains with maintainers.

- Use unique groups for non-PR events to preserve every deployment and release run.
- Prepared locally only; push and PR remain held during the production restore.
- Isolate main/tag/manual runs in the existing PR concurrency groups.
- Preserve release.yml with allow-dirty=["ci"].
- Document that future dist upgrades require manual workflow updates.
@samgbafa
samgbafa merged commit 751a384 into main Nov 20, 2026
37 checks passed
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