Raise the connector lint pin to golangci-lint v2.13.2 - #123
Merged
Merged
Conversation
The verify workflow resolves its toolchain from the caller's go.mod (go-version-file: _caller/go.mod) but pinned golangci-lint at v2.11.4, whose release binaries are built with go1.26.1. golangci-lint refuses to load its configuration when it was built with a Go older than the module it targets, failing the job before any analysis runs: can't load config: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.1) baton-sdk's go directive is now 1.27.1 on main, and baton-admin propagates that to each connector as it bumps their SDK, so every connector reaching go 1.27 would have hit this. The pin is raised ahead of that rollout rather than during it. v2.13.2's binaries are built with go1.27.0. Landing it first is safe because the check is one-directional: a newer linter lints an older caller without complaint. Every connector sampled is still on go 1.25.x, so today this is only a linter upgrade. It affects every connector consuming verify.yaml, so it takes effect once v4 is re-pointed. Two minor versions of new rules ride along and may surface genuine findings on individual connectors; baton-github-test calls this same workflow and can canary the branch before the tag moves. Verified: the workflow parses and the lint step resolves to version v2.13.2 with the unchanged 6m timeout and _caller working directory. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bencheng21
approved these changes
Sep 21, 2026
v2.13.2 carries goconst v1.11.0, up from v1.8.2. goconst v1.9.0 added
detection of repeated literals inside composite literal elements, and
this config pins no goconst settings, so the connector profile-map
idiom trips the default three-occurrence threshold:
profile := map[string]interface{}{
"displayName": user.Name,
"email": user.Email,
"role": user.Role,
}
Measured across 15 enrolled connectors: of the 12 green in CI, 5 go red
purely on goconst, 47 findings in total, nothing from any other linter
despite errcheck moving ten minor versions and gosec four.
ignore-map-keys alone is not enough -- baton-databricks went from 10
findings to 4 and baton-demo from 31 to 15, the residue being short
protocol strings as arguments and struct fields, which only the
threshold clears. Both settings together return all five to zero:
baton-demo, baton-databricks, baton-file, baton-claude-enterprise and
baton-pingfed each report 0 issues.
Neither setting asks for less correctness. Field-name keys are not
constants worth extracting, and three uses of a string like "user" is
not duplication worth naming.
This file is the source baton-admin syncs into pkg/files/.golangci.yml
daily and pushes to every connector, so it is the only durable place to
set this; the settings are also invalid on v2.11.4, which rejects
ignore-map-keys as an unknown property, so they ship with the pin rather
than ahead of it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
will merge after auto-release run tomorrow |
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.
The verify workflow resolves its toolchain from the caller's go.mod (go-version-file: _caller/go.mod) but pinned golangci-lint at v2.11.4, whose release binaries are built with go1.26.1. golangci-lint refuses to load its configuration when it was built with a Go older than the module it targets, failing the job before any analysis runs.
baton-sdk's go directive is now 1.27.1 on main, and baton-admin propagates that to each connector as it bumps their SDK, so every connector reaching go 1.27 would have hit this. The pin is raised ahead of that rollout rather than during it. v2.13.2's binaries are built with go1.27.0.
Landing it first is safe because the check is one-directional: a newer linter lints an older caller without complaint. Every connector sampled is still on go 1.25.x, so today this is only a linter upgrade.