Skip to content

ci: run each job only for the areas a pull request changes - #604

Closed
sisantaChhatoi wants to merge 2 commits into
BaaRai:mainfrom
sisantaChhatoi:ci/skip-backend-jobs-for-web-only-prs
Closed

sisantaChhatoi wants to merge 2 commits into
BaaRai:mainfrom
sisantaChhatoi:ci/skip-backend-jobs-for-web-only-prs

Conversation

@sisantaChhatoi

@sisantaChhatoi sisantaChhatoi commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Every pull request runs every CI job, whatever it changes:

Change

.github/workflows/ci.yml only. A changes job uses dorny/paths-filter, pinned to the v4.0.3 commit, with plain include/exclude lists (predicate-quantifier: some-with-excludes). Each job runs only when its area changed:

Job Runs when the PR changes…
go, go-stable, govulncheck anything except web/, docs/, extension/, screenshots/, root Markdown (README.md, CHANGELOG.md, …), scripts/benchmark/, scripts/posture_check*
web web/
python .py files, scripts/benchmark/
shell .sh files, scripts/, CHANGELOG.md, or any added file
all anything under .github/
  • Go exclusions: Go code and tests never read docs/, root Markdown, the extension or screenshots. Markdown elsewhere still runs Go: server/shipped_skills_test.go parses skills/*/SKILL.md. The web UI is embedded only with -tags embedui, which CI doesn't use.
  • Shell and added files: scripts/test-bot-context.sh checks that the triage bot's summary lists every top-level directory. A path filter can't detect a new directory, so the shell job (about 8 s) also runs whenever a PR adds files.

Safety

  • Pushes to main always run every job, so nothing lands on main without the full suite.
  • Fail-open: if the changes job fails, every job runs, so a broken filter can't skip checks silently.
  • Go uses an exclusion list: any file not known to be irrelevant (Dockerfile, compose files, go.mod, SQL scripts, …) still runs the Go jobs.
  • Required checks still pass: go and web are required checks. A job skipped by its if: reports "skipped", which branch protection treats as passing. Splitting CI into separate workflows with paths: would instead leave those checks pending forever.
  • The action needs only pull-requests: read and doesn't check out code.

Trade-off: a PR no longer shows results for jobs its change can't affect. A flaky test in such a job surfaces on the next push to main instead.

Tested

  • actionlint (v1.7.7) passes.
  • Evaluated the filters with picomatch 4 (dot: true), the matcher the action uses, under the some-with-excludes rule:
PR changes go web python shell
web only – ✓ – –
web, new file – ✓ – ✓
Go only ✓ – – –
web + Go ✓ ✓ – –
README / docs / extension only – – – –
a skill's SKILL.md ✓ – – –
benchmark .py – – ✓ ✓
CHANGELOG.md – – – ✓
SQL script / go.mod / Dockerfile ✓ – – –/✓
new top-level directory ✓ – – ✓
.github/ workflow or bot script ✓ ✓ ✓ ✓

🤖 Generated with Claude Code

@sisantaChhatoi sisantaChhatoi changed the title ci: skip the Go, Python and shell jobs for web-only pull requests ci: run each job only for the areas a pull request changes Nov 27, 2026
@sisantaChhatoi
sisantaChhatoi force-pushed the ci/skip-backend-jobs-for-web-only-prs branch from fcd0077 to 4bf6d24 Compare November 27, 2026 08:56

@BaaRai BaaRai left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One correctness issue in the new filters: the go filter uses !**/*.md, which also removes skills/*/SKILL.md. The Go tests parse those skill frontmatter files (server/shipped_skills_test.go), so a PR that only edits a skill would skip the go job. Use !*.md for root Markdown only and keep !docs/**.

Also rebase on main: #611 is merged and touched the web job. The rest of the filters and the fail-open changes job look right.

sisantaChhatoi and others added 2 commits November 28, 2026 13:25
Every pull request ran every job: web-only PRs ran the whole Go pipeline
(build, vet, go test with Postgres, -race, go-stable, govulncheck), Go-only
PRs ran the web build, and docs-only PRs ran everything.

A `changes` job uses dorny/paths-filter (pinned to the v4.0.3 commit) with
include/exclude lists, and each job runs only when its area changed:
- go, go-stable, govulncheck: anything except web/, docs/, extension/,
  screenshots/, Markdown and the Python posture/benchmark scripts
- web: web/
- python: .py files and scripts/benchmark/
- shell: .sh files, scripts/, CHANGELOG.md, or any added file (a new
  top-level directory must appear in the triage bot's summary)
Changes under .github/ run every job.

Pushes to main always run every job, and so does a pull request whose
`changes` job fails, so a broken filter can never skip checks silently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`!**/*.md` also excluded skills/*/SKILL.md, which server/shipped_skills_test.go
parses, so a PR editing only a skill would have skipped the go job. Exclude
root Markdown only (`!*.md`); docs/ stays excluded by `!docs/**`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sisantaChhatoi
sisantaChhatoi force-pushed the ci/skip-backend-jobs-for-web-only-prs branch from 4bf6d24 to 6588be1 Compare November 28, 2026 07:56
@sisantaChhatoi

Copy link
Copy Markdown
Contributor Author

Thanks, good catch. I missed that server/shipped_skills_test.go reads skills/*/SKILL.md through filepath.Join("..", "skills").

  • The go filter now excludes root Markdown only (!*.md); docs/ stays excluded by !docs/**. A skill-only PR runs the go jobs again, and so does Markdown inside any Go package. In 6588be1.
  • Rebased on main, so ci: run the tampering-hook tests in the web job #611's test:tamper-hooks step is in the web job.

actionlint passes, and I checked the go filter as committed against skill, package, root, docs, web and extension Markdown.

@BaaRai BaaRai closed this in 91da834 Nov 28, 2026
nohanbluu pushed a commit to nohanbluu/ARTEX that referenced this pull request Nov 28, 2026
BaaRai#604)

Rebased onto main after BaaRai#611 (preserving web test:tamper-hooks).
Fixes the go filter from !**/*.md to !*.md (root-only Markdown) while keeping !docs/** so changes under skills/*/SKILL.md still trigger Go tests (TestShippedSkillsParseCleanly, TestDiscoveryQualityGateTableDriven).
Co-authored-by: Sisanta Chhatoi <sisantaChhatoi@users.noreply.github.com>
@BaaRai

BaaRai commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Landed via #639: the go filter uses !*.md with !docs/** preserved, and test:tamper-hooks stays in the web job. Thanks, Sisanta Chhatoi.

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.

2 participants