Repository navigation
CI: Skip the heavy workflows on docs-only PRs - #1610
Conversation
Add paths-ignore: "**.md" to ci.yaml, build.yaml and security-scans.yaml pull_request triggers, so a markdown-only PR skips the Go matrix, image builds and CodeQL/Trivy. Spellcheck stays unfiltered — it is the one workflow a docs PR needs. No required status checks exist today, so a filtered-out run cannot block a merge. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 54 minutes. View limit details
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 |
Fixes review: the markdown whitespace hooks left CI when ci.yaml gained paths-ignore, and the spellcheck job is disabled (if: false), so a docs PR would run no markdown check at all. Files: .github/workflows/spellcheck_action.yml Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
clawgenti
left a comment
There was a problem hiding this comment.
Summary
Cutting the CI fleet on docs-only PRs is a good idea, and the build.yaml and security-scans.yaml filters are fine. The ci.yaml filter is not. The PR rests on "markdown can't break any of it", but this repo has a set of doc-drift tests that read .md files and fail when the docs stop matching the code. Those tests run inside ci.yaml, so after this change a docs-only PR that breaks one of them would merge green and only fail on the post-merge push run on main. Details inline. I also left a smaller note on the new pre-commit job, whose comment says it runs on changed files only when it actually runs on all files.
Author: huang195 (MEMBER — maintainer)
Areas reviewed: CI/GitHub Actions, YAML, Security (action pinning)
Agent/IDE config (.claude/.vscode): none
Commits: 2 commits, all signed-off: yes
CI status: pending (DCO, pre-commit, CodeQL-go, Hadolint, and the finished image builds pass; the rest is still running)
| # Footgun: a filtered-out run reports "Expected" forever if this workflow is | ||
| # ever added to branch protection as a required check. | ||
| paths-ignore: | ||
| - "**.md" |
There was a problem hiding this comment.
must-fix: markdown can break this workflow. Several tests that ci.yaml runs read docs from the tree on purpose and fail when the docs drift from the code:
core/sessionapi/doc_endpoints_test.goanddoc_example_test.gocheckdocs/session-api.mdagainst the routes inserver.go(run by Go CI (core))core/plugins/cpex/doc_examples_test.gochecks the configs documented indocs/cpex-plugin.mdcore/pipeline/session_test.go,cmd/agentop/cmd_claudecode_test.goanddoctor_unread_test.gocheckdocs/laptop-service.md(for example, every key inmanagedKeysmust appear in the manual-uninstall steps)cmd/agentop/cmd_opencode_test.gochecksREADME.mdanddocs/agents/opencode.md;cmd/agentop/tui/spend_drawer_test.gocheckscmd/agentop/README.mdagainstspendDrawerTwoColumnMintests/test_script_sdk.pyandtests/test_example_moca_sandbox.pycheckdocs/script-plugin.md(run by Python Tests)scripts/profile-tags/guards_test.goscans every.mdfile for retiredexclude_plugin_*tags
With paths-ignore: "**.md", a docs-only PR that, say, drops a key from laptop-service.md or reintroduces an exclude_plugin_ tag merges green, and the failure only shows up on the next push run on main, after the damage is done. These tests exist to catch exactly that kind of edit.
Options, roughly from simplest:
- Keep the filter on
build.yamlandsecurity-scans.yaml(that's most of the runner time anyway) and leaveci.yamlunfiltered. - Use
paths:with negation and re-include the pinned docs. Order matters, because a later pattern overrides an earlier one:This is fragile, though, because every new doc-drift test needs a matching entry here, and the profile-tags guard reads allpaths: - "**" - "!**.md" - "docs/**.md" - "README.md" - "cmd/agentop/README.md"
.mdfiles. - Run only the cheap doc-reading packages on docs PRs (via
dorny/paths-filter), skipping the matrix and cgo jobs.
Whichever option you pick, the PR description and the comment here should stop claiming that markdown can't break the build.
| pre-commit: | ||
| # ci.yaml skips docs-only PRs (paths-ignore: "**.md"), which used to be the | ||
| # only place these hooks ran in CI. This job restores them: pre-commit runs | ||
| # against changed files only, so on a docs PR it is just the markdown |
There was a problem hiding this comment.
suggestion: the comment is inaccurate. pre-commit/action@v3.0.1 defaults extra_args to --all-files (see its action.yml), so this job runs every hook, ruff included, across the whole tree, not just the changed files. Also, spellcheck_action.yml has no paths filter, so the job runs on every PR, and code PRs now run pre-commit twice (here and in ci.yaml's Pre-commit Checks). That makes the (docs PRs) name misleading.
It's cheap (13s on this PR), so all-files is fine. Just fix the comment and name to match. Alternatively, gate it to docs-only PRs, or pass extra_args: --from-ref origin/${{ github.base_ref }} --to-ref HEAD (with fetch-depth: 0) if changed-files-only is what you meant.
Fixes review: ci.yaml's paths-ignore let docs-only PRs skip the doc-drift tests that read .md files; the spellcheck pre-commit job duplicated the pre-commit job ci.yaml already runs on every PR. Files: .github/workflows/build.yaml, .github/workflows/ci.yaml, .github/workflows/spellcheck_action.yml Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
clawgenti
left a comment
There was a problem hiding this comment.
Summary
Re-review of 60baf1e. Both points from my previous review are resolved. ci.yaml no longer has the paths-ignore filter, so the doc-drift tests (session-api, cpex, laptop-service, agentop, script-plugin, and the profile-tags .md guard) still run on docs-only PRs. The duplicate Pre-commit (docs PRs) job is gone too, so pre-commit runs once per PR, in ci.yaml. The PR description now explains why ci.yaml stays unfiltered. What's left is the filter on build.yaml and security-scans.yaml, and none of those jobs read markdown in a way that can fail (Trivy's scans are informational, exit-code: '0'). I have one nit inline about the sparc-service README comment. It doesn't block merging.
Author: huang195 (MEMBER — maintainer)
Areas reviewed: CI/GitHub Actions, YAML, Security (action pinning)
Agent/IDE config (.claude/.vscode): none
Commits: 3 commits, all signed-off: yes
CI status: passing (all checks green on 60baf1e; Spellcheck and CodeRabbit skipped)
| # Docs edits can't break an image build, so docs-only PRs skip it. One edge: | ||
| # deploy/sparc-service/Dockerfile COPYs that dir's README (pyproject metadata), | ||
| # so deleting it is a docs-only change that fails the build — caught by the | ||
| # push run on main, not the PR. |
There was a problem hiding this comment.
nit: this edge case is better covered than the comment says. ci.yaml is unfiltered now, and its Python Tests (sparc-service) job runs pip install -e '.[dev]' in deploy/sparc-service, where pyproject.toml sets readme = "README.md" for hatchling. If that README is deleted, the editable install fails while building metadata, so the PR goes red before merge rather than only on the post-merge push run. You could reword it to something like "...still caught on the PR by ci.yaml's sparc-service job (hatchling reads it as readme)". Fine to leave as is.
Summary
Docs-only PRs currently trigger every workflow:
ci.yaml(Go matrix + cpexbuilds + Python),
build.yaml(multi-arch Docker builds) andsecurity-scans.yaml(CodeQL, Trivy, Hadolint) all fire onpull_requestwith no paths filter, so every push to a docs branch re-runs the full fleet.
dependabot-tidy.ymlwas the only workflow with a filter.This adds
paths-ignore: ["**.md"]to thepull_requesttriggers of the twoworkflows markdown cannot break:
build.yaml(image builds) — one edge documented at the site:deploy/sparc-service/DockerfileCOPYs that dir's README (pyprojectmetadata), so deleting it is a docs-only change that fails the build;
that is caught by the push run on main, not the PR.
security-scans.yaml(CodeQL, Trivy, Hadolint, shellcheck, YAML lint,Bandit).
ci.yamlstays unfiltered on purpose: several tests it runs are doc-driftchecks that read
.mdfiles from the tree and fail when docs stop matchingthe code —
core/sessionapi's endpoints/examples tests againstdocs/session-api.md,core/plugins/cpexandcore/pipelineagainstdocs/laptop-service.md, agentop's againstREADME.md/docs/agents/,the Python tests against
docs/script-plugin.md, andscripts/profile-tags/guards_test.go, which scans every.mdfile forretired
exclude_plugin_*tags. Filtering those out would let a docs-onlyPR merge green and only fail on the post-merge push run on main.
spellcheck_action.ymlkeeps no filter and keeps its shape as before thisPR: pre-commit already runs on every PR (docs included) in ci.yaml, so no
duplicate job is added here.
push: branches: [main]triggers stay unfiltered — one run per merge,useful as a safety net; the waste was the per-push PR reruns.
paths-ignoreonly skipswhen every changed file matches).
Verified
mainhas no required status checks (required_status_checks: []),so a filtered-out run cannot leave a PR stuck at "Expected — waiting for
status". If one of these workflows is ever added to branch protection, the
escape is the
dorny/paths-filter+ always-run-gate pattern — noted in acomment at each site.
Dogfooding note: this PR changes only
.yamlfiles, so the filter does notmatch and every workflow still runs on it — right for a CI change. The first
PR to actually skip is the next docs-only one.
Assisted-By: Claude (Anthropic AI) noreply@anthropic.com
Deferred (review nit, pre-existing):
spellcheck_action.yml's only remainingjob is
if: false, so every PR triggers a no-op workflow run. Deleting orre-enabling it is out of scope here.