Skip to content

ci: run three PR guards only when the PR touches their paths - #2597

Merged
lilyshen0722 merged 1 commit into
mainfrom
sre-ci-guard-path-filters
Oct 24, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
sre-ci-guard-path-filters

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Three PR guards now run only when a PR touches the files they check.

Why. On 10-24 the rebase wave put 165 runs in the Actions queue, and the five merge-group builds enqueued at 07:38Z were still waiting for runners 16 minutes later. Cancel-in-progress is already set on 9 of the 11 PR workflows, so superseded runs weren't the problem. The volume was: every push to every PR starts about 8 workflows, and three of them can't change their answer unless the PR touches their files.

guard runs on a PR only when it touches
ADR Numbering Guard docs/adr/**, scripts/verify-adr-numbering.js, its own workflow
Review Checklist Numbering Guard docs/development/review-checklist.md, scripts/verify-numbered-rules.js, its own workflow
Package Version Guard cli/**, commonly-mcp/**, its own workflow

What doesn't change.

  • The only required check is Test & Coverage, and none of these is it, so a skipped guard never blocks a PR or the merge queue.
  • The push-to-main arms of both numbering guards are untouched, so main still flags a duplicate ADR or rule number within a minute of the merge.
  • edited stays in the trigger types. The path filter is evaluated against the PR's full diff, so a retargeted stacked PR that touches these paths still runs.

Checks. All three files parse, with types and paths read back. Nothing in the repo pins these trigger blocks; the only references are prose in two scripts and two docs.

Rollback. Revert this commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_01V7T2fgquLRaqaYiGLC6Dey

…ch their paths

Three PR guards ran a full runner on every push to every PR, though only
a PR touching their files can change their answer. On 10-24 the rebase
wave put 165 runs in the Actions queue and the merge-group build waited
16+ minutes for a runner. Path filters cut 3 of the ~8 workflows each
ordinary push starts. None is a required check, so a skipped run never
blocks a PR; the push-to-main arms are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V7T2fgquLRaqaYiGLC6Dey
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between bf0bd59 and 079fa42.

Files selected for processing: 3
  • .github/workflows/adr-numbering-guard.yml
  • .github/workflows/package-version-guard.yml
  • .github/workflows/review-checklist-numbering-guard.yml

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

Three GitHub Actions guard workflows now use path filters. The filters limit runs to changes in the files each guard checks and its own workflow file. The ADR guard filters push and pull request events; the package version guard filters pull requests; the checklist guard filters pull requests.

Changes: Guard workflow triggers

Layer / File(s) Summary
Filter guard workflow triggers
.github/workflows/adr-numbering-guard.yml, .github/workflows/package-version-guard.yml, .github/workflows/review-checklist-numbering-guard.yml
The ADR guard filters push and pull request events by relevant paths. The package version guard and review checklist guard add path filters to pull requests. The checklist guard's push behavior is unchanged.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Possibly related issues

  • Issue 1373 concerns the Package Version Guard's run behavior. This PR adds path filters to that workflow but does not change branch protection.
  • Issue 1402 concerns ADR number validation. This PR filters the ADR guard by ADR document and verification script changes.
  • Issue 1414 concerns concurrent additions to the review checklist. This PR filters the checklist guard by changes to that file.

Possibly related PRs

  • Team-Commonly/commonly#2462: Both PRs address path-based CI execution. This PR adds filters to three guard workflows, while #2462 discusses the test gate and does not modify these workflows.
Merge Risk: Minimal · up to 079fa

This change only narrows when three guard workflows run on pull requests, so routine PRs that touch none of their paths no longer consume runners. No behavior change or concrete merge risk was found.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly states that three CI guards now run only when pull requests change their relevant paths.
Description check Passed The description directly explains the path-filter changes, affected workflows, rationale, unchanged behavior, and rollback plan.
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.
Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 3
  • Waived: $0.75 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

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

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#2597 at exact head 079fa42 — CODE PASS

The ADR guard's PR filter covers docs/adr/**, its verifier script and its workflow. The checklist guard covers the rule file, its verifier script and its workflow. The package guard covers both published package trees, including each src and package.json, plus its workflow. These are all files the three PR checks read or whose changes can alter their answers. The ADR and checklist push: main trigger blocks and jobs are unchanged; the package guard had no main-push arm. The three YAML files parse with the expected types and paths, and git diff --check passes.

Credit to @lily-shen for the exact-head gate ask and SRE for the scoped workflow change.

Written by Sable, a Commonly agent — https://commonly.me/v2/pods/6a692a1be833c668acdb84cf

GATE: PASS

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