Skip to content

Conversation

@ReneWerner87
Copy link
Member

@ReneWerner87 ReneWerner87 commented Oct 17, 2025

Summary

  • update the test matrix to run against Go 1.25 across supported platforms
  • bump the go.mod directive and README usage notes to reference Go 1.25
  • switch the go tidy automation to install Go 1.25

Testing

  • go test ./... (fails: Go 1.25 toolchain not yet available in CI environment)

https://chatgpt.com/codex/tasks/task_e_68f2405aa3788326b7d39afa93ceca81

Summary by CodeRabbit

  • Documentation

    • Updated README for Fiber v3 and Go 1.25+ with revised installation, usage, and Swagger v2 examples; added explicit swag init step.
  • Chores

    • Migrated project to Fiber v3 and Swagger v2 paths; updated middleware usage and default routing behavior accordingly.
    • Minor .gitignore comment added.
  • Tests

    • Updated tests to robustly parse and validate Content-Type headers.

@gemini-code-assist
Copy link

Summary of Changes

Hello @ReneWerner87, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on upgrading the project's core dependencies to align with the latest versions of Go (1.25) and the Fiber web framework (v3). This update ensures compatibility with newer language features and framework improvements, while also updating the module's own versioning to v2.

Highlights

  • Go Version Upgrade: The project's Go version requirement has been updated from 1.18 to 1.25, affecting go.mod and documentation.
  • Fiber Framework Update: The dependency on the Fiber web framework has been upgraded from v2 to v3, necessitating changes in imports and API usage.
  • Swagger Module Versioning: The module itself has been updated to v2 in go.mod and its usage in the README.md example.
  • Dependency Alignment: Various indirect dependencies in go.mod and go.sum have been updated to align with the new Go and Fiber versions.
  • Codebase Adaptations: The swagger.go and swagger_test.go files have been modified to reflect API changes in Fiber v3, including middleware and context handling.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/gotidy.yml
    • .github/workflows/test.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Oct 17, 2025

Warning

Rate limit exceeded

@ReneWerner87 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 31 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between bd065ec and 3e35e82.

