Skip to content

ci: fix Build job on Go 1.27 (golangci-lint v2.14.0, gosec with x/tools v0.52.0) - #41

Merged
kycheng merged 2 commits into
alauda-v4.47.1from
chore/DEVOPS-44746-ci-gosec-xtools
Oct 12, 2026
Merged

kycheng merged 2 commits into
alauda-v4.47.1from
chore/DEVOPS-44746-ci-gosec-xtools

Conversation

@kycheng

@kycheng kycheng commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes the red Build check on alauda-v* PRs (it was already failing on #38 and #40).

Once go.mod moved to Go 1.27, both tools installed by scripts/devtools.sh broke:

  • gosec v2.29.0 pins golang.org/x/tools v0.49.0, which cannot decode Go 1.27 export data, so every package failed to type-check:
    cannot decode "os", export data version 5 is greater than maximum supported version.
    Fix: build the same gosec version against golang.org/x/tools@v0.52.0 in a throwaway module.
  • golangci-lint v2.11.2 (even with a newer x/tools) panics analysing Go 1.27's internal/poll on linux:
    buildir: unexpected expr: *ast.KeyValueExpr. Fix: v2.14.0, the same version cosign uses. Its revive adds unexported-return, which flags two long-standing public constructors (NewFrontMatterHandler, NewWriteInPlaceHandler); it is excluded in .golangci.yml the same way var-naming already is.

Verified locally with go1.27.2: scripts/devtools.sh && make local build passes (cspell 0, gosec 0 issues, golangci-lint 0 issues on GOOS=linux, tests OK).

Note: merging to alauda-v4.47.1 will auto-tag v4.47.2-alauda-34 (CI-only change, same binary).

🤖 Generated with Claude Code

kycheng and others added 2 commits October 12, 2026 14:20
golangci-lint v2.11.2 and gosec v2.29.0 pin golang.org/x/tools <= v0.49.0,
which cannot decode Go 1.27 export data, so the Build job failed with
"export data version 5 is greater than maximum supported version" on
every package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v2.11.2 panics analysing Go 1.27's internal/poll on linux
("buildir: unexpected expr: *ast.KeyValueExpr"), so build v2.14.0
instead. Its revive adds unexported-return, which flags two long-standing
public constructors; exclude it like var-naming.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kycheng kycheng changed the title ci: build golangci-lint and gosec against x/tools v0.52.0 for Go 1.27 ci: fix Build job on Go 1.27 (golangci-lint v2.14.0, gosec with x/tools v0.52.0) Oct 12, 2026
@kycheng
kycheng merged commit d751fc6 into alauda-v4.47.1 Oct 12, 2026
3 checks passed
@kycheng
kycheng deleted the chore/DEVOPS-44746-ci-gosec-xtools branch October 12, 2026 06:41
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