fix(ci): restore green CI -- bump Go to 1.26.6 and fix the stale e2e expectations - #25
Merged
Merged
Conversation
CI has been red on main since 52184d5 (#23). That commit changed new-device trust_weight from 1.00 to trust.TrustBase (0.50) but left TestEndToEnd_FullLifecycle asserting the old arithmetic: three fresh scam reports scored 3.0, not 6.0, so numberA came back "label" and the "want block" assertion failed. Its own message said "3 fresh scam x trust 1.0 = 6.0", naming a constant that no longer existed. Flipping the expectation to "label" would have gone green, but it would have deleted the coverage: numberA reaching "blocked" is the only end-to-end exercise of the scoring block path, since numberC reaches "block" through an admin override that bypasses scoring entirely. So give numberA enough reporters to block for real instead. - Six devices, not three. At TrustBase one scam report contributes BaseWeight(1.0) * 0.5 * scam(2.0) = 1.0, so six score 6.0 against a threshold of 5.0. Five would hit the threshold EXACTLY, which is not safe: reports age a fraction of a second before recompute reads them, so decay is a hair under 1.0 and 5.0 lands just below the >= test. - numberB moves from two reporters to three for the same reason. Two scored exactly SuspectThreshold and were one second from flaking. - The token-distinctness check becomes a set membership test rather than hand-enumerated pairs, which does not scale past three. - A guard up front fails loudly, naming the constant that moved, if TrustBase, BaseWeight, BlockThreshold or SuspectThreshold change again. #23 produced a bare "want block" that pointed at neither the cause nor the constant; this is what would have caught it. Worth stating plainly, because the stale assertion was hiding it: a number now needs FIVE fresh-device scam reports to auto-block, up from three. That is a consequence of #23, not of this commit. Verified: go test ./... -race -cover is green, twice, which is the exact command CI runs. gofmt and go vet clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PBmEXErCWYt3WZCZKaS7m9
CI's govulncheck step fails on five Go standard library vulnerabilities present in 1.26.5 and fixed in 1.26.6: GO-2026-6089, GO-2026-5972, GO-2026-5026 and two others reached through net/http, encoding/asn1 and crypto/tls from cmd/server, internal/push, internal/attest and internal/api. This is what has actually been failing CI, and it matters more than a red badge: govulncheck runs BEFORE "go test (race + cover)", and its failure SKIPS the test step entirely. Every run since these advisories landed reported a failure without ever executing a single Go test. That is how the stale e2e expectation in 52184d5 (#23) reached main claiming "CI covers those" -- CI had stopped running the tests it was said to cover. Worth considering separately: a security scanner that silently disables the test suite when it trips is the wrong ordering. Running go test before govulncheck, or continue-on-error on the scan, would keep test results visible while a stdlib advisory is outstanding. go.mod pins the version and CI reads it via go-version-file, so this one line moves both. Verified under 1.26.6: govulncheck reports no vulnerabilities, gofmt and go vet are clean, and go test ./... -race -cover passes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PBmEXErCWYt3WZCZKaS7m9
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.
Two commits, both required to get
maingreen. Neither is sufficient alone.What was actually failing, and a correction
I initially attributed main's red CI to the stale e2e test. That was wrong, and the real cause matters more.
CI fails at
govulncheck, on five Go standard library vulnerabilities in 1.26.5 (fixed in 1.26.6), reached throughnet/http,encoding/asn1andcrypto/tls.The consequence is the important part. Step order in the workflow is:
govulncheckruns before the tests, and its failure skips them entirely. Every CI run since those advisories landed has reported a failure without executing a single Go test.That is how the stale expectation in
52184d5(#23) reachedmain. Its description says "The DB-backed tests were not run locally (no MySQL); CI covers those." CI had already stopped running the tests it was said to cover. The test breakage was real and is reproducible locally -- it just was never what CI was reporting.1.
build:bump the Go toolchain to 1.26.6go.modpins the version and CI reads it viago-version-file, so one line moves both. Verified locally under 1.26.6:govulncheckreports no vulnerabilities.Worth fixing separately: a security scanner that silently disables the test suite when it trips is the wrong ordering. Running
go testbeforegovulncheck, orcontinue-on-erroron the scan, keeps test results visible while a stdlib advisory is outstanding. I have not changed the workflow here.2.
fix(api):restore the e2e block path#23 changed new-device
trust_weightfrom 1.00 totrust.TrustBase(0.50) but leftTestEndToEnd_FullLifecycleasserting the old arithmetic:The assertion message even said
3 fresh scam x trust 1.0 = 6.0, naming a constant that no longer existed.Why not simply expect "label"
That would go green and delete the coverage.
numberAreachingblockedis the only end-to-end exercise of the scoring block path --numberCreachesblockthrough an admin override, which bypasses scoring entirely. So this givesnumberAenough reporters to block for real.TrustBaseone scam report contributes1.0 x 0.5 x 2.0 = 1.0, so six score 6.0 against a threshold of 5.0.>=test.numberBgoes from two reporters to three for the same reason. Two scored exactlySuspectThreshold-- a latent flake sitting onmaintoday, one second of timing from failing.TrustBase,BaseWeight,BlockThresholdorSuspectThresholdchange again.The behaviour change #23 was hiding
A number now needs five fresh-device scam reports to auto-block, up from three. That is a consequence of #23, not of this PR, but it was invisible while both the assertion was stale and CI was skipping tests. If five is not the intended product behaviour, the fix belongs in the scoring constants rather than in this test.
Verification
Under Go 1.26.6, the full CI gate locally:
govulncheckclean,gofmtclean,go vetclean,go test ./... -race -covergreen.Unrelated and untouched:
SpamFilterUITests.testLookupFlowalso fails on a pristinemain.