Repository navigation
build(ci): make the local and CI quality gates actually check what they claim - #1436
Conversation
Three manifest-parsing errors in LoadTestnet formatted the result of the failed strconv.Atoi rather than the input that failed it. Atoi returns 0 on error, so every malformed key in validator_updates, chain_lock_updates and consensus_version_updates was reported as height 0 — the same message for any typo, never naming the key the operator had to go and correct. Print heightStr, which is the map key that failed to parse. Every other parse error in the repository already quotes the offending string this way; these three were the exception. The chain-lock loop also carried the validator loop's wording, so a bad chain_lock_updates key sent the reader to the wrong manifest section. `go test` runs a subset of `go vet` before building, and its printf check rejects %q with an int argument, so test/e2e/pkg failed to build and `go test ./...` could not pass on a clean checkout. That is a consequence of the same defect: the argument was wrong, not the verb. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019gAC8rAzQagn5sgDxUJNjj
`make lint` ran golangci-lint unfiltered over the whole repository. That repository carries several hundred pre-existing findings, so the target could not exit 0 on a clean checkout of any branch and was unusable as a gate. CI meanwhile filters with --new-from-rev against the pull request's target branch and reports only findings on lines the branch changed, so the two disagreed about what "lint passes" means -- and the local one was the one contributors could not act on. `make lint` now runs what CI runs. The unfiltered view keeps its value for anyone reducing the backlog, so it stays as `make lint-all` rather than being deleted. The version pinned here was v2.8 while CI resolves v2.12, which is two minors of new rules apart; a local run could pass a gate CI then failed. Both now name the same floating minor, so a patch release moves them together. LINT_BASE selects the base ref and is overridable for other release lines. Its default is a fixed ref rather than the current branch's upstream: a gate whose scope changes per contributor is not a gate. Both git preconditions are checked before the linter starts, because a missing ref or a shallow clone otherwise surfaces as a puzzling lint result rather than as the git problem it is. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019gAC8rAzQagn5sgDxUJNjj
BASE_BRANCH was left behind when the protobuf generation targets that read it were removed. Nothing in the repository references it; the only mention is its own declaration. It is not inert. Being `?=`, an exported BASE_BRANCH from a contributor's environment silently takes effect, and its default names a branch six release lines old. A variable that looks like the base-ref setting for the lint target, but is not read by it, is a trap for whoever adjusts it next and finds the gate unchanged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019gAC8rAzQagn5sgDxUJNjj
ValidatorAddress.Hostname holds a bare IPv6 literal when the address was
given as one -- url.Hostname() strips the brackets, and types has a test
asserting tcp://[::1]:26656 parses to "::1". Joining that to a port with
fmt.Sprintf("%s:%d") produces "::1:26656", which is not a malformed
rendering of an address but a string that denotes nothing.
net.JoinHostPort brackets a v6 literal and leaves a v4 one untouched, so
the output is byte-identical for every address that works today. It is
also what this repository already does everywhere else, including
ValidatorAddress.String() ten lines from the field it reads and both
dial sites in internal/p2p; this call was the one place that disagreed
with its own type.
This does not make IPv6 work here. The dial network is "tcp4", so a v6
host is now refused on address family rather than failing on a nonsense
address -- a truthful error instead of a confusing one. Whether node-ID
resolution should support IPv6 validators, as the rest of p2p does, is a
question about connection establishment and is left alone deliberately.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019gAC8rAzQagn5sgDxUJNjj
The Test workflow derives its package list from `go list` filtered on .TestGoFiles, so a package without tests is never compiled there and the vet subset `go test` runs never sees it. Lint reports only findings on changed lines, so anything long-standing in such a package is filtered out there too. Three formatting errors in test/e2e/pkg survived six years in that gap, and a `go test ./...` on a clean checkout could not pass because of them. Add a Vet workflow running `go vet ./...` across the whole module, and a `make vet` target for it to call so the local and CI invocations cannot drift -- the divergence between `make lint` and the lint workflow is what hid the same class of defect on the other side. The job has no trigger filter. Each existing filter is defensible on its own and the defect fell through all of them together, so a gate whose purpose is catching what they miss does not get one; it costs about a minute of runner time, in parallel with the test shards, and is bounded by a compile the other workflows already perform. The Go version is pinned exactly rather than to a range. vet's diagnostics differ between toolchain releases, and a floating version would let this gate change what it enforces with no change to the repository. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019gAC8rAzQagn5sgDxUJNjj
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🕓 Queued for automated review — 28th in line, estimated start in ~8 h (commit 2b98d59)
|
There was a problem hiding this comment.
🟡 Changes recommended
make lint’s default LINT_BASE is inconsistent with the PR’s stated current base branch, so the local gate can diverge from CI’s --new-from-rev=origin/${{ github.base_ref }} behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR makes the repository’s “quality gates” (local Make targets and CI workflows) actually exercise the checks they claim to run, by aligning lint behavior with CI, adding a repo-wide go vet gate, and fixing a couple of concrete vet/diagnostic issues uncovered by the new coverage.
Changes:
- Fixes incorrect
fmt.Errorfarguments intest/e2e/pkg/testnet.goso errors report the malformed manifest key string (and clears ago test/vet failure). - Updates
make lintto match CI’s “new issues only” behavior via--new-from-rev, addslint-all, and adds amake vettarget. - Fixes TCP address formatting in node ID resolution to use
net.JoinHostPort, improving correctness for IPv6-literal addresses in diagnostics. - Adds a new
VetGitHub Actions workflow that runsmake vetacross all packages.
File summaries
| File | Description |
|---|---|
test/e2e/pkg/testnet.go |
Corrects error formatting to report the input key (heightStr) instead of the parsed height. |
Makefile |
Makes lint reflect CI’s new-issues gate, adds lint-all, and introduces vet. |
dash/quorum/nodeid_resolver.go |
Uses net.JoinHostPort to format host/port safely (esp. IPv6 literals). |
.github/workflows/vet.yml |
Adds CI gate to run go vet ./... repo-wide. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (queue backlog)
Both supplied findings are confirmed at head 32c34bf and prevent the local quality gates from meeting this PR's stated goal. Default lint fails on the obsolete base ref; vet and lint with a corrected base fail to locate BLS headers despite the native build being present. Repository-wide vet and lint against the pre-PR commit succeed when invoked through the Makefile's configured Go wrapper; no tracked files were changed.
Source: reviewer 1: gpt-6-astra (agent: phase2-reviewer, role: general); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
Review provenance
- Triage:
criticalbygpt-6-astra(effort low) — Although most changes are contained quality-gate tooling and diagnostics, the PR also changes address construction in the quorum node-ID resolver’s live connection path, touching networking and warranting the critical tier under the stated criteria. - Phase 1 reviewers: not run (skipped for throughput: 51 PRs queued, above the 10 limit)
- Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer
🔴 2 blocking
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `Makefile`:
- [BLOCKING] Makefile:287: Default the lint comparison to the current development branch
This PR targets v1.8-dev, and CI selects origin/${{ github.base_ref }}, but the new local default selects origin/v1.7-dev. In this checkout, which contains origin/v1.8-dev but not the old ref, make lint fails at the base-ref preflight. Where origin/v1.7-dev exists, it now identifies a different release lineage, so local lint evaluates a different diff from CI. Default to origin/v1.8-dev and retain LINT_BASE for explicit overrides.
- [BLOCKING] Makefile:317: Pass the configured CGO environment to the local quality gates
The Makefile defines the repository's BLS include and library paths in non-exported CGO variables, but this recipe invokes plain go rather than $(GO). With the native BLS build present, make vet fails with 'dashbls/bls.hpp file not found'. The plain go invocation in GOLANGCI_LINT at line 279 causes the same type-check failure after correcting LINT_BASE. CI supplies exported CGO flags and globally installed BLS, so its success does not establish that these local gates work. Invoke vet through $(GO), and change GOLANGCI_LINT to start with $(GO) run. Both repository-wide vet and filtered lint succeeded with that configuration. Although lint previously omitted these flags too, fixing that omission is required for this PR's explicit goal of making local lint reproduce the CI gate.
The problem
Three of this repository's quality gates report success without checking what they appear to check. They were found while investigating an unrelated PR, by running each gate and comparing its result against what it claimed.
make lintcannot exit 0. It runsgolangci-lintunfiltered across a repository carrying hundreds of pre-existing findings, so it exits 1 on a pristinev1.8-devcheckout — 180 issues at the version theMakefilepins today. Nobody can use it as a gate, and it also pins@v2.8while CI'slint.ymlrunsv2.12, so a clean local run was never evidence about CI in the first place.go test ./...cannot pass on the base branch. Threefmt.Errorfcalls intest/e2e/pkg/testnet.gofail thevetsubset thatgo testruns before building. The lines date from 2020 and nobody noticed, because:No package without test files is ever built by CI.
Makefile's shard list isgo list -f '{{ if (or .TestGoFiles .XTestGoFiles) }}...', sotest/e2e/pkg— which has no_test.go— is filtered out and never compiled. 74 packages are in that category.The three filters are individually defensible: a shard list should contain packages with tests;
--new-from-revshould hide pre-existing findings from a review gate;tests.ymlshould not rebuild on documentation changes. The defect fell through all three, and no layer was wrong.What changed
fix(e2e)— the threefmt.Errorfcalls reportheight, the result of astrconv.Atoithat just failed, so the message readsinvalid ... height "0"for any malformed input and never shows the offending manifest key. The fix is the argument, not the verb:heightStrwith%q, matching the six other sites in the repo that already do this. One message also named the wrong manifest section, sending a debugger tovalidator_updatesfor achain_lock_updatesfailure. Clearing the vet failure is a consequence of fixing the diagnostic, not the goal.build: make the lint target reproduce the CI gate—make lintnow filters against a base ref, as CI does, and exits 0 on a clean tree.make lint-allpreserves the unfiltered view under an honest name. The version is pinned tov2.12to match CI's floating-patch semantics, andLINT_BASEis overridable. Two preflight checks fail legibly before the linter runs when the base ref is missing or the clone is shallow, so nobody debugs a confusing lint result that is really a git problem.build: drop the unused BASE_BRANCH variable— declared, read by nothing since the protobuf targets that used it were removed, and defaulting tov0.8-dev. Because it is?=, an exported value would silently take effect. It looks like the base-ref knob for the lint target while being wired to nothing, so someone adjusting it to fix a gate would watch the gate not change.fix(dash)—nodeid_resolver.goformats a host/port pair withfmt.Sprintf("%s:%d").ValidatorAddress.String()usesnet.JoinHostPorton the same fields ten lines away,internal/p2puses it at every equivalent site, andvalidator_address_test.goexplicitly teststcp://[::1]:26656, so a bare IPv6 literal is a supported state that the current code renders as the meaningless::1:26656. Output is byte-identical for IPv4. This does not make IPv6 work — the call dials hardcoded"tcp4", which will still refuse the address; the improvement is a truthful error instead of a nonsense one. Whether node-ID resolution should support IPv6 is a connection-establishment question, deliberately left alone. It is fixed here becausego vet ./...reports it, and a new gate shipping with a known finding inside it is not a gate.ci: vet every package— a newvet.ymlworkflow runningmake vet(go vet ./...), covering all 176 packages including the 74 no workflow builds today.Design decisions worth stating, because each looks like an oversight otherwise:
go buildis deliberately absent. Measured against the restored defect:go build ./test/e2e/pkg/exits 0 — it sails past the exact bug this PR exists to close — whilego vetexits 1. Vet must typecheck to analyse, so it reports compile errors too. Build is strictly redundant, and including it would advertise coverage the gate does not have.go-versionpinned exact, not^. Vet's diagnostics vary by toolchain, so a floating version lets the gate change what it enforces with no change to this repository. An earlier revision of this description offered "a stricter newer vet started rejecting these lines" as the leading explanation for why 2020-era code began failing. That has since been measured and refuted: Go 1.26.5 flags all threetestnet.golines, so whatever changed predates the toolchain versions in play here. The pin stands on the general variance; the story it was originally justified with was wrong. The real cause is not established and is deliberately not chased — the gate's value does not depend on knowing it.libpcap-devis required, not copied.cmd/abcidumpimportsgopacket/pcapvia cgo, and it is one of the 74 packages CI does not build today.Verification
Every gate has a control proving it can fail, because a gate that only ever exits 0 has not been shown to be a gate.
make lintS1025→ non-zeromake vettestnet.godefect → non-zero, naming line 385make vetThe lint control was run twice: the first injection was a compile error, which proves nothing since anything catches those. The second used a compile-clean style finding.
go test -p 1 ./... -count=1reaches exit 0 on this branch — 176 packages, 0 failures. No commit onv1.8-devcurrently reaches that.go vet ./...exits clean repo-wide after the IPv6 fix, so the new gate ships without an exception baked in.gofmtclean.Caveats, stated rather than left for a reader to trip over: quoted lint timings are warm-cache and are not a contributor's first-run cost, which was not measured;
make lint-allreports 197 capped and 414 uncapped, which are different measurements; andinternal/consensusfails in CI at roughly 18% per run onv1.8-devindependently of this PR, so a single green suite run is not evidence that flake is absent.A note on branch names, because this PR predates a rename: every measurement above was taken on this PR's base branch, which was called
v1.7-devwhen the work was done and is nowv1.8-dev. The branch that carries the namev1.7-devtoday is a different lineage (the 1.7.0 release line) and none of these numbers describe it. The text has been updated to the current names so a reader checking the figures runs them against the branch they were measured on.🤖 Generated with Claude Code
https://claude.ai/code/session_019gAC8rAzQagn5sgDxUJNjj