fix(build): honest quality gates — propagate exit codes, fix hidden lint/race findings#1723
Open
krisarmstrong wants to merge 8 commits into
Open
fix(build): honest quality gates — propagate exit codes, fix hidden lint/race findings#1723krisarmstrong wants to merge 8 commits into
krisarmstrong wants to merge 8 commits into
Conversation
added 8 commits
July 5, 2026 21:44
The -quiet wrappers in mk/lint.mk, mk/test.mk, and mk/security.mk piped tool output through head/grep/tail with a trailing '|| true' (or '|| printf'), so the recipe's exit status came from the filter, never from the tool. make lint / make test / make security reported green regardless of lint errors, test failures, or audit findings. Each wrapper now captures the tool's output and real exit status (OUT=$(cmd); STATUS=$?), prints the same quiet/pretty summary, dumps the tail of the full output on failure for diagnosis, and exits with the tool's status. Verified by injecting a Go compile/lint error: make lint-backend-quiet now exits 2 instead of 0. Also fixed: fix-backend-quiet, fix-frontend-quiet, lint-frontend-quiet, test-frontend-quiet, security-secrets-quiet (same masking pattern).
NewServer exceeded the funlen statement limit. Extract three cohesive helpers following the existing initXxx convention in this file: - initAuthSecurity: auth/CSRF/setup-token/recovery/WebAuthn managers + login/endpoint rate limiters - initTelemetryAndWiFiServices: DNS/gateway/VLAN/speedtest/iperf/cable/ public-IP testers + Wi-Fi manager/scanner (no cross-dependencies) - initSettingsUseCases: ADR-0020 settings/profiles/network-IP/alert-rule use-case wiring NewServer now reads as a composition sequence of named subsystems.
…bloat 11>10) catalog.Store had 11 methods spanning two distinct persistence seams: profile records (backed by the database Profiles repository) and the active-profile pointer (backed by the Settings repository). Split along that real adapter seam into ProfileRepository (9 methods) and ActiveProfileStore (2 methods). NewService now takes both ports; internal/app.profilesStore satisfies both and is passed twice at the composition root. All callers (app adapter + catalog tests) migrated in this change — no compat alias (pre-alpha, no legacy burden).
latencyEvent's probeID parameter always received "p1", so unparam flagged it. TestObservePersistsThroughCoordinator now uses a distinct non-trivial probe ID, which also proves the record-ID templating is not accidentally hardcoded to the shared fixture value.
…e callback test TestStartContinuousCallback raced under full-suite -race contention: StopContinuous only signaled the background goroutine via close(stopCh) and returned immediately, so the goroutine could still be mid-callback (writing callCount/lastStats) while the test read them — a genuine data race in the API's stop semantics, not just the test. Fix the code: Tester now tracks the StartContinuous goroutine with a sync.WaitGroup and StopContinuous blocks (outside t.mu, to avoid deadlocking the goroutine's own Test() locking) until it has fully returned. Post-Stop reads are then ordered by the WaitGroup. Fix the test: guard callback state with a mutex, poll for the first callback with a generous 5s deadline instead of a fixed 200ms sleep, and assert the callback actually fired instead of logging and passing. Verified: go test -race -run TestStartContinuousCallback -count=30 and 3x full-package -race runs all pass.
mk/vars.mk describes itself as the single source of truth for version, platform, and color variables, but nothing included it — the root Makefile duplicated the VERSION/COMMIT/BUILD_TIME, platform/arch detection, ANSI color, and VERSION_PKG blocks inline. Include mk/vars.mk first and delete the duplicated blocks. Move PLATFORM_PRETTY (used by 'make version') into vars.mk so platform detection lives in one place. Also fix the stale header comment: Go 1.25.5+ -> 1.26.4+ (Node line was already 26.3.0). Verified: make version and make build still work.
…3.0 pins CI-calls-make where behavior-equivalent: - govulncheck step -> make security-backend-quiet (same 'govulncheck ./...' invocation, now with honest exit propagation) - npm audit step -> make security-frontend-quiet after npm ci (same 'npm audit --audit-level=high') Not converted (documented): the backend test step keeps its explicit package list + SKIP_* envs and feeds coverage.out to the threshold check; the deterministic/CGO-free build checks intentionally compile './...' without ldflags; the release-shaped builds already inject the Makefile-equivalent ldflags inline; golangci-lint stays on its action for caching/annotations. Version pins brought to the fleet standard: golangci-lint v2.12.1 -> v2.12.2 (ci.yml), Node 26.2.0 -> 26.3.0 (setup-node composite default, dead-code.yml, license-check.yml, ci.yml header comment).
The weekly TODO summary issue was created with labels 'todo' and
'needs-triage'; neither existed in .github/labels.yml or the repo
('status: needs-triage' is the taxonomy name), so gh issue create
would fail. Use 'status: needs-triage' and add a 'todo' label
definition to labels.yml.
📋 License Compliance Report✅ All dependencies pass license compliance checksGo Dependencies
npm DependenciesSee full report in workflow artifacts Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0 |
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.
Summary
Make the quality gates honest and fix what they were hiding. All nine
-quietwrappers in mk/lint.mk / mk/test.mk / mk/security.mk captured output through| grep ... || true, somake lint,make test, andmake securityexited 0 regardless of real failures. This PR propagates real exit codes (keeping the quiet summaries), then fixes the findings that were hiding behind the green: 3 golangci findings fixed structurally (NewServer decomposed into initXxx helpers; catalog.Store segregated into ProfileRepository + ActiveProfileStore along the real adapter seam, all callers migrated, no compat alias; unparam probe ID varied), and the flaky TestStartContinuousCallback root-caused to a real race — StopContinuous returned while the goroutine could still be mid-callback — fixed with a sync.WaitGroup (waited outside the mutex to avoid deadlock). Also: mk/vars.mk is now actually included (duplicated root-Makefile blocks deleted), CI govulncheck/npm-audit steps delegate to the make targets, golangci v2.12.1→v2.12.2, Node 26.2.0→26.3.0 (setup-node composite + license-check.yml + dead-code.yml), and the missingtodolabel added to labels.yml (todo-tracker.yml has failed every weekly run since 2026-06-22). CI build steps intentionally stay raw: CI owns multi-arch builds; make is local-only.Linked Issue
Fixes #1724
Type of Change
Risk
Testing Evidence
Security and Release Checklist