gate: fail on every gopls diagnostic #624
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#631 Apply the gopls quick fixes on main
sixfold-space/madtea
Reference
sixfold-space/madtea#624
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The gate passed while gopls reported 34 findings across the module. The gate runs staticcheck and modernize, but not gopls, whose analyzers (for example
unusedparams, the staticcheck quick fixes, and deprecation notices) report what the editor shows. The gate should fail on every one of those warnings.29 of the 34 have gopls quick fixes. #631 applies them, and it merges before this issue. The rest are below.
How
A new heavy-block leg in
scripts/gate.shrunsgopls check -severity=hintover every git-visible Go file and fails on any output.gopls checkexits 0 even with findings, so the leg must test the output, not the exit code. It must check the whole module at once: a run over part of it missed findings. The leg needsgoplsinstalled inci.ymltoo, pinned to thesetup-dev.shversion.Findings still open
internal/gitexec/env_test.go:29: "do not pass a nil Context". The test passes a nil context on purpose, to covergitexec.NewCmd's nil tolerance. If no production caller still passes nil, the nil tolerance and that test case both go.internal/mcp/repoguard.go:157:session.ListRootsandmcp.ListRootsParamsare deprecated (SEP-2577). #428 keeps the roots call on purpose until a client supports SEP-2322. The line already carries//lint:ignore SA1019with that reason, which is why staticcheck passes, but gopls does not read that directive. A gate that fails on every gopls warning conflicts with #428.What the roots call feeds today: only
guardLocalGitTarget(internal/mcp/multirepo.go), which guards the local-git tools (add, commit, push, pull, branch create and delete, finish) when a call passes nodir=. The per-call wrong-repo guard inconsolidated_tool.gopasses a nil session and never uses roots.Options:
dir=or setMADTEA_CALLER_REPOfor local-git calls, because the guard can no longer confirm the target. A mismatch between the client's root and the server's repo is no longer caught until SEP-2322.Acceptance
scripts/gate.shhas a gopls leg that fails on any gopls output over the whole module, andci.ymlinstalls the pinned gopls.The roots question is already decided in the record. The ADR 0019 amendment of 2026-09-08 (runtime working directory) says a root the operator adds at runtime is in scope, and that this "relies on the MCP
rootscapability, deprecated (SEP-2577) but functional into 2027; migration to its successor (SEP-2322) is tracked in issue 428."So roots stay until that migration, and the call at
internal/mcp/repoguard.go:157is intentional. Its//lint:ignore SA1019directive records the reason. The gopls leg honors a finding only when the line above carries such a directive, and fails on everything else.The nil-context finding goes the other way: no production caller passes a nil context (staticcheck SA1012 in the gate rejects a literal nil, and both finish entry points set an unset context before use). So
gitexec.NewCmd's nil guard and the test that passed nil are removed, together with their directive.hexajon referenced this issue2026-10-03 18:04:41 +00:00