-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: bump setup-go and golangci-lint actions #981
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request involve updates to multiple GitHub Actions workflow files related to Go projects. The primary modifications include upgrading the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (8)
✅ Files skipped from review due to trivial changes (2)
🔇 Additional comments (10).github/workflows/go-mod-tidy.yml (1)
The update from v4 to v5 addresses the deprecated Node.js version issue. .github/workflows/shield.yml (2)
The update to the latest versions of both golangci-lint-action (v6) and golangci-lint (v1.61) is appropriate and should help resolve the failing lint issues mentioned in the PR description.
Same Go version issue as above This instance also needs to be updated to Go 1.22. .github/workflows/go-client.yml (1)
The upgrade from v1.56 to v1.61 is significant and may introduce new linters or stricter checks. While this is good for code quality, it might flag new issues. Let's check for any new linters or configuration changes: ✅ Verification successfulGolangci-lint upgrade is consistently applied across the project The upgrade to golangci-lint-action@v6 and golangci-lint v1.61 has been consistently applied across all Go packages in the project (wardenkms, wardend, keychain-sdk, shield, and go-client). Since there's no custom golangci-lint configuration file present (no .golangci.yml found), the tool will use its default settings, which reduces the risk of incompatibilities from the upgrade.
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for golangci-lint configuration files that might need updates
# Look for golangci-lint config files
echo "Searching for golangci-lint config files..."
fd -t f -e yml -e yaml -e json '.golangci'
# Check if the config files contain any linter configurations
echo "Checking linter configurations in found files..."
rg -l "linters-settings|linters:"
Length of output: 282 Script: #!/bin/bash
# Let's try a different approach to find golangci-lint configurations
# Check for any .golangci.yml variations and go.mod to understand the project structure
echo "Looking for golangci lint config files with different patterns..."
fd -t f '\.golangci'
fd -t f 'golangci'
echo -e "\nChecking go.mod in go-client directory..."
cat go-client/go.mod 2>/dev/null || echo "go.mod not found in go-client/"
echo -e "\nLooking for any lint-related configurations in workflow files..."
rg -l "golangci" .github/workflows/
Length of output: 714 Script: #!/bin/bash
# Let's check the content of these workflow files to understand the lint configurations
echo "Checking lint configurations in workflow files..."
for file in .github/workflows/{wardenkms,wardend,keychain-sdk,shield}.yml; do
echo -e "\n=== $file ==="
rg "golangci" -A 5 -B 2 "$file" || echo "No golangci-lint config found"
done
echo -e "\nChecking for any Go files in go-client directory..."
fd -t f -e go . go-client/ || echo "No Go files found in go-client/"
Length of output: 2287 .github/workflows/keychain-sdk.yml (2)
Same Go version issue as in the lint job The Go version needs to be updated to 1.22 here as well.
The update to Let's verify if there are any breaking changes in the new golangci-lint version that might require configuration updates: ✅ Verification successfulGolangci-lint upgrade appears safe to proceed Since no golangci-lint configuration files were found in the repository, the upgrade to 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check for golangci-lint config files that might need updates
fd -t f -e yml -e yaml '.golangci' --exec cat {} \;
Length of output: 54 Script: #!/bin/bash
# Try alternative search for golangci-lint config files
fd -t f -g '*golangci*' --exec cat {} \;
# Also check if there are any linter configurations in other common locations
fd -t f -g '*.yaml' -g '*.yml' -d 1 --exec cat {} \;
Length of output: 196 .github/workflows/wardenkms.yml (2)
The changes look good and align with the PR objectives to address deprecated Node.js warnings. However, we should ensure consistency across all workflow files. #!/bin/bash
# Check for consistency in Go and linter versions across workflows
echo "Checking Go and linter versions in all workflow files:"
fd -t f "\.ya?ml$" .github/workflows/ --exec grep -H -A 1 "setup-go@\|golangci-lint-action@\|go-version:\|version: v1"
The update from v3 to v6 of golangci-lint-action and v1.56 to v1.61 of golangci-lint itself is a major change that could introduce new linting rules or behavior changes. Also applies to: 33-33 ✅ Verification successfulGolangci-lint version update appears to be part of a coordinated upgrade The version upgrade from v3 to v6 of golangci-lint-action and v1.56 to v1.61 of golangci-lint is part of a broader CI tooling update. Since:
This suggests the update is intentional and follows standard CI maintenance practices. The absence of a custom linter configuration means the project relies on default rules, reducing the risk of unexpected behavior changes. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check for existing golangci-lint configuration
echo "Checking for golangci-lint config:"
fd ".golangci.yml$|.golangci.yaml$|.golangci.toml$"
# Look for common linting issues that might be affected
echo -e "\nChecking for potential new linting violations:"
rg "^//nolint|//lint:ignore"
Length of output: 4561 Script: #!/bin/bash
# Check for golangci-lint config file
echo "Checking for golangci-lint config:"
find . -maxdepth 2 -type f -name ".golangci.yml"
# Get the content of golangci-lint config if it exists
echo -e "\nGolangci-lint config content (if exists):"
if [ -f ".golangci.yml" ]; then
cat .golangci.yml
fi
# Check git history for previous golangci-lint version
echo -e "\nChecking git history for golangci-lint version changes:"
git log -p -- .github/workflows/wardenkms.yml | grep -A 2 "golangci-lint"
Length of output: 1197 .github/workflows/wardend.yml (2)
Same Go version issue as above This instance also specifies Go version 1.23 which is not yet released. Apply the same fix as mentioned in the previous comment.
The significant version jump (v3 → v6 for action, v1.56 → v1.61 for linter) might introduce breaking changes or new lints. Let's check for any golangci-lint configuration files and their compatibility: ✅ Verification successfulGolangci-lint version update appears safe to proceed The verification shows that there is no custom golangci-lint configuration file ( The absence of linter directives in Go files also suggests that the codebase doesn't rely on version-specific linter behaviors that could be affected by the upgrade. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for golangci-lint config and potential breaking changes
# Look for config files
echo "Searching for golangci-lint config files:"
fd -e yml -e yaml -e json --glob '.golangci*'
# Check if there are any disabled linters that might now be enabled by default
echo -e "\nChecking for linter configurations:"
rg -A 5 'disabled-.*linters:'
Length of output: 467 Script: #!/bin/bash
# Description: Check for golangci-lint config files and configurations with hidden flag
# and broader pattern matching
# Look for config files including hidden ones
echo "Searching for golangci-lint config files:"
fd -H -e yml -e yaml -e json --glob '*golangci*'
# Check for any linter configurations with broader pattern
echo -e "\nChecking for linter configurations:"
rg -i "linters|disable|enable" .golangci.yml || true
# Check for any Go files that might have linter directives
echo -e "\nChecking for linter directives in Go files:"
rg "//\s*nolint|//\s*linter:" "\.go$"
Length of output: 527 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
671f4cc
to
dafb1bf
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.
Actionable comments posted: 7
🛑 Comments failed to post (7)
.github/workflows/go-mod-tidy.yml (2)
9-12: 💡 Codebase verification
Update
actions/checkout
to v4 for consistencyThe repository already uses
actions/checkout@v4
in most workflow files. Update this workflow to maintain consistency across the codebase.Regarding
katexochen/go-tidy-check@v2
:
- It's compatible with the current Go version (1.22.5)
- No other workflows use this action, so there's no version inconsistency to address
🔗 Analysis chain
Consider updating other actions.
While updating the setup-go action, consider also reviewing:
actions/checkout@v3
->actions/checkout@v4
katexochen/go-tidy-check@v2
- verify compatibility with Go 1.23🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if other workflow files use newer versions of checkout action rg -l 'actions/checkout@v4' '.github/workflows/'Length of output: 417
Script:
#!/bin/bash # Check if go-tidy-check action is used in other workflow files and its version rg 'katexochen/go-tidy-check@' .github/workflows/ # Check Go version specified in go.mod cat go.mod | rg '^go 'Length of output: 160
11-11: 🛠️ Refactor suggestion
Consider specifying Go version explicitly.
Other workflow files in the repository specify Go 1.23. For consistency, consider adding the Go version here as well.
- - uses: actions/setup-go@v5 + - uses: actions/setup-go@v5 + with: + go-version: '1.23'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.- uses: actions/setup-go@v5 with: go-version: '1.23'
.github/workflows/shield.yml (1)
20-22:
⚠️ Potential issueGo version 1.23 is not yet released
While updating to
setup-go@v5
is good as it addresses the Node.js deprecation warning, Go 1.23 is not yet released. The latest stable version is Go 1.22.Apply this fix:
- uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.22"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.- uses: actions/setup-go@v5 with: go-version: "1.22"
.github/workflows/go-client.yml (1)
20-23:
⚠️ Potential issueFix: Invalid Go version specified
The Go version
1.23
does not exist yet. The latest stable version is1.22
. This will cause workflow failures.Apply this fix to both occurrences:
- go-version: "1.23" + go-version: "1.22"Also applies to: 35-37
.github/workflows/keychain-sdk.yml (1)
20-23:
⚠️ Potential issueGo version 1.23 is not yet released
While updating to
setup-go@v5
is good as it addresses the Node.js deprecation warning, specifying Go version 1.23 will cause CI failures as this version is not yet released. The latest stable version is Go 1.22.Apply this fix:
- uses: actions/setup-go@v5 with: - go-version: "1.23" + go-version: "1.22"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.- uses: actions/setup-go@v5 with: go-version: "1.22" cache: false
.github/workflows/wardenkms.yml (1)
26-26: 💡 Codebase verification
Go 1.23 upgrade needs attention to compatibility issues
The codebase currently requires Go 1.22.x (found in go.mod), and upgrading to 1.23 requires addressing:
http.PostForm
usage incmd/faucet-v2/main.go
should be reviewed as HTTP client behavior has changed in Go 1.23- The go.mod files specify Go 1.22.x versions, which need to be updated
Recommendation:
- Keep the current Go 1.22 version until proper testing with 1.23 can be performed
- Update go.mod files first before upgrading the workflow
🔗 Analysis chain
Verify Go 1.23 compatibility across the codebase.
The upgrade to Go 1.23 is significant as it's a very recent version. While updating is good practice, we should ensure compatibility.
Also applies to: 28-28, 41-41, 43-43
Let me check the specific usage of potentially deprecated features in the identified file to make a more informed decision.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for Go version constraints in go.mod files echo "Checking Go version requirements in go.mod files:" fd -t f "go.mod$" --exec cat {} \; | grep -A 1 "^go " # Look for potential compatibility issues echo -e "\nChecking for deprecated features or syntax that might be affected:" rg -l "(?i)(golang\.org/x/net/context|ioutil\.|http\.Get|http\.Post)"Length of output: 435
Script:
#!/bin/bash # Check the specific usage of deprecated features in the identified file echo "Checking deprecated feature usage in cmd/faucet-v2/main.go:" rg -A 5 "(golang\.org/x/net/context|ioutil\.|http\.Get|http\.Post)" cmd/faucet-v2/main.go # Also check for any Go version constraints in build tags or comments echo -e "\nChecking for version-specific build constraints:" rg "//\s*\+build\s+go" cmd/faucet-v2/main.goLength of output: 588
.github/workflows/wardend.yml (1)
30-32:
⚠️ Potential issueGo version 1.23 is not yet released
The specified Go version
1.23
is not yet released (current stable is 1.22). This will cause CI failures as the version cannot be installed.Apply this fix:
- go-version: "1.23" + go-version: "1.22"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.- uses: actions/setup-go@v5 with: go-version: "1.22"
This should fix some warning from github (setup-go was using a deprecated node.js version) and potentially fix golangci-lint that started failing.
Summary by CodeRabbit
New Features
Bug Fixes
Chores