Skip to content

Conversation

@cjcocokrisp
Copy link
Contributor

Overview

This pull request addresses issues related to #1153 in which the GitHub action related to golangci-lint needed to be upgraded from v6 to v8. This upgrade requires golangci-lint itself to be updated from v1.64.8 (what was used) to anything v2.X.X. The latest version at the time of this PR is v2.1.6 so that is what was upgraded to in the GitHub action.

Migration to golangci-lint v2.1.6

Because of the major version bump the current .golangci.yml config for the linter needed to be adjusted. The CLI tool offered a migrate command to help make this effort easier. However there were some side effects:

  • Comments inside a configuration aren't migrated (There were none)
  • Deprecated options from v1 or unknown fields are not migrated (No linters were effected)
  • Enforces some default values on parameters.
    • run.timeout was the only thing effected, it was ignored because there is no default in v2 (added it back in with 5 minutes because that is what is used in the GitHub action)

With this migration complete, the golangci/golangci-lint-action in ci-tests.yaml was able to be updated from v6 to v8.

Edits to Code Based on New Rules

In the updated version of the linter there were a few new rules added that required the code to be updated. The updates included the following things:

  • Removed type specification on a variable declaration where it is being assigned something
  • Error strings were changed to not be capitalized
  • .Write(..) was converted to use fmt.Fprintf() instead
  • Else-if chains to check the value of a variable were converted to switch statements
  • Removed embedded field from selectors

…action from 6 to 8, and adjust the code to comply with the new linting rules

Signed-off-by: Christopher Coco <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jun 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.34%. Comparing base (338bc33) to head (ae0b85b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1160   +/-   ##
=======================================
  Coverage   63.34%   63.34%           
=======================================
  Files          15       15           
  Lines        2357     2357           
=======================================
  Hits         1493     1493           
  Misses        769      769           
  Partials       95       95           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chengfang chengfang merged commit 4f64086 into argoproj-labs:master Jun 5, 2025
11 checks passed
@cjcocokrisp cjcocokrisp deleted the chore/upgrade-golint-action branch June 5, 2025 20:45
cjcocokrisp added a commit to cjcocokrisp/argocd-image-updater that referenced this pull request Jun 18, 2025
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.

3 participants