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

🧹 v3 (chore): Bump minimum version of Go to 1.21 #2911

Merged
merged 1 commit into from
Mar 10, 2024
Merged

🧹 v3 (chore): Bump minimum version of Go to 1.21 #2911

merged 1 commit into from
Mar 10, 2024

Conversation

gaby
Copy link
Member

@gaby gaby commented Mar 10, 2024

Description

Bump the minimum Go version to 1.21. Remove support for go1.20 which is End of Life since last month as noted here: https://endoflife.date/go

Changes introduced

List the new features or adjustments introduced in this pull request. Provide details on benchmarks, documentation updates, changelog entries, and if applicable, the migration guide.

  • Benchmarks: Describe any performance benchmarks and improvements related to the changes.
  • Documentation Update: Detail the updates made to the documentation and links to the changed files.
  • Changelog/What's New: Include a summary of the additions for the upcoming release notes.
  • Migration Guide: If necessary, provide a guide or steps for users to migrate their existing code to accommodate these changes.
  • API Alignment with Express: Explain how the changes align with the Express API.
  • API Longevity: Discuss the steps taken to ensure that the new or updated APIs are consistent and not prone to breaking changes.
  • Examples: Provide examples demonstrating the new features or changes in action.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Enhancement (improvement to existing features and functionality)
  • Documentation update (changes to documentation)
  • Performance improvement (non-breaking change which improves efficiency)
  • Code consistency (non-breaking change which improves code reliability and robustness)

Summary by CodeRabbit

  • Documentation
    • Updated compatibility information in README files across multiple languages to reflect the supported Go versions for the Fiber library, now indicating Go 1.21-1.22.
  • Chores
    • Updated GitHub Actions workflows to use Go version "1.21.x".
  • Refactor
    • Replaced a custom function with strings.CutPrefix in the pprof middleware to align with Go 1.20 standards.

@gaby gaby requested a review from a team as a code owner March 10, 2024 02:52
@gaby gaby requested review from sixcolors, ReneWerner87 and efectn and removed request for a team March 10, 2024 02:52
Copy link
Contributor

coderabbitai bot commented Mar 10, 2024

Walkthrough

The updates across various files primarily focus on enhancing compatibility and code quality. This includes adjusting the Go version compatibility for the Fiber library, refining GitHub Actions workflows to use a more current Go version, and optimizing code by replacing custom functions with standard library functions in accordance with Go 1.20 standards. These changes collectively aim to improve the project's efficiency and maintainability.

Changes

Files Summary
.github/README.md, .github/README_*.md Updated Fiber's compatibility with Go versions to 1.21-1.22 due to usage of unsafe.
.github/workflows/... Updated Go version in GitHub Actions workflows to "1.21.x".
middleware/pprof/pprof.go Replaced custom cutPrefix function with strings.CutPrefix for Go 1.20 compatibility.

Related issues

  • 🐛 [Bug]: Enable go-require for testify-lint #2891: The updates to the GitHub Actions workflows and code optimizations may indirectly support the objectives of ensuring compliance with updated guidelines and improving test reliability, which are part of the issue's objectives. However, direct linkage to the go-require rule or specific failing tests mentioned is not apparent.

Poem

🐇 Oh, in the world of code so vast,
🌿 Fiber's updates are here at last.
With Go versions, we now comply,
And on GitHub Actions, we rely.
📚 From custom funcs, we've taken leave,
For Go's own strings, we now believe.
🎉 To improvements, let us hop,
With every line, we do not stop.

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>.
    • Generate unit-tests 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 tests 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0379cc5 and 3a0fc6c.
