Skip to content

[oadp-1.5] ci: build golangci-lint with repo Go toolchain via make lint - #396

Merged
openshift-merge-bot[bot] merged 2 commits into
migtools:oadp-1.5from
kaovilai:ci/fix-golangci-lint-oadp-1.5
Oct 21, 2026
Merged

openshift-merge-bot[bot] merged 2 commits into
migtools:oadp-1.5from
kaovilai:ci/fix-golangci-lint-oadp-1.5

Conversation

@kaovilai

Copy link
Copy Markdown
Member

What failed

The Continuous Integration workflow (golang-check job, Go linters step) fails on every push to oadp-1.5 and has been merged over (PRs #355, #384, #359, #321, #317 all merged with Continuous Integration red, e.g. run https://github.com/migtools/oadp-non-admin/actions/runs/34140255330):

Error: 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)

golangci/golangci-lint-action installs 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 this go 1.25.0 module.

Fix

Replace the action with make lint. The Makefile already pins GOLANGCI_LINT_VERSION ?= v1.62.2 and go installs it, so the linter is built with the Go toolchain from actions/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:

internal/controller/nonadminbackupstoragelocation_controller_test.go:13:31: Unexpected string:

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 linters step 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

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>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 16:15
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a78ac58-72e3-486d-8c95-1e8c666d80f9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@oadp-snyk

oadp-snyk commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@shubham-pampattiwar shubham-pampattiwar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the source-built linter change and license-header fix. Current CI passes. No blocking findings.

@openshift-ci

openshift-ci Bot commented Oct 21, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [kaovilai,shubham-pampattiwar,sseago]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sseago

sseago commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Oct 21, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 25707a3 into migtools:oadp-1.5 Oct 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants