Repository navigation
ci: run the corpus without the race detector, cache golangci-lint, scan the image only when it changed - #606
Conversation
df3e749 to
b5b314e
Compare
…an the image only when it changed The Test job carried 4.5 of a PR's 5 minutes, and one test was the reason: TestCorpus replays 210 captured repositories through the policy engine, 90 of the 91 seconds of test time in the control package, and -race multiplies OPA evaluation by about six. The corpus now runs in its own job without -race; the other 735 tests of the package keep the race detector. Lint restores golangci-lint's analysis cache between runs, and the container scan runs only when the Dockerfile or the module graph changed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ft8dmcMLK7V9XZh7JX4vzs
b5b314e to
d440062
Compare
…arden the scan gate TestCorpus is the only t.Parallel test in the control package, so it is what race-checks the OPA engine's shared caches: the Corpus job keeps -race and still runs in parallel with Test. golangci-lint runs through golangci-lint-action, pinned in actions.lock, in place of the hand-rolled binary cache. The image scan gate also watches .dockerignore and scans when the base commit cannot be fetched instead of failing the job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I reviewed this and pushed 3523984 on top of it. Changes: Corpus keeps Lint goes through
The action downloads a checksummed release binary and handles the analysis cache itself. Container scan gate:
Not changed, needs follow-up:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Follow-up a261db8: adds |
What type of PR is this?
ci
What this PR does / why we need it:
A pull request waits 5 minutes for CI, and 4.5 of them are the
Testjob. Measured on the last 39 PR runs:Testmedian 4.5 min, every other job under 2.5 min. InsideTest, one test is the whole cost:TestCorpusreplays the 210 captured repositories through the policy engine and accounts for 90 of the 91 seconds of test time in the control package, and-racemultiplies OPA evaluation by about six.-race-race-race, corpus skipped-race, corpus skippedThree changes, all in
ci.yml:go test ./... -race -skip '^TestCorpus$'. A new Corpus job runsgo test ./control -run '^TestCorpus$'without the race detector. The corpus is a deterministic replay; every other test of the package, the fiveTestCorpus*siblings included, keeps running under-race, which is where the engine's concurrency is exercised.~/.cache/golangci-lintwithactions/cache, and skips thego installon a hit: building the linter from source was most of the two minutes this step cost, the analysis cache makes the rest incremental.Dockerfile,go.mod,go.sumor the workflow changed against the base branch, through a plaingit diff. Every push to main still scans.Expected PR wall-clock: about 2 min instead of 5, bounded by the review jobs.
Which issue(s) this PR is related to:
None.
Special notes for your reviewer:
-skipand-runare regular expressions, hence the anchors: onlyTestCorpusitself moves.actions/cacheis under a trusted owner. The self-scan of this branch with the current CLI gives score A, no finding.Does this PR introduce a user-facing change?
How was this tested?
The CI runs of this PR, measured on the run page:
ci.ymlchanged; skipped in about 10 s on a PR that touches neither the Dockerfile nor the module graphThe first push failed at workflow start: the org's lockfile policy refuses a workflow whose action is not in
actions.lock, so the lockfile is regenerated withgh actions-lockin the same commit.AI usage disclosure:
YES. Claude Code measured the runs, profiled the suite and wrote the workflow change under the author's direction.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ft8dmcMLK7V9XZh7JX4vzs