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

feat(build): drop Go 1.21 support #37

Merged
merged 1 commit into from
Jan 14, 2025
Merged

feat(build): drop Go 1.21 support #37

merged 1 commit into from
Jan 14, 2025

Conversation

karasz
Copy link
Contributor

@karasz karasz commented Jan 14, 2025

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated project to use Go version 1.22
    • Updated linting and development tools to support Go 1.22
    • Configured GitHub Actions workflow to test against Go 1.22 and 1.23
    • Updated Renovate configuration to recognize Go 1.22

Signed-off-by: Nagy Károly Gábriel <[email protected]>
Copy link

coderabbitai bot commented Jan 14, 2025

Walkthrough

The pull request focuses on upgrading the project's Go version from 1.21 to 1.22. This change involves updating multiple configuration files across the project, including GitHub Actions workflow, linting configuration, Makefile, Go module files, and Renovate settings. The modifications ensure consistent Go version support and update tooling configurations to align with the new Go version.

Changes

File Change Summary
.github/workflows/build.yml Removed Go 1.21 from matrix, now testing only Go 1.22 and 1.23
.golangci.yml Added new linting configuration with detailed settings for govet and revive
Makefile Updated tool versions for GolangCI-Lint and Revive to match Go 1.22
go.mod Updated Go version from 1.21 to 1.22
pkg/respond/go.mod Updated Go version from 1.21 to 1.22
renovate.json Updated allowed Go version from 1.21 to 1.22

Poem

🐰 Hop, hop, Go version new,
From 1.21 to 1.22 we brew!
Linters sharp, workflows bright,
Coding rabbits dance with delight!
Version upgrade, smooth and clean,
Our project's future now serene! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 529ce25 and a072900.

📒 Files selected for processing (6)
  • .github/workflows/build.yml (1 hunks)
  • .golangci.yml (1 hunks)
  • Makefile (1 hunks)
  • go.mod (1 hunks)
  • pkg/respond/go.mod (1 hunks)
  • renovate.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • go.mod
  • pkg/respond/go.mod
🔇 Additional comments (6)
renovate.json (1)

9-9: LGTM! Version update aligns with dropping Go 1.21 support.

The change correctly updates Renovate configuration to use Go 1.22 as the minimum allowed version.

.github/workflows/build.yml (1)

15-15: LGTM! Matrix update correctly removes Go 1.21.

The change appropriately updates the test matrix to only include Go 1.22 and 1.23, aligning with dropping Go 1.21 support.

.golangci.yml (3)

1-4: LGTM! Run configuration looks good.

The run configuration with a 5-minute deadline, parallel runners, and readonly module mode is appropriate for CI environments.


6-40: LGTM! Comprehensive linter settings.

The configuration includes:

  • Important govet checks like fieldalignment
  • Recommended revive rules for code quality
  • Additional rules for boolean expressions and logical constants

41-63: LGTM! Well-chosen set of linters.

The linter selection is comprehensive and includes critical checks for:

  • Code correctness (errcheck, govet, staticcheck)
  • Code quality (gofmt, goimports, revive)
  • Performance (prealloc, copyloopvar)
Makefile (1)

18-19: LGTM! Tool versions are compatible with Go 1.22.

The updates to golangci-lint (v1.63.4) and revive (v1.4) versions are appropriate for Go 1.22 support.

Let's verify the compatibility of these tool versions:

✅ Verification successful

✅ Tool versions are compatible with Go 1.22

  • golangci-lint v1.63.4 has explicit Go 1.22 support based on GitHub issues
  • revive v1.4.0 (correct tag format) supports Go 1.22 as it's a recent release (Sept 2024) with Go 1.21+ compatibility
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify tool version compatibility with Go 1.22

# Check golangci-lint version compatibility
echo "Checking golangci-lint v1.63.4 release notes for Go 1.22 compatibility..."
gh api repos/golangci/golangci-lint/releases/tags/v1.63.4 --jq .body

# Check revive version compatibility
echo "Checking revive v1.4 release notes for Go 1.22 compatibility..."
gh api repos/mgechev/revive/releases/tags/v1.4 --jq .body

Length of output: 1029


Script:

#!/bin/bash
# Check golangci-lint Go version support
echo "Checking golangci-lint Go version support..."
rg -A 5 "go1\.22" --type yaml --type go

# List revive releases to find correct version format
echo -e "\nListing revive releases..."
gh api repos/mgechev/revive/releases --jq '.[0:5] | .[] | {tag_name: .tag_name, created_at: .created_at}'

# Check revive Go version requirements
echo -e "\nChecking revive Go version requirements..."
fd -e go -e yaml -e mod . -X rg -l "go1\.22|go 1\.22"

Length of output: 794


Script:

#!/bin/bash
# Check go.mod contents
echo "Checking go.mod contents..."
cat go.mod
cat pkg/respond/go.mod

# Check revive v1.4.0 release notes
echo -e "\nChecking revive v1.4.0 release notes..."
gh api repos/mgechev/revive/releases/tags/v1.4.0 --jq .body

# Check golangci-lint go.mod
echo -e "\nChecking golangci-lint go.mod..."
rg -p "^go 1\." .github/

Length of output: 3079


Script:

#!/bin/bash
# Check golangci-lint repository for Go 1.22 support
echo "Checking golangci-lint v1.63.4 Go version support..."
gh api repos/golangci/golangci-lint/contents/go.mod?ref=v1.63.4 --jq '.content' | base64 -d

# Check golangci-lint CI workflow for Go versions
echo -e "\nChecking golangci-lint CI configuration..."
gh api repos/golangci/golangci-lint/contents/.github/workflows/ci.yml?ref=v1.63.4 --jq '.content' | base64 -d | rg "go-version"

Length of output: 631


Script:

#!/bin/bash
# Check golangci-lint docs and discussions for Go 1.22 support
echo "Checking golangci-lint issues and discussions..."
gh api search/issues --jq '.items[].title' -X GET -f q="repo:golangci/golangci-lint is:issue go1.22 in:title,body"

# Check golangci-lint README
echo -e "\nChecking golangci-lint README..."
gh api repos/golangci/golangci-lint/readme --jq '.content' | tr -d '\n' | grep -o 'supported.*Go.*versions'

Length of output: 1219


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. (Beta)
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@karasz karasz requested a review from amery January 14, 2025 10:10
@amery
Copy link
Contributor

amery commented Jan 14, 2025

as the bot suggested, we might want to revisit the list of linters and disable instead of enable. but that's out of the scope of this PR.
@karasz

@amery amery merged commit 6f7d80d into main Jan 14, 2025
10 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