Repository navigation
ci: skip the mutants gate and Go on Windows for pull requests into next - #2018
Conversation
The work towards the stable Stack Encrypt Rust release lands in next, through many pull requests. The mutants gate and the Go tests on Windows are the slowest jobs those pull requests run. The mutants gate now skips every pull request. A manual dispatch still tests each crate whole. The Go tests on Windows now run only on a pull request into main, a push, and a manual dispatch. #2017 turns both back on before the release.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
coderdan
left a comment
There was a problem hiding this comment.
Review of this pull request: four findings. One is important: the restored condition would let lines merged in this period reach main untested. The other three are minor.
| # Every line of the release diff arrived through a pull request into | ||
| # next, and this gate already mutated it there. The release diff gives | ||
| # thousands of mutants and cannot finish inside the timeout. | ||
| if: github.event_name != 'pull_request' |
There was a problem hiding this comment.
Minor. Other text still describes the old behaviour. AGENTS.md ("Mutation testing") says the gate runs on every pull request that touches the opted-in crates. This workflow's header says it gates pull requests. The header of tests-golang.yml and the CI bullet in AGENTS.md say the Go tests run on macOS and Windows. A reader could believe a change was mutation tested when it was not.
There was a problem hiding this comment.
minor Four more places still describe the per-PR gate as running: mutants.yml:31-32 ("No branch filter: a stacked PR ... must run this gate too"), mutants.yml:78-80 ("One job on a pull request ..."), .cargo/mutants.toml:10 ("CI runs this --in-diff as a per-PR gate"), and the mutants:stack-auth / mutants:stack-encrypt exemption reasons in scripts/__tests__/crates-ci.test.mjs:245,249 ("CI runs ... --in-diff in mutants.yml"). Add a "for now, #2017" qualifier to each, and add them to #2017's step 5 list.
Source: mattpocock-skills:code-review (standards and spec axes) · model unknown; review-cross-check verifier · model unknown
Generated by Claude Code
There was a problem hiding this comment.
Fixed in 0241579. All four places now say the gate runs only on a pull request into main for now, and name #2017: mutants.yml lines 31-32 and 78-80, .cargo/mutants.toml, and the mutants:stack-auth exemption in crates-ci.test.mjs. The mutants:stack-encrypt exemption refers to that one. #2017's last step now lists them.
The restored condition skips the release pull request, because every line of it was mutated on its way into next. That is untrue for pull requests that merge while the gate is off. The comment now says to sweep next by hand and fix the survivors before the release pull request. The workflow headers and AGENTS.md now say that the gate and the Windows job are off for these pull requests, and point at #2017.
cipherstash-agent
left a comment
There was a problem hiding this comment.
Review attestation
Reviewed 1a02a4d · posted from Claude Code · claude-opus-5-5 · effort medium
Sources: code-review · claude-opus-5-5; mattpocock-skills:code-review (standards and spec axes) · model unknown; review-cross-check verifier · model unknown
Skills: code-review, company-skills:rust-security, mattpocock-skills:code-review, company-skills:review-cross-check
Findings (4): 4 minor — 3 inline, 1 in reply.
generalcompany-skills:rust-securitywas loaded; the PR changes no Rust, so none of its rules applied.
Generated by Claude Code
| # before the release pull request, dispatch this workflow on next to | ||
| # sweep each crate whole, and fix every mutant that survives. #2017 | ||
| # lists that step. | ||
| if: github.event_name != 'pull_request' |
There was a problem hiding this comment.
minor if: github.event_name != 'pull_request' skips the gate on pull requests into main too, not only into next as the title and #2017 say. A hotfix into main that changes packages/stack-encrypt/src/** merges unmutated, and the catch-up sweep on next misses it unless main is merged back. Keep main covered except the release PR: if: github.event_name != 'pull_request' || (github.base_ref == 'main' && github.head_ref != 'next').
Source: code-review · claude-opus-5-5; mattpocock-skills:code-review (spec axis) · model unknown
Generated by Claude Code
There was a problem hiding this comment.
Fixed in 0241579. The condition is now github.event_name != 'pull_request' || (github.base_ref == 'main' && github.head_ref != 'next'). So a pull request into main runs the gate again, and the release pull request stays skipped. The comments, .cargo/mutants.toml and AGENTS.md say the same.
| @@ -76,11 +79,22 @@ jobs: | |||
| # job per crate on a manual dispatch, which sweeps each crate whole. | |||
| # The pull request's check keeps the name "Mutants gate". | |||
| name: ${{ matrix.crate == 'all' && 'Mutants gate' || format('Mutants sweep ({0})', matrix.crate) }} | |||
There was a problem hiding this comment.
minor The job-level if: is evaluated before the matrix expands, so every PR touching these paths now shows a skipped check named with the raw expression (matrix.crate == 'all' && 'Mutants gate' || ...), not "Mutants gate". No ruleset requires the check, so this is cosmetic; the comment above saying the PR check keeps the name "Mutants gate" is now false. Accept it, or drop pull_request from on: until #2017.
Source: code-review · claude-opus-5-5
Generated by Claude Code
There was a problem hiding this comment.
Fixed in 0241579. The job name now reads github.event_name, not matrix.crate. The two give the same name, because the matrix is ["all"] exactly when the event is a pull request. But the event is known when the job is skipped, so the skipped check is named "Mutants gate". This change can stay after #2017.
…ipped check The gate was skipped on every pull request, so a fix merged straight into main would never be mutation tested. It now runs on a pull request into main again, except the release pull request. A job its if: skips never expands its matrix, so the skipped check showed the name expression's text. The name now reads the event instead. The notes that the gate and the Windows job are off for now also go in .cargo/mutants.toml and the task exemptions in crates-ci.test.mjs. They say that a pull request moved onto main needs a new push before Windows runs.
Brings next up to date with main so the release pull request (#1229) merges cleanly. Six files conflicted: - .cargo/mutants.toml: kept next's line-free pattern for detect_inner. Took main's line numbers (273, 281) for the TokenStoreFn exclusion, because the merged token_store.rs is main's copy. - crap-crates.yml, mutants.yml, release-golang.yml, tests.yml: kept next's jobs and conditions, including the temporary mutants gate condition from #2018, and main's RunsOn runners. The e2e job keeps main's 30-minute limit for the migration harness. - test-eql.yml: next moved the PostgreSQL service from rust-crates to the new rust-encryption-postgres job. The service stays there, with main's Docker Hub login added to it. Main moved every Blacksmith job to RunsOn (ADR 0004), and its tests refuse a Blacksmith label. So each job that next added on a Blacksmith label now uses the RunsOn label of the same size. These jobs are in crap-crates, fuzz, kani, mutants, release-golang, supply-chain-vitaminc-aead, test-eql, tests, tests-golang, and tests-recipher-js. The CRAP jobs ran on a 16 vCPU Ubuntu 24.04 machine on next, because the prebuilt cargo-crap binary needs its glibc. ADR 0004 named no such RunsOn label. This merge adds it to the ADR's table and to scripts/__tests__/lib/runs-on.mjs, and updates the CRAP test in crates-ci.test.mjs to read the RunsOn image. The Go eql-postgres job's PostgreSQL service now logs in to Docker Hub, as main's tests require of every RunsOn job that pulls an image. Main added form_urlencoded to stack-auth. The EQL and recipher-js Cargo.lock files now list it.
Summary
Pull requests into
nextno longer run the two slowest CI jobs: the mutants gate, and the Go tests on Windows. This saves runner time while the work towards the stable Stack Encrypt Rust release lands innext. #2017 turns both back on before that release.Changes
.github/workflows/mutants.yml) runs only on a pull request intomain, and still not on the release pull request (nextintomain).go-binding-crossin.github/workflows/tests-golang.yml) run only for these events:main;Postgres is already the latest version only
No change was needed for Postgres. On a pull request, the workflow for EQL, the SQL library that stores encrypted values (
test-eql.yml), already tests PostgreSQL 17 only. That workflow tests PostgreSQL 14 to 17 only on a push tomainand on its daily scheduled run. The Go SDK's PostgreSQL tests use PostgreSQL 17 only.The JavaScript suite in
tests.ymlruns PostgreSQL 16 with Node 22, and PostgreSQL 17 with Node 24. Moving the first pair to PostgreSQL 17 would save no runner time, because the suite would still run twice.scripts/__tests__/cli-live-postgres-ci.test.mjsalso requires the PostgreSQL 16 run on purpose. So this pull request leaves that suite as it is.Verification
pnpm run test:scripts: 99 files, 1652 tests passed. These tests read the workflow files.e2e/: 31 passed.actionlint1.7.12 on both changed workflows: no findings.Related