Repository navigation
ci: make the go.mod/go.sum and benchmark checks able to fail - #921
Merged
general-kroll-4-life merged 1 commit intoNov 15, 2026
Merged
Conversation
The go.sum coherence check copied go.sum and diffed it against the copy, so it always passed. It now runs `go mod tidy -diff`, which fails and prints the diff when go.mod or go.sum isn't tidy, without changing either. The Benchmark steps in linuxbuild and linuxarmbuild piped `go test -bench` into tee and then checked $?. Actions runs `run:` as `bash -e` without pipefail, so $? was tee's and a failing benchmark passed the step. Both now set pipefail and test the pipeline directly. Refs stackql#920 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the CI changes intended to catch dependency inconsistencies and benchmark failures.
No open issues 🎉
What changed in this PR
This PR addresses two ineffective CI checks from #920, allowing dependency inconsistencies and benchmark failures to fail the build.
Changes:
- Replaces the self-comparison of
go.sumwithgo mod tidy -diff, checking both module files without modifying them. - Enables
pipefailand directly checks benchmark pipelines in both Linux jobs soteeno longer hides failures.
| File | Description |
|---|---|
.github/workflows/build.yml |
Makes module tidiness and Linux amd64/arm64 benchmark checks enforce failures. |
Review effort: Balanced
Contributor
|
@tomersein thank you for your contribution! |
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.
Description
Two checks in
.github/workflows/build.ymlcould never fail, as described in #920.linuxbuild). The old step copiedgo.sumtogo.sum.bkpand diffed it against that copy, so it always passed. It now runsgo mod tidy -diff(Go 1.23+). The command fails and prints the diff whengo.modorgo.sumisn't tidy, without modifying either file.linuxbuildandlinuxarmbuild).go test -bench ... | tee ${outFile}was followed byif [ "$?" = "0" ]. Actions runsrun:blocks asbash -e {0}withoutpipefail, so$?wastee's exit status and a failing benchmark (b.Fatalf) passed the step. Both steps nowset -o pipefailand test the pipeline in theifdirectly. The rest of each step, including the benchstat threshold comparison, is unchanged.Type of change
Issues referenced.
Evidence
The new tidy check passes on the current tree.
go mod tidy -diffonmain(5c8c614) with Go 1.27.3 exits 0 with an empty diff, so this PR doesn't fail on today'sgo.mod/go.sum.The new checks catch what the old ones missed. Each step's old and new script was run under
bash -e, as Actions runs it, against a throwaway Go module:go.modrequires a module nothing imports,go.sumemptygo.mod/go.sumdiffb.Fatalf--- FAIL: BenchmarkThingThe benchmark step is identical in both jobs, so the same change covers amd64 and arm64.
pipefailalso makes a failingbenchstat ... | teefail the step, which seems right, since the threshold comparison can't run without it. Thecomparisons=$(... | grep ...)pipeline already ended ingrep, so its behaviour doesn't change.Checklist: