Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pitasi
Copy link
Contributor

@Pitasi Pitasi commented Oct 31, 2024

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

    • Updated GitHub Actions workflows for various components to utilize newer versions of tools and actions.
  • Bug Fixes

    • Improved linting and testing processes by upgrading the Go version and linting tools across multiple workflows.
  • Chores

    • General maintenance of workflow files to ensure compatibility with the latest versions of GitHub Actions and Go.

Copy link
Contributor

coderabbitai bot commented Oct 31, 2024

📝 Walkthrough

Walkthrough

The changes in this pull request involve updates to multiple GitHub Actions workflow files related to Go projects. The primary modifications include upgrading the setup-go action from version v4 to v5 and updating the Go version from 1.22 to 1.23 across several workflows. Additionally, the golangci-lint action version has been updated from v3 to v6, with the linting tool version changing from v1.56 to v1.61. These updates enhance the CI/CD pipeline for Go projects by utilizing newer versions of tools and actions.

Changes

File Path Change Summary
.github/workflows/go-client.yml Updated setup-go to v5, Go version to 1.23, and golangci-lint to v6 with linting version 1.61.
.github/workflows/go-mod-tidy.yml Updated setup-go to v5.
.github/workflows/integration-tests.yml Updated setup-go to v5.
.github/workflows/keychain-sdk.yml Updated setup-go to v5, Go version to 1.23, golangci-lint to v6, and linting version to 1.61.
.github/workflows/shield.yml Updated setup-go to v5, Go version to 1.23, golangci-lint to v6, and linting version to 1.61.
.github/workflows/wardend.yml Updated setup-go to v5, Go version to 1.23, and golangci-lint to v6 with linting version 1.61.
.github/workflows/wardenkms.yml Updated setup-go to v5, Go version to 1.23, and golangci-lint to v6 with linting version 1.61.
.github/workflows/wasmvm-linter.yml Updated setup-go to v5.

Possibly related PRs

  • ci: add wasmvm-linter for checking version consistency #642: The changes in the .github/workflows/wasmvm-linter.yml file involve updating the setup-go action to v5, similar to the updates made in the main PR for the Go client workflow.
  • chore(wardend): bump ibc-go to v8.4.0 #658: The updates in the go.mod file for the ibc-go dependency may relate to the overall Go project management, although they do not directly connect to the specific changes in the main PR.
  • Release wardenjs 0.0.9 #801: The release of wardenjs version 0.0.9 includes updates to the changelog and package version, which may be part of the broader context of version management in Go projects, but lacks a direct connection to the main PR's workflow changes.

Suggested labels

wardenjs

Suggested reviewers

  • artur-abliazimov
  • backsapc

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fffd833 and 671f4cc.

📒 Files selected for processing (8)
  • .github/workflows/go-client.yml (1 hunks)
  • .github/workflows/go-mod-tidy.yml (1 hunks)
  • .github/workflows/integration-tests.yml (1 hunks)
  • .github/workflows/keychain-sdk.yml (1 hunks)
  • .github/workflows/shield.yml (1 hunks)
  • .github/workflows/wardend.yml (1 hunks)
  • .github/workflows/wardenkms.yml (1 hunks)
  • .github/workflows/wasmvm-linter.yml (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/integration-tests.yml
  • .github/workflows/wasmvm-linter.yml
🔇 Additional comments (10)
.github/workflows/go-mod-tidy.yml (1)

11-11: LGTM: Setup-go action update looks good!

The update from v4 to v5 addresses the deprecated Node.js version issue.

.github/workflows/shield.yml (2)

25-27: LGTM! Good upgrade of golangci-lint

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.


35-37: ⚠️ Potential issue

Same Go version issue as above

This instance also needs to be updated to Go 1.22.

.github/workflows/go-client.yml (1)

25-28: Verify impact of golangci-lint upgrade

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 successful

Golangci-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.

  • All workflow files use identical golangci-lint configurations
  • Each module is properly scoped with its own path in the args parameter
  • The timeout setting (10m) is consistent across all workflows
🏁 Scripts executed

The 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)

35-38: ⚠️ Potential issue

Same Go version issue as in the lint job

The Go version needs to be updated to 1.22 here as well.


25-28: LGTM: Good upgrade of golangci-lint

The update to golangci-lint-action@v6 and golangci-lint@v1.61 brings in the latest stable versions and should resolve the reported linting failures.

Let's verify if there are any breaking changes in the new golangci-lint version that might require configuration updates:

✅ Verification successful

Golangci-lint upgrade appears safe to proceed

Since no golangci-lint configuration files were found in the repository, the upgrade to golangci-lint-action@v6 and golangci-lint@v1.61 should use the default configuration. This means the upgrade is less likely to cause issues as there are no custom configurations that could conflict with the new versions.

🏁 Scripts executed

The 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)

26-44: Verify workflow changes across related files.

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"

31-31: Significant golangci-lint version update requires attention.

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 successful

Golangci-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:

  • The change was made consistently across multiple workflow files
  • No .golangci.yml configuration file exists in the repository
  • The upgrade uses stable versions of both the action and the linter

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 executed

The 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)

45-47: ⚠️ Potential issue

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.


35-37: Verify golangci-lint configuration compatibility

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 successful

Golangci-lint version update appears safe to proceed

The verification shows that there is no custom golangci-lint configuration file (.golangci.yml or similar) in the repository. This means the project is using the default configuration of golangci-lint, which makes the version upgrade safer as there are no custom configurations that could be impacted by breaking changes between versions.

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 executed

The 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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Pitasi Pitasi force-pushed the bump-golangci-lint branch from 671f4cc to dafb1bf Compare October 31, 2024 11:46
Copy link

vercel bot commented Oct 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
warden-help-center ⬜️ Ignored (Inspect) Visit Preview Oct 31, 2024 11:46am

@Pitasi Pitasi enabled auto-merge (rebase) October 31, 2024 11:46
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 consistency

The 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:

  1. actions/checkout@v3 -> actions/checkout@v4
  2. 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 issue

Go 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 issue

Fix: Invalid Go version specified

The Go version 1.23 does not exist yet. The latest stable version is 1.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 issue

Go 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 in cmd/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.go

Length of output: 588

.github/workflows/wardend.yml (1)

30-32: ⚠️ Potential issue

Go 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"

@Pitasi Pitasi requested a review from a team November 20, 2024 08:31
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.

1 participant