[MAINTENANCE] Skip code CI jobs for docs-only PRs#11792
Conversation
Add a detect-changes job that checks whether a PR only modifies files under docs/. When true, static-analysis and unit-tests are skipped, which cascades to skip all downstream code jobs (marker-tests, cloud-tests, integration-tests, min-version tests, etc.). A new ci-required gate job serves as the single required status check for branch protection — it passes when all upstream jobs either succeeded or were appropriately skipped. doc-checks, docs-build, and docs-tests continue to run on every PR. After merging, update branch protection to require only `ci-required`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for niobium-lead-7998 canceled.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11792 +/- ##
========================================
Coverage 84.67% 84.67%
========================================
Files 471 471
Lines 39176 39176
========================================
Hits 33171 33171
Misses 6005 6005
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Snippet source files live under docs/, so docs-only PRs can break them. Use !cancelled() to prevent auto-skip when unit-tests is skipped, while still gating on unit-tests not having failed for code PRs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the main CI workflow to avoid running expensive code/test jobs for docs-only pull requests while still running documentation validation, and introduces a single aggregate gate job intended to be the sole required branch protection check.
Changes:
- Add a
detect-changesjob that determines whether a PR modifies onlydocs/paths via the GitHub API. - Skip
static-analysisandunit-testswhendetect-changesreports a docs-only PR (cascading skips to downstream jobs vianeeds). - Add a
ci-requiredaggregation job that fails only when any upstream job fails/cancels, otherwise passing when jobs succeed or are skipped.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When docs_only is not true, explicitly require static-analysis and unit-tests to have succeeded rather than accepting skipped. This prevents a misconfiguration from silently bypassing code checks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@copilot please re-review |
All three review comments have been addressed across the 3 commits in this PR:
|
Avoids running expensive code/test jobs on PRs that only touch
docs/files, while still running documentation validation. Adds a single aggregate gate job for branch protection.Changes
detect-changesjob: Uses GitHub API to paginate PR files and setsdocs_only=truewhen every changed file is underdocs/; alwaysfalsefor non-PR events (schedule, tags, merge queue)static-analysisandunit-testsskip whendocs_only=true, cascading to all downstream jobs (marker-tests,cloud-tests,integration-tests, min-version tests, etc.)docs-snippetsdecoupled fromunit-tests: Uses!cancelled() && needs.unit-tests.result != 'failure'so snippet validation still runs on docs-only PRsci-requiredgate job: Single required status check for branch protection — fails on any upstream failure/cancellation; on non-docs PRs, explicitly requiresstatic-analysisandunit-teststo besuccess(not merelyskipped) to prevent misconfiguration silently bypassing code checksdoc-checks,docs-build, anddocs-testsrun unconditionally on every PRFollow-up
After merging, update branch protection rules to require only
ci-requiredinstead of individual job names.invoke lint(usesruff format+ruff check)For more information about contributing, visit our community resources.
After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!