Skip to content

Cancel superseded npm/pnpm/Pipenv compatibility PR runs - #892

Open
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
mainfrom
ci-janitor/compat-concurrency
Open

Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
mainfrom
ci-janitor/compat-concurrency

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

npm-compatibility.yml, pnpm-compatibility.yml and pipenv-compatibility.yml are the only PR-triggered compatibility workflows with no concurrency group. 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_request runs 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:

workflow superseded runs job-min in superseded runs job-min spent after the newer push
npm hosted/vendored compatibility 16 281 215
pnpm hosted compatibility 14 146 103
Pipenv compatibility 22 286 127
total 52 713 445

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 failure but 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:

concurrency:
  group: <wf>-compat-${{ github.event.pull_request.number || github.run_id }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

This differs from the other workflows in one place: non-PR events use github.run_id, not github.ref. Even with cancel-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. With run_id, every main push and workflow_dispatch runs to completion, exactly as today. Only an older run on the same PR gets cancelled.

Proof

  • actionlint 1.7.7 is clean on all three files, before and after. PyYAML parses them.
  • No group name collides with an existing one (grep -rn 'group:' .github/workflows).
  • None of the three workflows saves a shared cache from a PR run, so cancelling one can't leave a cache half-written.

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_helpers currently fails, so test/coverage/test-release are 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_dispatch still get their own group via github.run_id (no cross-cancellation with cancel-in-progress: false on non-PR events).

Also centralizes JVM/Gradle SHA-1 and SHA-256 hex in crate::utils::digest (gradle_cache, jvm_jar, Maven sidecars), replacing scattered sha1/sha2 + hex::encode calls—aligned with the production_digests_go_through_the_helpers expectation.

Reviewed by Cursor Bugbot for commit e7026a2. Configure here.


Generated by Claude Code

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
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) label Oct 5, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

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)
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator Author

Port: test (windows-latest) failed on 69ab074 because of socket_patch_core::utils::digest::tests::production_digests_go_through_the_helpers. That test is red on main too (CI run 37355008322: coverage, test windows/macos and test-release all fail), and I reproduced it locally on main. It is not caused by this PR. I cherry-picked #878's fix (659ac2c, which routes the Gradle/JVM digests through utils::digest) as e7026a2. The test passes locally with it. It becomes a no-op once #878 lands.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

e2e (ubuntu-latest, e2e_vendor_gradle_build e2e_vendor_jvm_build, gradle, 6.9.4, 11, …) failed on e7026a2. Its Run e2e tests step was cancelled 3m43s in ("The operation was canceled"). That isn't a test failure or the job timeout (30 min), and no other job in run 37375215306 failed. The same leg passed in 4–6 min on three other PRs in the previous 30 minutes (runs 37371659596, 37371058386, 37368024575), and this PR only changes workflow concurrency and the digest port. Treating it as a lost runner, so I've re-run that one job once. If it fails again, it's real.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 5, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Burn-down agent: labeled Ready for review at e7026a2 (e7026a28013f38a77ecdf4511ec407a0451573a3).


Generated by Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants