Repository navigation
fix(ci): key main concurrency on commit SHA so every commit runs - #1767
Conversation
On push to main the concurrency group resolved to a single shared group keyed on github.ref_name (always 'main'). GitHub Actions keeps only one in-progress + one pending run per group, so rapid commits to main supersede and cancel the previously-pending run before it can finish. Key the push-to-main case on github.sha instead, giving each commit its own group so it always runs to completion. PR behavior is unchanged: per-PR group with cancel-in-progress to drop superseded runs. Applied to both PR Test (SMG) and PR Test (MLX). Signed-off-by: key4ng <rukeyang@gmail.com>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo GitHub Actions workflow files ( ChangesCI Concurrency Group Key Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Looks good — the fix correctly gives each main-branch commit its own concurrency group by keying on github.sha instead of github.ref_name. Both affected workflows are updated consistently, PR cancellation behavior is unchanged, and no other workflows had this pattern.
Description
Problem
CI runs for commits on
mainwere being cancelled. On push tomain, the concurrency group resolved to a single shared group keyed ongithub.ref_name(alwaysmain):GitHub Actions allows only one in-progress + one pending run per concurrency group. When commits land on
mainfaster than CI completes, each new push supersedes and cancels the previously-pending run before it can finish. This was observed in a recent burst of four commits within ~2 minutes — three runs were cancelled in 25–49s and only the latest survived.Solution
Key the push-to-
maincase ongithub.shainstead ofgithub.ref_name, so each commit onmaingets its own concurrency group and always runs to completion. PR behavior is unchanged: per-PR group withcancel-in-progressso superseded PR runs are still dropped to save CI resources.Changes
pr-test-rust.yml(PR Test (SMG)) — push-to-main concurrency group now keys ongithub.sha.pr-test-mlx.yml(PR Test (MLX)) — same fix for the identical pattern (consistency).cancel-pr-workflows.ymlkeys cleanup on the per-PR groups, which are unchanged, so PR-close cleanup is unaffected.Test Plan
mainin quick succession.mainruns to completion in its own concurrency group.cancel-in-progress).Checklist
cargo +nightly fmtpassescargo clippy --all-targets --all-features -- -D warningspassesSummary by CodeRabbit