Repository navigation
ci: gate job families on go/sdk/site path relevance - #1644
Merged
Merged
Conversation
Extend the `changes` classifier with three fail-closed, trusted-base-ref relevance flags so a change that provably cannot affect a job family skips that family's runners: - go_relevant — the Go build/test matrix (build, test-race, analysis/lint, vuln, fuzz-smoke, engine/provider-standalone, api-compat). - sdk_relevant — the pure-TypeScript SDK unit job (runs against committed sdk/typescript/src/gen; the mecated-spawning SDK jobs stay on go || sdk). - site_relevant — the Docusaurus site build (user-docs). The flags reuse the macOS gating pattern: computed from the classifier as it exists on the base ref (a PR cannot edit it to skip a job it should run), and each family is gated via a job-level `if:` (never a workflow-level path filter, so the required checks still report on every push/PR). The required-check aggregators (test, lint) gain a go_relevant branch mirroring their docs_only branch, so a non-Go PR reports the legitimate skips as success instead of blocking. Net effect: a Go-only PR no longer runs the pure-TS SDK unit job or the Docusaurus build; a website- or sdk/typescript-only PR no longer runs the Go matrix. Adds relevant-changes.sh plus its classifier and workflow-wiring contract tests, registered alongside the macos-relevant-* pair in ci.yml and Taskfile.yml. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address PR review findings on the go/sdk/site path-relevance gating: - F1: the sdk/site categories used positive allowlists that treated CI-control files (.github/*, Taskfile.yml) as irrelevant, so a change to a job's own definition or the task recipe it runs would SKIP that very job. Add those files to the sdk and site relevant sets (fail-closed -> RUN), correct the header comment that overstated the allowlist's safety, and add classifier test coverage. - F2: the workflow-wiring test asserted the GO_RELEVANT early-exit with a whole-file grep, which matched BOTH the test and lint aggregators, so it did not actually pin the test aggregator's branch (a regression there would block non-Go PRs undetected). Scope each assertion to its own job body via a new job_block helper; verified load-bearing by deletion. - F3: add a drift guard pinning the count of go_relevant if: gates (15 = 11 go-family/race/draft + 4 go||sdk), so adding or removing a Go-gated job forces a conscious update to the test's job lists. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
jhrozek
reviewed
Sep 16, 2026
jhrozek
left a comment
Contributor
There was a problem hiding this comment.
Panel review follow-up on the go/sdk/site CI cost-gating change. Two findings remain open after the latest commit (80f1f6d), which already fixed the sdk/site classifier allowlist gap and the aggregator test scoping. Posting both as inline comments.
…tests Address PR #1644 review (jhrozek): - [Blocker] user-docs is a required check but was gated directly on site_relevant. A job skipped via if: reports as success for branch protection, so a site-category misclassification (or a future allowlist narrowing that misses a content source) could let the gate go green having never built the site or checked links. Add a `user-docs-gate` always() job mirroring lint/test: require user-docs skipped when site_relevant != true, else require success. Branch protection should require "User docs (gate)" instead of "User docs (Docusaurus build)". - [Important] the path-classifier self-tests ran inside test-race-root-a, itself gated on go_relevant, so a `go` misclassification would skip the very tests that catch it (the aggregators then report success on the gap). Move the docs-only / macos / relevant classifier tests into the always-run `changes` job, right after the flags are computed. Both fixes are pinned in relevant-changes-workflow_test.sh and verified load-bearing by mutate-and-restore. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Merged
2 tasks
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.
What & why
ci.ymlgated jobs on a single dimension —docs_only(plus the two macOSflags). Everything non-docs was one blob, leaving two classes of runner waste:
sdk) and theDocusaurus site build — neither of which a Go change can affect.
website/**- orsdk/typescript/**-only PR ran the entire Gomatrix. (
website/**isn't in thedocs_onlyallowlist, so a website-only PRran the full Go + SDK suite.)
This extends the
changesclassifier with three fail-closed relevance flags andgates each job family on the right one, reusing the exact security-hardened
pattern behind the existing macOS gating.
The flags (
.github/scripts/relevant-changes.sh <go|sdk|site>)Fail-closed → RUN on anything unproven; computed from the classifier as it
exists on the base ref, so a PR cannot edit it to skip a job it should run.
go— Go build/test matrix. Irrelevant only if every path is docs,website/, orsdk/typescript/. (Unlike the macOSgocategory,cmd/,examples/,perf/,e2e/,contracts/etc. are in the Linux test closureand stay relevant.)
sdk— the pure-TSsdkunit job (runs against committedsdk/typescript/src/gen); relevant tosdk/typescript/orcontracts/.site— the Docusaurususer-docsbuild; relevant towebsite/,user-docs/, orsdk/typescript/(the SDK reference pages it checks).Job → flag mapping
build,test-race×3 + draft,analysis,fuzz-smoke,engine-standalone,provider-standalone,api-compat,vuln) →go_relevant.sdk(pure-TS Node matrix) →sdk_relevantalone.sdk-integration/sdk-deno/sdk-browser/slack-bot-example(allbuild/spawn
mecated) →go_relevant || sdk_relevant.user-docs(Docusaurus) →site_relevant(nodocs_onlyguard — auser-docs/content change is docs-only yet must still rebuild the site).docs(matlatl — generates the config reference fromGo, must run on Go changes) and
domain-model(its correct gate isdocs/architecture/**, out of scope).Required-check safety
testandlintare the required checks; theyif: always()and assertupstream
.results keyed ondocs_only. Both gain ago_relevantbranchmirroring their
docs_onlybranch, so a non-Go PR reports the legitimate skips(race shards /
analysis) as success rather than blocking. Job-levelif:skips (not workflow-level
paths:) keep every required check reporting on everypush/PR.
Tests
relevant-changes_test.sh— classifier unit test (per-category relevant /irrelevant / mixed / malformed / empty / rename / shell-injection-safety).
relevant-changes-workflow_test.sh—ci.ymlwiring contract: fail-closeddefaults, trusted base-ref extraction ordered after commit validation, the
PR-checkout classifier is never executed, each job's
if:carries the rightflag, and both aggregators read
go_relevant.Registered next to the
macos-relevant-*pair inci.ymland in thetest:docs-only-classifierTaskfile target.Verification
task test:docs-only-classifier— new classifier + wiring tests green.race-aggregate-workflow_test.sh,docs-only-*,macos-relevant-*(proves the aggregator edits preserved everyasserted line).
task lint:actions(actionlint + template guards) clean.🤖 Generated with Claude Code