Skip to content

ci: switch doc-skip from workflow paths-ignore to a job-level gate#39

Open
jnasbyupgrade wants to merge 4 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:ci-per-commit-docs-gate
Open

ci: switch doc-skip from workflow paths-ignore to a job-level gate#39
jnasbyupgrade wants to merge 4 commits into
Postgres-Extensions:masterfrom
jnasbyupgrade:ci-per-commit-docs-gate

Conversation

@jnasbyupgrade

@jnasbyupgrade jnasbyupgrade commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • on.push/on.pull_request paths-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.
  • Workflow-level paths-ignore is also the classic "stuck Pending" hazard for a required status check: when the whole workflow (including all-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.
  • This PR replaces the workflow-level paths-ignore with a job-level gate: a cheap changes job computes the actual per-push changed file set and exposes docs_only; the three heavy jobs (test, pg-upgrade-test, extension-update-test) are conditioned on needs.changes.outputs.docs_only != 'true'. The workflow itself now always triggers, so all-checks-passed always runs and reports — it already treats skipped job results as success, so a docs-only commit still reports green promptly instead of running the full matrix or getting stuck.
  • Also rolled in (from ci: bump actions/checkout to v6 in Claude workflows #41): bump actions/checkout@v4 -> @v6 in claude-code-review.yml and claude.yml, matching ci.yml (already on @v6). @v4 pins to the deprecated Node 20 runtime, which GitHub Actions warns about on every run. The warning itself can't be observed on this PR because claude-code-review.yml runs on pull_request_target, which always executes the workflow file from the base branch (master) — it'll only show as gone once this merges.

Details

  • changes job: checks out with fetch-depth: 0, computes BASE/HEAD for the diff:
    • push: github.event.before / github.event.after
    • pull_request synchronize (with a usable before): same before/after, giving the true per-push diff within an open PR
    • pull_request otherwise (opened/reopened/etc): PR base.sha / head.sha
    • Fails safe (docs_only=false, i.e. runs the full matrix) if BASE/HEAD are missing, BASE is all-zeros (e.g. a new branch's first push), or the git diff itself fails.
    • Sets docs_only=true only when every changed file matches \.(md|asc)$.
  • test, pg-upgrade-test, extension-update-test: add needs: [changes] and if: needs.changes.outputs.docs_only != 'true'.
  • all-checks-passed: add changes to needs (its pass/fail logic is unchanged — it already treats skipped as success and only fails on failure/cancelled).
  • claude-code-review.yml, claude.yml: actions/checkout@v4 -> actions/checkout@v6 (no behavior change, just the deprecated-runtime bump).

Branch protection on master was checked before implementing: it currently has no branch protection rule configured (gh api .../branches/master/protection returns 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

  • actionlint clean on the modified workflow
  • YAML parses (python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))")
  • This PR's own diff touches ci.yml (not docs) — confirmed the full matrix runs and goes green (exercises the docs_only != 'true' path)
  • Pushed a doc-only follow-up commit and confirmed test/pg-upgrade-test/extension-update-test are skipped while changes and all-checks-passed run and report green (exercises the docs_only == 'true' path); that verification commit has since been dropped from the branch (reset + force-push) so the PR diff stays code-only
  • Rolled in actions/checkout@v4 -> @v6 bump for claude-code-review.yml/claude.yml (from ci: bump actions/checkout to v6 in Claude workflows #41); CI stays green after the bump

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.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8748bd7e-6e87-411b-a8f9-50af72070214

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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
jnasbyupgrade force-pushed the ci-per-commit-docs-gate branch from 34892ba to 27e64df Compare July 18, 2026 21:03
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.
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