Cancel superseded npm/pnpm/Pipenv compatibility PR runs - #892
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
Conversation
npm-compatibility, pnpm-compatibility and pipenv-compatibility had no concurrency group, so every push to a PR left the previous run's full matrix (11, 26 and 6+ jobs) running to completion against a commit nobody will merge. Over the last 100 PR runs of each (about 8 hours), 52 runs were superseded while still running and spent ~445 job-minutes after the newer push landed, competing for runners with the live runs. Group PR runs per PR number with cancel-in-progress, as ci.yml and the other compatibility workflows already do. Every non-PR event gets its own group (run_id) so no main push or dispatch is ever cancelled, not even while pending behind another run in the group. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EQTUzCY6pkBLc3BNJhz9Nu
|
bugbot run Generated by Claude Code |
main has failed socket-patch-core's lib tests since Gradle support (#646) and the digest helpers (#865) both landed. The guard test production_digests_go_through_the_helpers flags three files #646 added that still hash inline: crawlers/gradle_cache.rs, patch/jvm_jar.rs and patch/sidecars/maven.rs. That breaks test, test-release and coverage on every open PR. Each inline sha1/sha256 call now goes through sha1_hex_of or sha256_hex_of, which compute the same lowercase hex. Behaviour is unchanged. Assisted-by: Claude Code:claude-opus-5-5 (cherry picked from commit 659ac2c)
|
Port: Generated by Claude Code |
|
Generated by Claude Code |
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e7026a2. Configure here.
|
Burn-down agent: labeled Ready for review at
Generated by Claude Code |
Problem
npm-compatibility.yml,pnpm-compatibility.ymlandpipenv-compatibility.ymlare the only PR-triggered compatibility workflows with noconcurrencygroup.ci.yml, bun, vlt, go, composer, gradle, pdm, poetry and bench all have one. So when a PR gets a new push, the old run of these three keeps going: npm has 11 jobs (build + 10 npm legs), pnpm has 26, Pipenv 6+. They all run against a commit that will never merge.I looked at the last 100
pull_requestruns of each workflow (2026-10-05, about 11:30–20:35 UTC), counting runs where a newer run on the same branch started before the old one finished:That's about 445 wasted job-minutes in ~9 hours, roughly 1,200/day at the current agent-PR push rate. Those runs also hold runners the live runs need. In the same window several npm/pnpm runs show
failurebut none of their jobs ran a step: they sat queued with no runner and were then cancelled, e.g. 37368805617 (build queued 18 min, zero steps) and 37365426182 (12 install-proof legs queued ~30 min, zero steps). I can't say from the API alone why GitHub cancelled them, but fewer stale jobs in the queue can only help.Root cause
These three workflows have no
concurrency:block. The others got one earlier, and these were missed.Fix
Add a top-level group to each, the same pattern the others use:
This differs from the other workflows in one place: non-PR events use
github.run_id, notgithub.ref. Even withcancel-in-progress: false, GitHub keeps only one pending run per group. A third main push arriving while one main run is in progress and one is queued would cancel the queued one. Withrun_id, every main push andworkflow_dispatchruns to completion, exactly as today. Only an older run on the same PR gets cancelled.Proof
actionlint1.7.7 is clean on all three files, before and after. PyYAML parses them.grep -rn 'group:' .github/workflows).Also in this PR: e7026a2 cherry-picks #878's fix (it routes the Gradle/JVM digests through
utils::digest). On main,production_digests_go_through_the_helperscurrently fails, sotest/coverage/test-releaseare red on every PR. The pick becomes a no-op once #878 lands.Where each test still runs
Nothing is removed. Every leg still runs on every PR head commit, every main push and every dispatch. The only runs dropped are PR runs for a commit that already has a newer push. Required-check names are unchanged.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EQTUzCY6pkBLc3BNJhz9Nu
Note
Low Risk
Workflow concurrency only drops stale PR matrix jobs; Rust changes are refactors to shared digest helpers with no intended behavior change.
Overview
Adds GitHub Actions concurrency to the npm, pnpm, and Pipenv compatibility workflows so a newer push on the same PR cancels the in-flight run, while main pushes and
workflow_dispatchstill get their own group viagithub.run_id(no cross-cancellation withcancel-in-progress: falseon non-PR events).Also centralizes JVM/Gradle SHA-1 and SHA-256 hex in
crate::utils::digest(gradle_cache,jvm_jar, Maven sidecars), replacing scatteredsha1/sha2+hex::encodecalls—aligned with theproduction_digests_go_through_the_helpersexpectation.Reviewed by Cursor Bugbot for commit e7026a2. Configure here.
Generated by Claude Code