📒 Files selected for processing (1)
  • swagger.go (2 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Migrated module to Fiber v3 and updated documentation for Go 1.25+. Reworked Swagger static serving to use Fiber v3 static middleware, changed handler signatures (pointer → value), adjusted redirect and config handling, and updated tests to parse Content-Type with mime.ParseMediaType. Minor .gitignore comment added.

Changes

Cohort / File(s) Summary
Repo config
\.gitignore
Added a comment line "# Keep vendored dependencies out of version control" above the existing vendor/ ignore entry (annotation-only change).
Documentation
README\.md
Updated target Fiber version to v3 and Go requirement to 1.25+; revised installation and example import paths to github.com/gofiber/swagger/v2 and github.com/gofiber/fiber/v3; added explicit swag init step and aligned examples with Fiber v3/Swagger v2.
Core Swagger integration
swagger\.go
Replaced filesystem-based serving with Fiber v3 static.New() middleware and utils v2 usage; introduced lazy basePrefix (sync.Once) and composed prefixes including forwarded prefixes; created cfgCopy to avoid mutating original config and use it for rendering and ReadDoc; changed redirect usage to fluent API (Redirect().Status(...).To(...)); updated handler signature usage from *fiber.Ctx to fiber.Ctx for getForwardedPrefix.
Tests
swagger_test\.go
Updated imports to Fiber v3 and added mime; changed Content-Type assertions to parse using mime.ParseMediaType, handle parse errors, and compare parsed media type to expected value rather than raw header strings.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant App as Fiber v3 App
    participant Static as Static Middleware
    participant Handler as Swagger Handler
    participant Docs as Swagger UI/Docs

    Client->>App: GET /swagger/* or /swagger
    App->>Static: route to static middleware
    Static->>Static: attempt to locate static asset
    alt Asset found
        Static-->>Client: 200 Serve asset (js/css/index.html)
    else Asset not found
        Static->>Handler: forward request
        Handler->>Handler: compute basePrefix (sync.Once)
        Handler->>Handler: get forwarded prefix (value param)
        Handler->>Handler: prepare cfgCopy and doc path
        Handler-->>Client: Redirect().Status(...).To(...) or render index using cfgCopy
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Potential areas needing extra attention:

  • swagger.go changes around prefix computation (sync.Once), cfgCopy usage, and ReadDoc wiring.
  • Handler signature changes from pointer to value and all call sites.
  • Redirect fluent API correctness and status code choices.
  • Tests' Content-Type parsing and compatibility with various responses.

Poem

🐰 I hopped through code from v2 to v3,
Swapped files and routes beneath the old tree.
A prefix tucked in with sync.Once rhyme,
Docs and redirects now dance in time.
Go 1.25—what a hoppin' climb! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The pull request title "chore: align workflows with Go 1.25" is partially related to the changeset but appears to miss the primary technical change. While the PR does include Go 1.25 updates reflected in the README and other files, the actual changeset includes substantial code migration from Fiber v2 to Fiber v3 across swagger.go (marked as high review effort), swagger_test.go (marked as medium review effort), and README updates. The PR is also labeled with "BreakingChange," indicating significant API-level modifications. The title focuses narrowly on "workflows" and "Go 1.25" but does not capture this major Fiber v3 migration, which appears to be the primary technical change. A teammate scanning the commit history based on this title would not understand the scope and significance of the breaking changes being introduced. Consider updating the PR title to better reflect the primary change. A title like "chore: migrate to Fiber v3 and Go 1.25" or "chore: upgrade Fiber v2 to v3 and Go 1.25" would more accurately convey the breaking changes and main effort involved in this PR, helping reviewers and future developers understand the scope and significance of the changes at a glance.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the project to be compatible with Go 1.25 and Fiber v3. The changes include updating the Go version directive, module dependencies, and adapting the code to the new APIs in Fiber v3. The documentation in README.md has also been updated to reflect these changes. The changes are well-executed and necessary for the upgrade. I have one minor suggestion regarding code formatting in the README.md file for consistency.

Copy link

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
swagger_test.go (1)

108-114: Better Content-Type assertion. Also close response bodies.

Parsing media type is correct. Add resp.Body.Close() to avoid descriptor leaks in long-running test suites.

Apply near the response creation:

-            resp, err := app.Test(req)
+            resp, err := app.Test(req)
             if err != nil {
                 t.Fatal(err)
             }
+            t.Cleanup(func() { if resp != nil && resp.Body != nil { _ = resp.Body.Close() } })
README.md (2)

11-11: Go 1.25 requirement noted. Add CI/toolchain hint for reliability.

Consider mentioning GOTOOLCHAIN=auto (Go 1.21+) so developers and CI auto-fetch 1.25 even if the runner image lags.

Example:

  • export GOTOOLCHAIN=auto
  • Or use actions/setup-go with go-version-file and check-latest: true

19-21: Command block clarity.

Since Go 1.17+, prefer go install for tools; keep go get solely for adding library deps.

Clarify:

  • go install github.com/swaggo/swag/cmd/swag@latest (tool)
  • go get github.com/gofiber/swagger/v2 (library)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ced278 and 4cf51a6.

⛔ Files ignored due to path filters (4)
  • .github/workflows/gotidy.yml is excluded by !**/*.yml
  • .github/workflows/test.yml is excluded by !**/*.yml
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (4)
  • .gitignore (1 hunks)
  • README.md (3 hunks)
  • swagger.go (4 hunks)
  • swagger_test.go (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: ReneWerner87
PR: gofiber/fiber#3161
File: app.go:923-932
Timestamp: 2024-11-15T07:56:21.623Z
Learning: In the Fiber framework, breaking changes are acceptable when moving from version 2 to version 3, including modifications to method signatures such as in the `Test` method in `app.go`.
Learnt from: grivera64
PR: gofiber/fiber#3807
File: adapter_test.go:118-144
Timestamp: 2025-10-16T07:15:26.529Z
Learning: In Fiber v3, net/http handlers (http.Handler, http.HandlerFunc, or raw func(http.ResponseWriter, *http.Request)) can be passed directly to routing methods like app.Get(), app.Post(), etc. The framework automatically detects and wraps them internally via toFiberHandler/collectHandlers. The github.com/gofiber/fiber/v3/middleware/adaptor package is legacy and should not be suggested for tests or code using native net/http handler support.
📚 Learning: 2024-11-15T07:56:21.623Z
Learnt from: ReneWerner87
PR: gofiber/fiber#3161
File: app.go:923-932
Timestamp: 2024-11-15T07:56:21.623Z
Learning: In the Fiber framework, breaking changes are acceptable when moving from version 2 to version 3, including modifications to method signatures such as in the `Test` method in `app.go`.

Applied to files:

  • swagger.go
📚 Learning: 2025-10-16T07:15:26.529Z
Learnt from: grivera64
PR: gofiber/fiber#3807
File: adapter_test.go:118-144
Timestamp: 2025-10-16T07:15:26.529Z
Learning: In Fiber v3, net/http handlers (http.Handler, http.HandlerFunc, or raw func(http.ResponseWriter, *http.Request)) can be passed directly to routing methods like app.Get(), app.Post(), etc. The framework automatically detects and wraps them internally via toFiberHandler/collectHandlers. The github.com/gofiber/fiber/v3/middleware/adaptor package is legacy and should not be suggested for tests or code using native net/http handler support.

Applied to files:

  • swagger.go
🔇 Additional comments (9)
.gitignore (1)

15-15: Comment-only addition looks good.

Helpful clarification above vendor/. No functional impact.

swagger_test.go (2)

4-4: Robust header parsing dependency added.

Adding mime is appropriate for Content-Type normalization in tests.


9-9: No changes required—app.Test() calls conform to Fiber v3 signature.

Both invocations at lines 97 and 148 correctly pass only the required *http.Request parameter. The optional config ...TestConfig parameter is not needed here and correctly omitted.

README.md (3)

28-28: Module import path is correct.

Library major version v2 path aligns with current releases; Fiber is v3. No conflict.


33-34: Import snippet aligns with the module path.

Matches the get command; consistent for users copy-pasting.


42-44: Example targets Fiber v3 correctly.

Imports look right (swagger v2 + fiber v3).

swagger.go (3)

10-13: Imports updated for Fiber v3 and static FS.

Correct packages for v3 (fiber, static, utils v2).


70-70: Redirect API usage looks good.

Fluent Redirect().Status(...).To(...) matches v3 style.


77-99: Original code correctly assumes GetReqHeaders() returns map[string][]string; review comment's core concern is unfounded.

GetReqHeaders() returns map[string][]string, confirming the original implementation correctly iterates header values as a slice. The proposed simplification using c.Get() with CSV splitting would change behavior (single concatenated header vs. multiple header instances per HTTP spec), not fix an API misunderstanding.

Likely an incorrect or invalid review comment.

@ReneWerner87 ReneWerner87 merged commit 30bc194 into main Oct 31, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants