Skip to content

ci(pr): gate builds on changed-files and broaden safe exclusions#1118

Merged
rapids-bot[bot] merged 3 commits intomainfrom
ci-pr-workflow-gating
Apr 17, 2026
Merged

ci(pr): gate builds on changed-files and broaden safe exclusions#1118
rapids-bot[bot] merged 3 commits intomainfrom
ci-pr-workflow-gating

Conversation

@rgsl888prabhu
Copy link
Copy Markdown
Collaborator

Summary

Reduces PR CI time by skipping build jobs when no downstream test or doc consumer needs them, and by excluding more files that never affect builds or tests.

Build gating (`if:`):

  • `conda-cpp-build`: `test_cpp ∨ test_python_conda ∨ build_docs`
  • `conda-python-build`: `test_python_conda ∨ build_docs`
  • All 5 `wheel-build-*`: `test_python_wheels`

New exclusions (applied to all 4 changed-file groups):

  • `**/*.md` (docs are `.rst`), `LICENSE`, `.gitattributes`, `.gitignore`, `.clang-format`, `.github/release.yml`
  • `ci/thirdparty-testing/**` (only invoked by `nightly.yaml`)
  • `.github/workflows/*.yaml` files not reachable from `pr.yaml` (`build.yaml`, `nightly.yaml`, `cloud_ci.yaml`, etc.) — `self_hosted_service_test.yaml` is deliberately kept

Safety

Each group still begins with `'**'` (include everything). `!` lines only remove paths, so any new file that isn't explicitly excluded triggers full CI — fail-closed default preserved.

Expected impact

PR touches only… Before After
Markdown / LICENSE / .clang-format full build+test matrix `checks` only
`ci/thirdparty-testing/**.sh` full build+test matrix `checks` only
Nightly-only workflow files full build+test matrix `checks` only
`notebooks/` or `docs//*.rst` full matrix skips 5 wheel builds + wheel tests
`cpp/` or `python/` unchanged unchanged

Extends pr.yaml so build jobs are skipped when none of their downstream
test or docs consumers need to run, and adds exclusions for files that
never affect builds or tests.

Build gating (if: conditions):
- conda-cpp-build: test_cpp OR test_python_conda OR build_docs
- conda-python-build: test_python_conda OR build_docs
- wheel-build-cuopt-mps-parser / libcuopt / cuopt / cuopt-server /
  cuopt-sh-client: test_python_wheels

New exclusions added to all four changed-file groups (build_docs,
test_cpp, test_python_conda, test_python_wheels):
- **/*.md (docs are .rst; Markdown is human-only)
- LICENSE, .gitattributes, .gitignore, .clang-format, .github/release.yml
- ci/thirdparty-testing/** (invoked only by nightly.yaml)
- .github/workflows/*.yaml files not reachable from pr.yaml

Each group still begins with '**' so any path not on the exclusion list
triggers full CI — the fail-closed default is preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Apr 16, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@rgsl888prabhu rgsl888prabhu added breaking Introduces a breaking change improvement Improves an existing functionality labels Apr 16, 2026
@rgsl888prabhu rgsl888prabhu self-assigned this Apr 17, 2026
build_docs ingests Markdown via MyST-NB (docs/cuopt/source/conf.py),
and docs/cuopt/source/release-notes.md is a symlink to RELEASE-NOTES.md.
Blanket '!**/*.md' would have wrongly skipped docs-build on release-notes
or docs/*.md edits. Narrow the exclusion to root-level READMEs /
CONTRIBUTING / CHANGELOG, which are not docs inputs.

'!**/*.md' is still applied to test_cpp, test_python_conda, and
test_python_wheels -- those jobs don't process markdown.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rgsl888prabhu rgsl888prabhu marked this pull request as ready for review April 17, 2026 15:42
@rgsl888prabhu rgsl888prabhu requested a review from a team as a code owner April 17, 2026 15:42
@rgsl888prabhu rgsl888prabhu requested a review from vyasr April 17, 2026 15:42
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f580be0-eab9-4fbc-b5ca-79f46cf4d536

📥 Commits

Reviewing files that changed from the base of the PR and between 248173e and 145817d.

📒 Files selected for processing (1)
  • .github/workflows/pr.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/pr.yaml

📝 Walkthrough

Walkthrough

Updated the GitHub Actions PR workflow (.github/workflows/pr.yaml) to expand changed-files exclusion patterns for several test/build groups and to gate downstream build jobs (conda-cpp-build, conda-python-build, wheel-build-*) using changed-files output groups.

Changes

Cohort / File(s) Summary
Exclusion Pattern Expansions
​.github/workflows/pr.yaml
Expanded changed-files exclude patterns for build_docs, test_cpp, test_python_conda, and test_python_wheels groups (added exclusions like !.clang-format, !.gitattributes, !**/*.md, .github/* workflow/config excludes, ci/thirdparty-testing/**, and adjusted ci/utils/*/plugin/resource-related patterns).
Downstream Job Gating
​.github/workflows/pr.yaml
Added changed-files to needs and introduced if: conditions so conda-cpp-build, conda-python-build, and wheel-build-* jobs run only when corresponding changed_file_groups (test_cpp, test_python_conda, test_python_wheels) are present.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: gating builds based on changed files and broadening file exclusions to skip unnecessary CI jobs.
Description check ✅ Passed The description clearly explains the PR's purpose, detailing build gating logic, new exclusions, safety mechanisms, and expected impact with concrete examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 ci-pr-workflow-gating

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

Copy link
Copy Markdown
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Approving, as I don't think this will cause any correctness problems, but ... I want to mention some reasons why "build unconditionally" is beneficial, in case you haven't considered them:

  1. keeps sccache cache fresh (more PRs = faster building for everyone)
  2. keeps CI scripts simpler (no need to have checks for whether or not a given run generated artifacts)
  3. amortizes the work of detecting and reacting to build issues over time (instead of relying on nightlies to catch them)

I also think it's worth reflecting on the cumulative complexity here... the logic for which CI runs when is getting really complicated in this project (I am thinking about changes like #931 coming too).

If you think the time / resource savings from these changes are worth that complexity and maintenance burden, I won't get in the way.

Comment thread .github/workflows/pr.yaml Outdated
@jameslamb jameslamb removed the request for review from vyasr April 17, 2026 16:54
Per review feedback, merge the added exclusions into each group's list
in alphabetical order and drop the interstitial grouping comments so the
order is uniform. No behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rgsl888prabhu
Copy link
Copy Markdown
Collaborator Author

/merge

@rapids-bot rapids-bot Bot merged commit 6b0d8a4 into main Apr 17, 2026
206 of 209 checks passed
@rgsl888prabhu rgsl888prabhu deleted the ci-pr-workflow-gating branch April 24, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Introduces a breaking change improvement Improves an existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants