Skip to content

ci: stop the Go lint step verifying its config over the network - #7022

Merged
otavio merged 1 commit into
masterfrom
ci/drop-golangci-config-verify
Sep 2, 2026
Merged

ci: stop the Go lint step verifying its config over the network#7022
otavio merged 1 commit into
masterfrom
ci/drop-golangci-config-verify

Conversation

@otavio

@otavio otavio commented Sep 2, 2026

Copy link
Copy Markdown
Member

golangci-lint-action defaults to verify: true, which runs golangci-lint config verify before
linting. That command fetches its JSON schema from golangci-lint.run and has no offline mode —
there is no --schema flag, and a $schema key in the config is rejected as an unknown property.

So every push made four requests to a third-party host, one per matrix leg, on the path that gates
merges. On run 33672076496 one
timed out and QA went red on master:

##[error]Failed to run: Error: Command failed: golangci-lint config verify
  [../.golangci.yaml] validate: compile schema: failing loading
  "https://golangci-lint.run/jsonschema/golangci.v2.11.jsonschema.json":
  context deadline exceeded (Client.Timeout exceeded while awaiting headers)

The linter never ran. No .go file was analysed.

What this gives up

Tested against the real .golangci.yaml with v2.11.3:

Broken config golangci-lint run config verify
Unknown linter name exit 3, can't load config catches
YAML syntax / type error exit 3, can't read viper config catches
Unknown top-level key (linterz:) exit 1, silently ignored exit 3, additional properties not allowed

Only the third row is lost. run aborts on the other two by itself, so those stay covered.

The gap is real: viper ignores keys it does not recognise, so a misspelled block reads as
configuration and configures nothing. It is accepted because the config changes rarely, a typo in
it is not urgent, and the alternative was letting an external host decide whether master is green.

If the gap starts to matter, the fix is a scheduled job running config verify on its own — off
the merge path, where an outage costs nothing.

golangci-lint-action defaults to verify: true, which runs `golangci-lint
config verify` before linting. That command fetches the schema from
golangci-lint.run and has no offline mode: there is no --schema flag, and a
$schema key in the config is rejected as an unknown property. So every push
made four requests to a third-party host, one per matrix leg, on the path
that gates merges. When one timed out, QA went red on master with no finding
in any file (run 33672076496).

What the check caught that linting does not is a misspelled or unknown
top-level key: viper ignores those, so the block reads as configuration and
configures nothing. `golangci-lint run` still refuses to start on the other
two failure modes on its own - an unknown linter name and a YAML syntax or
type error both abort it before analysis.

That leaves a narrow gap, and it is worth naming rather than pretending
otherwise. It is accepted here because the config changes rarely, a typo in
it is not urgent, and the alternative was letting an external host decide
whether master is green.
@otavio
otavio requested a review from a team as a code owner September 2, 2026 19:46
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Claude finished @otavio's task in 20s —— View job


Code Review Complete

Reviewed 1 file across code quality, security, testing, language patterns, and architecture — no new issues found. The code looks good as-is.

verify: false is a valid input for golangci-lint-action v9, and the change correctly removes the network dependency (golangci-lint config verify fetching its JSON schema from golangci-lint.run) that was gating merges. The PR body clearly documents the one capability given up — unknown top-level keys silently ignored by viper — and the reasoning holds: golangci-lint run still aborts on unknown linter names and YAML/type errors on its own.


To request another review round, comment /review.

@otavio
otavio merged commit 3ee2a9a into master Sep 2, 2026
40 checks passed
@otavio
otavio deleted the ci/drop-golangci-config-verify branch September 2, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant