Skip to content

ci: run benchstat as a tool of the bench module - #136

Merged
tannevaled merged 2 commits into
mainfrom
ci/benchstat-as-tool
Nov 29, 2026
Merged

tannevaled merged 2 commits into
mainfrom
ci/benchstat-as-tool

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Why

wfaudit v0.196.0 has a new rule, go-run-version, and it flags the A/B workflow's go run golang.org/x/perf/cmd/benchstat@latest. A versioned go run loads the deprecation status of the module's newest release from sum.golang.org. That is the same failure that broke the coverage step before #135. @latest also meant the tool changed with every x/perf commit.

What

  • bench/go.mod gains tool golang.org/x/perf/cmd/benchstat, pinned by go.sum (x/perf at 4febdb082b2c). Tidying the module also moved the bench module's x/sys to v0.50.0; the library's go.mod is untouched.
  • .github/workflows/bench.yml: the Compare step runs (cd bench && go tool benchstat "$RUNNER_TEMP/base.txt" "$RUNNER_TEMP/head.txt"). The job already checks out the repository.
  • .github/workflows/ci.yml: the comment added in ci: run covblocks as a tool of the bench module #135 is reworded. wfaudit read the literal example in it as a command; that false positive has been reported to the owner of fleettools.

Checked locally

  • go tool benchstat -h from bench runs the pinned binary.
  • go build ./... and go vet ./... in bench pass, and actionlint passes on bench.yml.
  • wfaudit --fail . reports 0 HIGH, 0 MEDIUM, 0 INFO.

The A/B workflow runs only on workflow_dispatch, so this PR's CI does not exercise the Compare step; its first dispatch will.

Refs #135

🤖 Generated with Claude Code

tannevaled and others added 2 commits November 29, 2026 14:21
wfaudit v0.196.0 (go-run-version) flags the A/B workflow's
`go run golang.org/x/perf/cmd/benchstat@latest`: a versioned go run
loads the deprecation status of the module's newest release from
sum.golang.org, the failure #135 removed from the coverage step. It
also floated with every x/perf commit. Declare benchstat with a `tool`
directive in bench/go.mod, pinned by go.sum, and run it with `go tool`
from bench.

The ci.yml comment from #135 is reworded: wfaudit read its literal
example as a command (reported to the fleettools owner).
`wfaudit --fail .` now reports 0 MEDIUM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first dispatch of the A/B workflow (run 46267040621) failed in
Compare: "go: go.mod requires go >= 1.27.3 (running go 1.27.2;
GOTOOLCHAIN=local)". setup-go read the root go.mod (1.27.2), while
benchstat now runs as a tool of the bench module, whose go line is
1.27.3. Read the version from bench/go.mod; it also builds the root
module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 276c72d into main Nov 29, 2026
15 checks passed
@tannevaled
tannevaled deleted the ci/benchstat-as-tool branch November 29, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant