Skip to content

chore(ci): build golangci-lint from go.sum to align with project version#2111

Open
nddq wants to merge 1 commit intomainfrom
chore/align-golangci-lint
Open

chore(ci): build golangci-lint from go.sum to align with project version#2111
nddq wants to merge 1 commit intomainfrom
chore/align-golangci-lint

Conversation

@nddq
Copy link
Member

@nddq nddq commented Mar 13, 2026

Description

Currently the golangci-lint workflow uses golangci-lint-action with version: latest, which drifts from the version pinned in go.sum. This causes lint results in CI that don't reproduce locally via make lint (#2027).

This PR replaces the action with a go build step that builds golangci-lint from the version tracked in go.sum, so CI uses the exact same version as local make lint. It also switches from the action's only-new-issues flag to --new-from-rev for incremental linting.

Related Issue

Fixes #2027

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...).
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

@nddq nddq requested a review from a team as a code owner March 13, 2026 13:10
@nddq nddq requested review from camrynl and ritwikranjan March 13, 2026 13:10
@nddq nddq mentioned this pull request Mar 13, 2026
7 tasks
@github-actions
Copy link

github-actions bot commented Mar 13, 2026

Retina Code Coverage Report

Total coverage decreased from 33.3% to 33.2%

Decreased diff

Impacted Files Coverage
pkg/enricher/enricher.go 57.8% ... 55.0% (-2.8%) ⬇️

alexcastilio
alexcastilio previously approved these changes Mar 13, 2026
@nddq nddq force-pushed the chore/align-golangci-lint branch from f783b4e to 3eca20f Compare March 13, 2026 13:57
@nddq nddq changed the title chore(ci): build golangci-lint from go.sum to align with project version chore(ci): use go tool for golangci-lint to align with project version Mar 13, 2026
@nddq nddq requested a review from alexcastilio March 13, 2026 13:58
@nddq nddq force-pushed the chore/align-golangci-lint branch 2 times, most recently from 7c298b0 to 5d9e01f Compare March 13, 2026 14:12
@nddq nddq changed the title chore(ci): use go tool for golangci-lint to align with project version chore(ci): build golangci-lint from go.sum to align with project version Mar 16, 2026
@nddq nddq force-pushed the chore/align-golangci-lint branch from 5d9e01f to 3c3421f Compare March 16, 2026 17:09
Replace golangci-lint-action (which downloads the latest release) with
go build from go.sum, so CI uses the same v1.64.7 as local `make lint`.
The binary is built with GOOS=linux GOARCH=amd64 for the host runner,
while job-level GOOS/GOARCH env vars direct golangci-lint's analysis to
the target platform.

Use a YAML block scalar for the lint run step to avoid a YAML parse
error caused by the leading double-quoted path.

Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>
@nddq nddq force-pushed the chore/align-golangci-lint branch from 3c3421f to 92b476a Compare March 16, 2026 17:17
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.

Align golangci-lint versions (local vs CI)

2 participants