Skip to content

[MAINTENANCE] Skip code CI jobs for docs-only PRs#11792

Merged
wookasz merged 3 commits into
developfrom
ci/skip-code-tests-for-docs-only-prs
Apr 8, 2026
Merged

[MAINTENANCE] Skip code CI jobs for docs-only PRs#11792
wookasz merged 3 commits into
developfrom
ci/skip-code-tests-for-docs-only-prs

Conversation

@wookasz

@wookasz wookasz commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

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-changes job: Uses GitHub API to paginate PR files and sets docs_only=true when every changed file is under docs/; always false for non-PR events (schedule, tags, merge queue)
  • Conditional code jobs: static-analysis and unit-tests skip when docs_only=true, cascading to all downstream jobs (marker-tests, cloud-tests, integration-tests, min-version tests, etc.)
  • docs-snippets decoupled from unit-tests: Uses !cancelled() && needs.unit-tests.result != 'failure' so snippet validation still runs on docs-only PRs
  • ci-required gate job: Single required status check for branch protection — fails on any upstream failure/cancellation; on non-docs PRs, explicitly requires static-analysis and unit-tests to be success (not merely skipped) to prevent misconfiguration silently bypassing code checks
  • doc-checks, docs-build, and docs-tests run unconditionally on every PR

Follow-up

After merging, update branch protection rules to require only ci-required instead of individual job names.


  • Description of PR changes above includes a link to an existing GitHub issue
  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB], [MINORBUMP]
  • Code is linted - run invoke lint (uses ruff format + ruff check)
  • Appropriate tests and docs have been updated

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!

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>
Copilot AI review requested due to automatic review settings April 8, 2026 17:45
@netlify

netlify Bot commented Apr 8, 2026

Copy link
Copy Markdown

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit 4e91ded
🔍 Latest deploy log https://app.netlify.com/projects/niobium-lead-7998/deploys/69d6967f8531e6000828b6b5

@codecov

codecov Bot commented Apr 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.67%. Comparing base (ab97bfe) to head (4e91ded).
⚠️ Report is 5 commits behind head on develop.
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ
3.10 73.59% <ø> (ø)
3.11 73.62% <ø> (-0.02%) ⬇️
3.12 73.62% <ø> (-0.02%) ⬇️
3.13 73.64% <ø> (+0.01%) ⬆️
3.13 athena 41.92% <ø> (ø)
3.13 aws_deps 45.18% <ø> (ø)
3.13 big 55.26% <ø> (ø)
3.13 bigquery 51.25% <ø> (ø)
3.13 clickhouse 41.93% <ø> (ø)
3.13 databricks 53.05% <ø> (ø)
3.13 filesystem 64.37% <ø> (ø)
3.13 gx-redshift 51.40% <ø> (ø)
3.13 mysql 51.80% <ø> (ø)
3.13 openpyxl or pyarrow or project or sqlite or aws_creds 59.96% <ø> (ø)
3.13 postgresql 55.22% <ø> (ø)
3.13 snowflake 53.89% <ø> (-0.01%) ⬇️
3.13 spark 55.91% <ø> (ø)
3.13 spark_connect 46.85% <ø> (ø)
3.13 sql_server 53.23% <ø> (ø)
3.13 trino 48.74% <ø> (ø)
cloud 0.00% <ø> (ø)
docs-basic 59.51% <ø> (ø)
docs-creds-needed 58.11% <ø> (ø)
docs-spark 57.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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>

Copilot AI 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.

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-changes job that determines whether a PR modifies only docs/ paths via the GitHub API.
  • Skip static-analysis and unit-tests when detect-changes reports a docs-only PR (cascading skips to downstream jobs via needs).
  • Add a ci-required aggregation 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.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
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>
@wookasz

wookasz commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please re-review

Copilot AI commented Apr 8, 2026

Copy link
Copy Markdown

@copilot please re-review

All three review comments have been addressed across the 3 commits in this PR:

  1. docs-snippets decoupled from unit-tests (commit 0378625): The job now uses !cancelled() && needs.unit-tests.result != 'failure' so it runs on docs-only PRs (where unit-tests is skipped) while still gating on unit-tests not having failed for code PRs.

  2. ci-required hardening (commit 4e91ded): When docs_only != 'true', the gate now explicitly requires both static-analysis and unit-tests to have success — a misconfiguration that unexpectedly skips them on a non-docs PR will now fail the gate rather than silently pass.

  3. Renamed files check (marked resolved by @wookasz): The simpler f.filename.startsWith('docs/') approach was accepted as an OK compromise.

@wookasz wookasz added this pull request to the merge queue Apr 8, 2026
Merged via the queue into develop with commit a577454 Apr 8, 2026
57 checks passed
@wookasz wookasz deleted the ci/skip-code-tests-for-docs-only-prs branch April 8, 2026 20:23
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.

5 participants