ci: switch doc-skip from workflow paths-ignore to a job-level gate#39
Open
jnasbyupgrade wants to merge 4 commits into
Open
ci: switch doc-skip from workflow paths-ignore to a job-level gate#39jnasbyupgrade wants to merge 4 commits into
jnasbyupgrade wants to merge 4 commits into
Conversation
paths-ignore on the workflow trigger only skips CI when the entire push/PR diff is docs-only; for a PR that also touches code, every commit runs the full matrix even if that commit is doc-only. It's also the classic "stuck Pending" hazard for a required status check: if the whole workflow (including all-checks-passed) never runs, the required check never reports. Add a cheap `changes` job that computes the per-push changed file set (github.event.before/after for push and PR synchronize; PR base/head sha otherwise) and sets docs_only only when every changed file matches .md/.asc, failing safe (docs_only=false) on any diff failure or ambiguous base. Gate `test`, `pg-upgrade-test`, and `extension-update-test` on `needs.changes.outputs.docs_only != 'true'`, and add `changes` to all-checks-passed's needs so it keeps running and reporting on every commit.
Will be reverted before merge.
… path" This reverts commit 63b8042.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
jnasbyupgrade
added a commit
to jnasbyupgrade/cat_tools
that referenced
this pull request
Jul 18, 2026
Doc-only commit to HISTORY.asc to prove, on a live CI run, that the job-level docs-only gate correctly skips the heavy matrix jobs (test, pg-upgrade-test, extension-update-test) while all-checks-passed still runs and reports green. Kept in the branch intentionally as evidence; can be squashed/dropped before merge.
jnasbyupgrade
force-pushed
the
ci-per-commit-docs-gate
branch
from
July 18, 2026 21:03
34892ba to
27e64df
Compare
3 tasks
actions/checkout@v4 pins to the deprecated Node 20 runtime, which GitHub Actions warns about on every run. ci.yml already uses @v6; align claude-code-review.yml and claude.yml so all workflows are on the same, non-deprecated major version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
on.push/on.pull_requestpaths-ignore: ['**.md', '**.asc']only skips CI when the entire push/PR diff is docs-only. For a PR that also touches code, every individual commit runs the full matrix, even a doc-only commit within that PR.paths-ignoreis also the classic "stuck Pending" hazard for a required status check: when the whole workflow (includingall-checks-passed) is skipped by GitHub before it even starts, the required check never reports and a PR can get stuck waiting on a check that will never run.paths-ignorewith a job-level gate: a cheapchangesjob computes the actual per-push changed file set and exposesdocs_only; the three heavy jobs (test,pg-upgrade-test,extension-update-test) are conditioned onneeds.changes.outputs.docs_only != 'true'. The workflow itself now always triggers, soall-checks-passedalways runs and reports — it already treatsskippedjob results as success, so a docs-only commit still reports green promptly instead of running the full matrix or getting stuck.actions/checkout@v4->@v6inclaude-code-review.ymlandclaude.yml, matchingci.yml(already on@v6).@v4pins to the deprecated Node 20 runtime, which GitHub Actions warns about on every run. The warning itself can't be observed on this PR becauseclaude-code-review.ymlruns onpull_request_target, which always executes the workflow file from the base branch (master) — it'll only show as gone once this merges.Details
changesjob: checks out withfetch-depth: 0, computesBASE/HEADfor the diff:push:github.event.before/github.event.afterpull_requestsynchronize(with a usablebefore): samebefore/after, giving the true per-push diff within an open PRpull_requestotherwise (opened/reopened/etc): PRbase.sha/head.shadocs_only=false, i.e. runs the full matrix) ifBASE/HEADare missing,BASEis all-zeros (e.g. a new branch's first push), or thegit diffitself fails.docs_only=trueonly when every changed file matches\.(md|asc)$.test,pg-upgrade-test,extension-update-test: addneeds: [changes]andif: needs.changes.outputs.docs_only != 'true'.all-checks-passed: addchangestoneeds(its pass/fail logic is unchanged — it already treatsskippedas success and only fails onfailure/cancelled).claude-code-review.yml,claude.yml:actions/checkout@v4->actions/checkout@v6(no behavior change, just the deprecated-runtime bump).Branch protection on
masterwas checked before implementing: it currently has no branch protection rule configured (gh api .../branches/master/protectionreturns 404 "Branch not protected"), so there is no required status check today. This change still fixes the correctness problem (full matrix running on doc-only commits within a code PR) and preempts the stuck-Pending hazard for whenever a required check is configured.Test plan
actionlintclean on the modified workflowpython3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))")ci.yml(not docs) — confirmed the full matrix runs and goes green (exercises thedocs_only != 'true'path)test/pg-upgrade-test/extension-update-testare skipped whilechangesandall-checks-passedrun and report green (exercises thedocs_only == 'true'path); that verification commit has since been dropped from the branch (reset + force-push) so the PR diff stays code-onlyactions/checkout@v4->@v6bump forclaude-code-review.yml/claude.yml(from ci: bump actions/checkout to v6 in Claude workflows #41); CI stays green after the bump