Files ignored due to path filters (1)
  • go.mod is excluded by: !**/*.mod
Files selected for processing (10)
  • .github/README.md (3 hunks)
  • .github/README_az.md (1 hunks)
  • .github/README_es.md (1 hunks)
  • .github/README_tr.md (1 hunks)
  • .github/README_zh-CN.md (1 hunks)
  • .github/README_zh-TW.md (1 hunks)
  • .github/workflows/benchmark.yml (1 hunks)
  • .github/workflows/linter.yml (1 hunks)
  • .github/workflows/test.yml (1 hunks)
  • middleware/pprof/pprof.go (2 hunks)
Files skipped from review due to trivial changes (2)
  • .github/workflows/linter.yml
  • .github/workflows/test.yml
Additional comments: 12
.github/workflows/benchmark.yml (1)
  • 28-28: The update of the Go version from "1.20.x" to "1.21.x" in the GitHub Actions workflow is aligned with the PR's objective to bump the minimum Go version. This change ensures that the benchmark workflow uses the latest supported Go version, adhering to best practices for security and compatibility. Ensure that all other CI/CD workflows in the project are similarly updated to maintain consistency across the development environment.
middleware/pprof/pprof.go (1)
  • 43-43: Replacing the custom cutPrefix function with strings.CutPrefix from Go's standard library is a good practice that simplifies the code and leverages standard library features. This change aligns with the PR's objective to update the codebase for Go 1.21 compatibility. Ensure thorough testing is conducted to verify that the new implementation behaves as expected, especially in edge cases that the custom function might have handled differently.
.github/README_zh-CN.md (1)
  • 169-170: The documentation correctly highlights the limitations related to the use of unsafe features and the incompatibility with net/http interfaces. This is important for users to understand the constraints and make informed decisions when using Fiber.
.github/README_zh-TW.md (1)
  • 176-176: The documentation correctly updates the Go version compatibility from 1.20-1.22 to 1.21-1.22. However, it's important to ensure that all references to Go versions throughout the project's documentation, code comments, and configuration files are consistent with this change to avoid confusion.

Please verify that all mentions of Go versions across the project align with this update.

.github/README_es.md (1)
  • 163-163: The compatibility information update is clear and directly addresses the change in supported Go versions from 1.20-1.22 to 1.21-1.22. This change is essential for users to understand the current support and compatibility of the Fiber library with Go versions.
.github/README_tr.md (1)
  • 163-164: The update to mention Fiber's testing with Go 1.21 and 1.22, as well as the compatibility issues due to Fiber's unsafe usage, is clear and informative. It's crucial to ensure that the translation accurately conveys these points to Turkish-speaking users.
.github/README.md (4)
  • 139-139: The Go version requirement is updated to 1.21. This is a crucial update for users and developers to ensure compatibility with the project's dependencies and features that leverage Go 1.21 enhancements.
  • 173-173: It's mentioned that Fiber uses unsafe, which may affect compatibility with future Go versions. This is an important note for developers considering long-term maintenance and compatibility.
  • 174-174: The note about Fiber not being compatible with net/http interfaces is significant. It directly impacts developers who might consider integrating Fiber with projects or libraries that rely on the standard Go net/http package. This limitation should be clearly understood to avoid integration issues.
  • 654-656: The external middleware section links to repositories like contrib, storage, and template. It's good to see these resources being made available, as they can significantly enhance the functionality and flexibility of Fiber applications. However, it's essential for developers to review these middleware for security and performance implications in their specific use cases.
.github/README_az.md (2)
  • 167-167: The update to specify Fiber's compatibility with Go 1.21 and 1.22 is clear and aligns with the PR objectives. This change helps ensure users are aware of the supported Go versions for Fiber 3.0.0.
  • 167-168: The limitations section provides valuable information regarding Fiber's reliance on unsafe principles and its incompatibility with net/http interfaces. This transparency is beneficial for users to understand potential limitations when using Fiber with certain Go projects or libraries. It's important to ensure that such limitations are communicated clearly to prevent any confusion or issues during development.

Comment on lines 166 to 172
以及在互联网上的所有诉求,为了创建一个能让有着任何技术栈的开发者都能在 deadline 前完成任务的**迅速**,**灵活**以及**友好**的 `Go web` 框架,就像 `Express` 在 `JavaScript` 世界中一样。

## ⚠️ 限制
* 由于 Fiber 使用了 unsafe 特性,导致其可能与最新的 Go 版本不兼容。Fiber 3.0.0 已经在 Go 1.20 到 1.22 上测试过。
* 由于 Fiber 使用了 unsafe 特性,导致其可能与最新的 Go 版本不兼容。Fiber 3.0.0 已经在 Go 1.21 到 1.22 上测试过。
* Fiber 与 net/http 接口不兼容。也就是说你无法直接使用例如 gqlen,go-swagger 或者任何其他属于 net/http 生态的项目。

## 👀 示例
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [104-104]

There's an extra space before the closing parenthesis in the Markdown link. This might not affect the rendering on all platforms, but it's cleaner to remove unnecessary spaces for consistency.

- 服务</b>,使<b>快速</b>开发更加简便。 </p>
+ 服务</b>,使<b>快速</b>开发更加简便。</p>

Copy link

codecov bot commented Mar 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.52%. Comparing base (0379cc5) to head (3a0fc6c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2911      +/-   ##
==========================================
- Coverage   82.53%   82.52%   -0.01%     
==========================================
  Files         116      116              
  Lines        8337     8333       -4     
==========================================
- Hits         6881     6877       -4     
  Misses       1111     1111              
  Partials      345      345              
Flag Coverage Δ
unittests 82.52% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@efectn efectn added this to the v3 milestone Mar 10, 2024
@efectn efectn merged commit 3216879 into main Mar 10, 2024
15 of 16 checks passed
@efectn efectn deleted the goversion branch March 10, 2024 07:47
grivera64 pushed a commit to grivera64/fiber that referenced this pull request Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants