fix(monit-query): diagnose never accepted mysql — drop it from flag and card - #157
Merged
Conversation
…nd card `diagnose` pairs one operation with one set of datasource types: `log_patterns` takes `loki` or `victorialogs`, `metric_trends` takes `prometheus`. There is no third operation, so no other `--ds-type` value can succeed; the server answers with an invalid-parameter error for every other combination. `--ds-type` advertised `mysql` in three places — the flag usage string, the shell-completion enum, and the card's gotcha list. `registerEnumFlag` only feeds completion, so `mysql` was never rejected locally: it travelled to the server and failed there every time. Following either the card or the completion suggestion produced a guaranteed error. Correct all three, and state the operation/type pairing instead of a flat list so the relationship the server actually enforces is visible at the call site.
golangci-lint is a prebuilt binary and can only parse source up to the Go release it was built with. `go-version: stable` hands it whatever Go shipped most recently, so Go 1.27.0 going stable made v2.11 (built with go1.26) panic on load — "file requires newer Go version go1.27" — turning lint red on every open PR without a single repo change. ci.yml already resolves Go from go.mod. Do the same here so the linter's toolchain moves when the module moves, and an upstream release cannot break the gate on its own.
This was referenced Aug 20, 2026
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.
What was wrong
monit-query diagnoseadvertisedmysqlas a valid--ds-typein three places:internal/cli/monit_query.goflag usageDatasource type: prometheus|victorialogs|loki|mysql (required)internal/cli/monit_query.goregisterEnumFlag"prometheus", "victorialogs", "loki", "mysql"skills/flashduty/reference/monit-query.mdgotchasprometheus,victorialogs,loki,mysql"None of it is true.
diagnosehas exactly two operations and each is bound to a datasource-type set:log_patterns→loki,victorialogsmetric_trends→prometheusWith no third operation,
--ds-type mysqlcannot succeed under any pairing — the server returns an invalid-parameter error every time.registerEnumFlagonly supplies shell completion; it does not validate. Somysqlwas never caught locally: it was suggested by tab-completion, documented in the card, sent to the server, and rejected there. A user or agent following either source hit a guaranteed failure.Change
All three corrected. The card now states the pairing rather than a flat list, so the operation↔type relationship the server enforces is visible where the call is written, and the "why" survives the next edit:
Verification
go build ./...cleango run ./internal/cmd/skilldoc check→skilldoc: cards OK(the flag usage string is not part of this group's generated fence, so no regeneration was needed)go test ./...→ 9 packages ok, 0 failuresNo test pinned the enum before this change, and none is added: the authoritative contract lives server-side, so a local list assertion would only restate the constant it guards.
Second commit: unblocking CI
The first push came back with
lintred — not on this change, but a panic inside golangci-lint's package loader:lint.ymlasked forgo-version: stable, and setup-go loggedstable version resolved as 1.27.0. golangci-lint ships as a prebuilt binary that can only parse source up to the Go it was built with, so the moment Go 1.27.0 became stable, v2.11 started panicking. That makes lint red on every open PR with nothing in the repo having changed.ci.ymlalready resolves Go viago-version-file: "go.mod".lint.ymlnow does the same, so the linter's toolchain moves when the module moves and an upstream Go release cannot break the gate on its own.It rides along here rather than in its own PR because this PR could not be shown green without it. Reviewable independently: it is one commit touching one file.
CI after the fix: 12/12 green.