Skip to content

Conversation

@thevilledev
Copy link
Contributor

@thevilledev thevilledev commented Jun 6, 2025

Prep for Go version upgrade in #23294 by upgrading golangci-lint to the latest version for the release-2.14 branch.

  • Disabled staticcheck related rules which were causing hundreds of linting errors, requiring breaking changes and manual labor. See diff for full list. My suggestion is that these could be improved in separate PRs one by one. Many of these are automatically fixable.
  • Disabled certain testifylint rules which were also auto-fixable.

Only tests required code changes:

  • Removed a nolint reference to an inactive linter ("structcheck")
  • Fixed a misuse of assert.ElementsMatch()

Separate commits in this PR hopefully help the review process.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

This commit upgrades the tooling references and configuration.
Lint violations not fixed yet.

Signed-off-by: Ville Vesilehto <[email protected]>
formatter: using msgAndArgs with non-string first element
causes panic (testifylint)

The assert.ElementsMatch function is being called with
multiple list pairs in a single call, but it can only
compare two lists at a time.

Signed-off-by: Ville Vesilehto <[email protected]>
@codecov
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.33%. Comparing base (14fa0e0) to head (c9fe32f).
⚠️ Report is 18 commits behind head on release-2.14.

Additional details and impacted files
@@               Coverage Diff                @@
##           release-2.14   #23305      +/-   ##
================================================
+ Coverage         55.30%   55.33%   +0.02%     
================================================
  Files               339      339              
  Lines             57361    57361              
================================================
+ Hits              31726    31738      +12     
+ Misses            22941    22937       -4     
+ Partials           2694     2686       -8     

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

@crenshaw-dev
Copy link
Member

Does the upgrade require enabling new linters? i.e. could we make this PR more minimal?

@thevilledev
Copy link
Contributor Author

Sure, I can disable more rules if we want to keep changes to the minimum. I believe the default set changed with v2 for staticcheck specifically

@crenshaw-dev
Copy link
Member

Ah sure. Yeah I'd like to do whatever is the minimum necessary to unblock the go upgrade.

@thevilledev thevilledev force-pushed the chore/release-2.14-upgrade-golangci-lint-v2 branch from b204dce to bcaa7cf Compare June 6, 2025 17:55
Revert "chore: lint violations autofixed with --fix"

This reverts commit 64e5905.

Signed-off-by: Ville Vesilehto <[email protected]>
ignore most quick fixes to minimise impact
of upgrading golangci-lint to v2

Signed-off-by: Ville Vesilehto <[email protected]>
@thevilledev thevilledev force-pushed the chore/release-2.14-upgrade-golangci-lint-v2 branch from bcaa7cf to c9fe32f Compare June 6, 2025 18:55
@thevilledev
Copy link
Contributor Author

Messed up DCO for the previous run but tests passed. I think we are close :)

@thevilledev
Copy link
Contributor Author

thevilledev commented Jun 6, 2025

@crenshaw-dev feedback welcome on the current approach! Tests pass with the v2 linter now, with minimal changes

Copy link
Member

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

looks great, thanks!

@crenshaw-dev crenshaw-dev merged commit e24ee58 into argoproj:release-2.14 Jun 6, 2025
21 of 22 checks passed
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.

2 participants