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

Update to latest versions of Go (1.24) and golangci-lint in GitHub actions.

Summary by CodeRabbit

  • Chores
    • Modernized the CI/CD pipeline by upgrading the Go runtime to v1.24 and updating related tooling. These improvements streamline code quality checks and testing processes, enhancing overall build reliability.

Copy link
Contributor

coderabbitai bot commented Oct 31, 2024

📝 Walkthrough

Walkthrough

This pull request updates several GitHub Actions workflows used in the CI/CD pipelines for various Go projects. The changes primarily consist of upgrading the Go setup action from version v4 to v5, updating the Go version from 1.22 to 1.24, and revising the linting tool by upgrading the golangci-lint-action (and its underlying tool version) where applicable. These modifications affect workflows for the Go client, mod tidy check, integration tests, keychain SDK, shield, wardenkms, faucet, and wardend.

Changes

File(s) Change Summary
.github/workflows/go-client.yml, .github/workflows/keychain-sdk.yml, .github/workflows/shield.yml,
.github/workflows/wardenkms.yml,
.github/workflows/faucet.yml
Upgraded actions/setup-go from v4 to v5 and updated Go version from 1.22 to 1.24. Additionally, updated golangci-lint-action from v3 to v6 with the lint tool version changing from v1.56 to v1.64 in both lint and unit-test jobs.
.github/workflows/go-mod-tidy.yml, .github/workflows/integration-tests.yml Upgraded actions/setup-go from v4 to v5. In the integration tests workflow, the Go version was also updated from 1.22 to 1.24.
.github/workflows/wardend.yaml Updated Go version from 1.22 to 1.24 in the lint and unit-test sections, and upgraded the golangci-lint-action from v4 to v6 with the lint tool version updated from v1.56 to v1.64.

Suggested labels

bug, enhancement

Suggested reviewers

  • mn13
  • backsapc

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

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

📒 Files selected for processing (8)
  • .github/workflows/faucet.yml (1 hunks)
  • .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.yaml (2 hunks)
  • .github/workflows/wardenkms.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • .github/workflows/go-mod-tidy.yml
  • .github/workflows/integration-tests.yml
  • .github/workflows/shield.yml
  • .github/workflows/go-client.yml
  • .github/workflows/wardenkms.yml
  • .github/workflows/keychain-sdk.yml
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (6)
.github/workflows/wardend.yaml (3)

32-33: Updated Go Version in Lint Job:
The updated go-version: "1.24" within the setup-go step is correctly applied. This ensures that the workflow uses a more recent version of Go, aligning with current support and performance improvements.


35-38: Updated golangci-lint Action in Lint Job:
The change to golangci/golangci-lint-action@v6 with the linting tool version set to v1.64 is a proper upgrade that addresses previous deprecation warnings and likely improves linting performance and accuracy.


47-47: Consistent Go Version in Unit-Test Job:
The unit-test job also uses go-version: "1.24" via actions/setup-go@v5, ensuring consistency across all jobs in the workflow.

.github/workflows/faucet.yml (3)

32-35: Updated Go Version in Lint Job:
The lint job now uses actions/setup-go@v5 with go-version: "1.24", which is in line with the recent upgrade and ensures that the CI process runs against a supported and optimized Go version.


37-39: Updated golangci-lint Action in Lint Job:
Upgrading to golangci/golangci-lint-action@v6 with lint version v1.64 provides consistency with other workflows and addresses the outdated linter warnings, leading to a cleaner CI run.


47-49: Uniform Go Version in Unit-Test Job:
The unit-test job’s configuration now correctly reflects the updated Go version ("1.24") using actions/setup-go@v5. This uniformity across jobs will help prevent potential version mismatch issues.


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 generate docstrings to generate docstrings for this 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 Mar 4, 2025 10:21am

@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
@Pitasi Pitasi force-pushed the bump-golangci-lint branch from dafb1bf to afe6d9f Compare March 4, 2025 10:21
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