Repository navigation
ci: run each job only for the areas a pull request changes - #604
sisantaChhatoi wants to merge 2 commits into
Conversation
fcd0077 to
4bf6d24
Compare
BaaRai
left a comment
There was a problem hiding this comment.
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.
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>
4bf6d24 to
6588be1
Compare
|
Thanks, good catch. I missed that
|
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>
|
Landed via #639: the go filter uses !*.md with !docs/** preserved, and test:tamper-hooks stays in the web job. Thanks, Sisanta Chhatoi. |
Problem
Every pull request runs every CI job, whatever it changes:
go(build, vet,go testagainst Postgres, the race run),go-stable,govulncheck,pythonandshell.web(npm ciplus a full Next build).Change
.github/workflows/ci.ymlonly. Achangesjob usesdorny/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:go,go-stable,govulncheckweb/,docs/,extension/,screenshots/, root Markdown (README.md,CHANGELOG.md, …),scripts/benchmark/,scripts/posture_check*webweb/python.pyfiles,scripts/benchmark/shell.shfiles,scripts/,CHANGELOG.md, or any added file.github/docs/, root Markdown, the extension or screenshots. Markdown elsewhere still runs Go:server/shipped_skills_test.goparsesskills/*/SKILL.md. The web UI is embedded only with-tags embedui, which CI doesn't use.scripts/test-bot-context.shchecks 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
mainalways run every job, so nothing lands onmainwithout the full suite.changesjob fails, every job runs, so a broken filter can't skip checks silently.go.mod, SQL scripts, …) still runs the Go jobs.goandwebare required checks. A job skipped by itsif:reports "skipped", which branch protection treats as passing. Splitting CI into separate workflows withpaths:would instead leave those checks pending forever.pull-requests: readand 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
maininstead.Tested
actionlint(v1.7.7) passes.dot: true), the matcher the action uses, under thesome-with-excludesrule:SKILL.md.pyCHANGELOG.mdgo.mod/ Dockerfile.github/workflow or bot script🤖 Generated with Claude Code