Skip to content

ci: cancel stale PR test runs - #1530

Merged
zhyncs merged 1 commit into
mainfrom
zhyncs/cancel-stale-pr-tests
May 24, 2026
Merged

zhyncs merged 1 commit into
mainfrom
zhyncs/cancel-stale-pr-tests

Conversation

@zhyncs

@zhyncs zhyncs commented May 24, 2026 •

Copy link
Copy Markdown
Member

Summary

  • use stable PR-number concurrency groups for SMG and MLX PR test workflows
  • cancel in-progress PR test runs when a PR is merged via a lightweight closed-PR workflow
  • enable cancellation for superseded push-to-main PR test runs

Testing

  • pre-commit run --all-files
  • git diff --cached --check

Summary by CodeRabbit

Release Notes

  • Chores
    • Automated cancellation of test runs for merged pull requests to reduce unnecessary CI processing
    • Enhanced pull request test concurrency management for more efficient feedback

Review Change Stack

Signed-off-by: zhyncs <46627482+zhyncs@users.noreply.github.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented May 24, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2ff7be14-61e9-4c4e-89ff-1f2ee61f7c6a

📥 Commits

Reviewing files that changed from the base of the PR and between e8c8161 and e448042.

📒 Files selected for processing (3)
  • .github/workflows/cancel-merged-pr-tests.yml
  • .github/workflows/pr-test-mlx.yml
  • .github/workflows/pr-test-rust.yml

📝 Walkthrough

Walkthrough

This PR improves CI test concurrency management by adding a new workflow to explicitly cancel merged PR test runs and updating existing test workflows to use PR-specific concurrency grouping with unconditional cancellation behavior.

Changes

CI Test Concurrency Management

Layer / File(s) Summary
New merged PR cancellation workflow
.github/workflows/cancel-merged-pr-tests.yml
Creates a workflow triggered on merged PRs to main that runs two jobs (gateway-tests and mlx-tests) configured with concurrency groups keyed to the PR number to cancel any in-progress test runs for that specific PR.
PR-based concurrency group updates
.github/workflows/pr-test-mlx.yml, .github/workflows/pr-test-rust.yml
Updates concurrency configuration to use PR-specific group names (e.g., mlx-tests-pr-{number} and pr-<number>) for pull request events and sets cancel-in-progress to always true instead of conditionally based on event type.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • lightseekorg/smg#678: Modifies the same concurrency settings in .github/workflows/pr-test-rust.yml for cancellation behavior.

Suggested labels

ci

Suggested reviewers

  • CatherineSue
  • key4ng
  • slin1237
  • XinyueZhang369

Poem

🐇 When tests merge and multiply with haste,
A new workflow channels them—no waste!
PR numbers guide the concurrency dance,
Old runs cancel, fresh ones advance.
Swift, clean, and clever—not a second to waste!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: cancel stale PR test runs' accurately summarizes the main objective of the pull request, which is to configure GitHub Actions workflows to cancel outdated PR test runs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch zhyncs/cancel-stale-pr-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the ci CI/CD configuration changes label May 24, 2026

@claude claude 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.

CI-only change. Concurrency group names are consistent between the cancel workflow and test workflows. The cancel-on-merge mechanism correctly uses GitHub's built-in concurrency cancellation. No issues found.

@zhyncs

zhyncs commented May 24, 2026

Copy link
Copy Markdown
Member Author

This PR satisfies the requested behavior for the two PR test workflows:

  • When a PR is merged, a lightweight pull_request.closed workflow starts and reuses the same concurrency groups as the PR test workflows,
    so any still-running PR Test (SMG) or PR Test (MLX) runs for that PR are cancelled.
  • When a new commit lands on main, PR Test (SMG) and PR Test (MLX) now use branch-based concurrency with cancel-in-progress: true, so the
    previous main run is cancelled.

Caveat: this only applies to PR Test (SMG) and PR Test (MLX), not labeler, Claude review, PR validation, or other workflows. The behavior takes effect after this PR is merged into main.

@zhyncs
zhyncs merged commit f63db81 into main May 24, 2026
14 of 17 checks passed
@zhyncs
zhyncs deleted the zhyncs/cancel-stale-pr-tests branch May 24, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD configuration changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant