Repository navigation
[oadp-1.5] ci: build golangci-lint with repo Go toolchain via make lint - #396
Conversation
The golangci-lint-action step installs the v1.62.2 release binary, which is built with Go 1.23 and refuses to lint this go 1.25.0 module: can't load config: the Go language version (go1.23) used to build golangci-lint is lower than the targeted Go version (1.25.0) No v1.x release is built with Go 1.25, so run 'make lint' instead; it go-installs the pinned GOLANGCI_LINT_VERSION with the Go toolchain set up by actions/setup-go. Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com> Co-Authored-By: Claude Code (model: Claude Sonnet 5.5) <noreply@anthropic.com>
The explanatory notes were appended inside the license comment, so the goheader linter rejected the header. Close the license block and move the notes into a separate comment. Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com> Co-Authored-By: Claude Code (model: Claude Sonnet 5.5) <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused workflow change has no identified blockers; the documented existing lint finding remains outside its scope.
No open issues 🎉
What changed in this PR
Updates CI to build the linter with the repository’s Go toolchain instead of using an incompatible prebuilt binary.
Changes:
- Replaces the golangci-lint action with
make lint, reusing the Makefile’s pinned version. - Documents why a source build is needed.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Delegates linting to make lint and explains toolchain compatibility. |
Review effort: Balanced
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
shubham-pampattiwar
left a comment
There was a problem hiding this comment.
Reviewed the source-built linter change and license-header fix. Current CI passes. No blocking findings.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai, shubham-pampattiwar, sseago The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
What failed
The
Continuous Integrationworkflow (golang-checkjob,Go lintersstep) fails on every push tooadp-1.5and has been merged over (PRs #355, #384, #359, #321, #317 all merged withContinuous Integrationred, e.g. run https://github.com/migtools/oadp-non-admin/actions/runs/34140255330):golangci/golangci-lint-actioninstalls the v1.62.2 release binary, which is built with Go 1.23. No golangci-lint v1.x release is built with Go 1.25, so the action can never lint thisgo 1.25.0module.Fix
Replace the action with
make lint. The Makefile already pinsGOLANGCI_LINT_VERSION ?= v1.62.2andgo installs it, so the linter is built with the Go toolchain fromactions/setup-go. This also keeps the Makefile as the single source of the linter version.Not fixed here
With the linter running again (verified locally with Go 1.25.0), it reports one existing finding on this branch, outside the workflow:
The license header comment in that file has extra text after it, introduced by #317. Fixing that is a code change, so it is left for a follow-up. The
Go lintersstep will stay red until then, but it will now report the real finding instead of a toolchain error.Note
Responses generated with Claude (model: Claude Sonnet 5.5)
🤖 Generated with Claude Code