Skip to content

ci: run the full matrix automatically on the paths that break master (#281) - #292

Merged
pftg merged 1 commit into
masterfrom
ci/auto-full-ci-on-risky-paths
Aug 25, 2026
Merged

ci: run the full matrix automatically on the paths that break master (#281)#292
pftg merged 1 commit into
masterfrom
ci/auto-full-ci-on-risky-paths

Conversation

@pftg

@pftg pftg commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Closes the two actionable boxes on #281.

The matrix stays off PRs for free-tier minutes; the consequence is that the job which breaks master is a job that never ran on the PR. Three breakages this week, all invisible behind a green PR for exactly that reason:

breakage path
Rails 7.1-only constant (#283) test/
JRuby has no Kernel#fork (#283) test/
zero-width skip_area mask (#280) test/ + lib/

Every one was caught by adding full-ci by hand, after master was already red — a process that works only when someone remembers.

Change

The matrix now runs automatically when a PR touches test/, gemfiles/ or .github/. The label stays for everything else.

Changed paths are read from the API, not git diff — checkout is depth-1, so the base commit isn't in the clone to diff against.

Self-tested:

test/unit/foo_test.rb        -> FULL MATRIX
gemfiles/rails71_gems.rb     -> FULL MATRIX
.github/workflows/test.yml   -> FULL MATRIX
lib/snap_diff/config.rb      -> skip
README.md                    -> skip

lib/ is deliberately excluded

It changes on nearly every PR, and the functional + minimal-setup jobs already cover it. Including it would run 25 cells on almost everything and hand back the cost decision this exclusion exists to make. That is a trade, not a claim that lib/ is safe — and CONTRIBUTING.md now says exactly that, with guidance on when to add the label by hand.

Also documented in CONTRIBUTING.md

The two reading rules that cost real time this week:

  • cancelled is not a pass. It occupies a verdict's slot while carrying none — the JRuby lane sat broken for 15 consecutive runs looking like this.
  • gh run list --branch master needs --workflow Test. Without it you get whichever workflow ran last; it reported a Dependabot success while Test was failing on the same commit.

Still open on #281 and human-only: branch protection requiring the master-push matrix, once #249 settles the check names.

YAML validated.

Summary by Sourcery

Run the full CI matrix automatically for pull requests that modify historically high-risk paths while documenting the remaining opt-in and CI monitoring rules.

New Features:

  • Automatically run the full Ruby and Rails test matrix for pull requests touching test/, gemfiles/, or .github/.

Enhancements:

  • Retain manual full-ci opt-in for other pull requests while preserving the cost-conscious default.
  • Document CI coverage boundaries, when to use full-ci, and how to interpret cancelled runs and verify the Test workflow on master.

CI:

  • Detect pull request paths through the GitHub API to determine whether the full matrix is required.

Documentation:

  • Add contributor guidance explaining automatic matrix triggers, manual opt-in scenarios, and reliable CI result checking.

…281)

The matrix stays off PRs for free-tier minutes, and the consequence is that the
job which breaks master is a job that never ran on the PR. Three breakages this
week, all invisible on a green PR for exactly that reason:

- a Rails 7.1-only constant (#283)
- JRuby not implementing Kernel#fork (#283)
- a zero-width skip_area mask (#280)

Every one was found by adding `full-ci` BY HAND after master had already gone
red, which is a process that works only when someone remembers.

All three came from `test/`, `gemfiles/` or `.github/`, so the matrix now runs
automatically when a PR touches those. The label stays for everything else.

Paths are asked for over the API rather than `git diff`: checkout is depth-1, so
the base commit is not in the clone to diff against.

`lib/` is deliberately NOT on the list. It changes on nearly every PR, and the
functional and minimal-setup jobs already cover it -- putting it here would run
25 cells on almost everything and give back the cost decision the exclusion
exists to make. That is a trade, not a claim that `lib/` is safe, and
CONTRIBUTING.md says so.

CONTRIBUTING.md also gets the two reading rules that cost real time this week:
`cancelled` is not a pass, and `gh run list --branch master` without
`--workflow Test` will hand you whichever workflow ran last -- it reported a
Dependabot success while `Test` was failing on the same commit.

Detection self-tested against real paths; YAML validated.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @pftg, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 23 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 43 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 672a46c6-4016-46cc-a4e7-6bbb826064eb

📥 Commits

Reviewing files that changed from the base of the PR and between d276752 and 25fad49.

📒 Files selected for processing (2)
  • .github/workflows/test.yml
  • CONTRIBUTING.md

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.

@sourcery-ai

sourcery-ai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR makes the expensive CI matrix run automatically for pull requests touching test/, gemfiles/, or .github/ by querying changed files through the GitHub API, while retaining label-based opt-in and existing cost controls; contributor documentation explains the tradeoffs, manual opt-in cases, and reliable CI-result checks.

Flow diagram for automatic full CI matrix selection

flowchart TD
    A[Pull request event] --> B[GitHub API changed files]
    B --> C{Touches test/ gemfiles/ or .github/?}
    C -->|yes| D[Run full Test Ruby & Rails matrix]
    C -->|no| E{full-ci label present?}
    E -->|yes| D
    E -->|no| F[Run standard cost-controlled CI]
    G[Push to master manual dispatch or weekly drift check] --> D
Loading

File-Level Changes

Change Details Files
Automatically opt pull requests into the full Ruby/Rails matrix when they modify historically high-risk paths, while preserving the existing cost controls for other PRs.
  • Add a pull-request path detector that queries the GitHub API with pagination and emits a job output for changes under test/, gemfiles/, or .github/.
  • Use the detector output in the matrix job condition alongside master pushes, manual/scheduled runs, and the full-ci label.
  • Keep lib/ excluded from automatic matrix runs and retain functional/minimal-setup coverage as the cost-conscious tradeoff.
.github/workflows/test.yml
Document when the full matrix runs and provide guidance for manually opting in and interpreting CI results.
  • Explain the automatic high-risk path triggers, the full-ci label fallback, and why lib/ is intentionally excluded.
  • Warn that cancelled is not a passing verdict and provide the workflow-qualified command for checking the latest master Test run.
CONTRIBUTING.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@pftg
pftg merged commit df78dc0 into master Aug 25, 2026
23 checks passed
@pftg
pftg deleted the ci/auto-full-ci-on-risky-paths branch August 25, 2026 19:39
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