-
Notifications
You must be signed in to change notification settings - Fork 242
Description
Summary
There is a version mismatch between the golangci-lint version used locally via make lint and the version used in Prow CI (pull-ci-openshift-rosa-master-lint). This can cause inconsistent linting results and make it difficult for developers to reproduce CI failures locally.
Environment
- Repository: openshift/rosa
- Local golangci-lint version: v1.60.0 (via bingo)
- Prow CI golangci-lint version: v2.6.1 (from CI image)
- Project configuration:
.golangciversionspecifiesv1.60.0
Steps to Reproduce
-
Run
make lintlocally- Uses
golangci-lint-v1.60.0from.bingo/Variables.mk - Linting passes
- Uses
-
Push changes to a PR
- Prow CI job
pull-ci-openshift-rosa-master-lintruns - Uses
golangci-lint v2.6.1from the CI image - May produce different linting results
- Prow CI job
Expected Behavior
Both local make lint and Prow CI should use the same golangci-lint version to ensure consistent linting results.
Actual Behavior
- Local development uses golangci-lint v1.60.0 (as specified in
.golangciversionand managed by bingo) - Prow CI uses golangci-lint v2.6.1 (from the CI image, ignoring the project's version specification)
Evidence
Local Configuration
.golangciversion:v1.60.0.bingo/Variables.mk:GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.60.0.bingo/golangci-lint.mod:require github.com/golangci/golangci-lint v1.60.0
Local Execution
$ make -n lint
/Users/xxxx/go/bin/golangci-lint-v1.60.0 run --timeout 5m0s ./...Prow CI
From Prow CI logs, the job uses golangci-lint v2.6.1 (likely from the CI image ocp/builder:rhel-9-golang-1.24-openshift-4.21).
Impact
- Inconsistent Results: Developers may see different linting results locally vs CI
- Developer Friction: CI failures that can't be reproduced locally
- False Positives/Negatives: Different versions may flag or miss different issues
- Maintenance Burden: Need to maintain compatibility with two different versions
Proposed Solution
Ensure Prow CI uses the same golangci-lint version as specified in the project:
Option 1 (Recommended): Update Prow CI configuration to use the bingo-managed version
- Modify the CI job to build/use
golangci-lint-v1.60.0from.bingo/Variables.mk - This ensures CI uses the exact version specified in
.golangciversion
Option 2: Update project to match CI version
- Update
.golangciversiontov2.6.1 - Update
.bingo/golangci-lint.modto require v2.6.1 - Run
bingo get github.com/golangci/golangci-lint/cmd/golangci-lint@v2.6.1 - Test locally to ensure no breaking changes
Additional Context
The project uses bingo to manage tool versions, which should ensure version consistency. However, the Prow CI job appears to be using a pre-installed version from the CI image instead of the bingo-managed version.
Related Files
.golangciversion- Specifies expected version.bingo/Variables.mk- Bingo-generated variables.bingo/golangci-lint.mod- Bingo module fileMakefile- Uses$(GOLANGCI_LINT)from bingo.golangci.yml- Linter configuration (compatible with both versions)
Questions
- Is there a specific reason Prow CI uses v2.6.1 instead of the project-specified version?
- Should we align to v1.60.0 (project standard) or v2.6.1 (CI standard)?
- Are there any known compatibility issues between these versions with the current
.golangci.ymlconfiguration?