Skip to content

Bug Report: golangci-lint Version Mismatch Between Local and Prow CI #3089

@paulczar

Description

@paulczar

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: .golangciversion specifies v1.60.0

Steps to Reproduce

  1. Run make lint locally

    • Uses golangci-lint-v1.60.0 from .bingo/Variables.mk
    • Linting passes
  2. Push changes to a PR

    • Prow CI job pull-ci-openshift-rosa-master-lint runs
    • Uses golangci-lint v2.6.1 from the CI image
    • May produce different linting results

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 .golangciversion and 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

  1. Inconsistent Results: Developers may see different linting results locally vs CI
  2. Developer Friction: CI failures that can't be reproduced locally
  3. False Positives/Negatives: Different versions may flag or miss different issues
  4. 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.0 from .bingo/Variables.mk
  • This ensures CI uses the exact version specified in .golangciversion

Option 2: Update project to match CI version

  • Update .golangciversion to v2.6.1
  • Update .bingo/golangci-lint.mod to 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 file
  • Makefile - Uses $(GOLANGCI_LINT) from bingo
  • .golangci.yml - Linter configuration (compatible with both versions)

Questions

  1. Is there a specific reason Prow CI uses v2.6.1 instead of the project-specified version?
  2. Should we align to v1.60.0 (project standard) or v2.6.1 (CI standard)?
  3. Are there any known compatibility issues between these versions with the current .golangci.yml configuration?

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions