Skip to content

feat: upgrade to Fiber v3#440

Merged
CybotTM merged 2 commits intomainfrom
feat/fiber-v3-upgrade
Feb 5, 2026
Merged

feat: upgrade to Fiber v3#440
CybotTM merged 2 commits intomainfrom
feat/fiber-v3-upgrade

Conversation

@CybotTM
Copy link
Member

@CybotTM CybotTM commented Feb 5, 2026

Summary

Upgrades the web framework from Fiber v2 to Fiber v3.

Changes

  • Update imports from fiber/v2 to fiber/v3
  • Change handler signatures from *fiber.Ctx to fiber.Ctx (interface, not pointer)
  • Update body parser: c.BodyParser()c.Bind().Body()
  • Migrate filesystem middleware to static middleware
  • Use helmet from fiber/v3/middleware/helmet (now bundled)
  • Alias internal static package as webstatic to avoid naming conflict

Breaking Changes Handled

v2 v3
*fiber.Ctx fiber.Ctx (interface)
c.BodyParser(&body) c.Bind().Body(&body)
filesystem.New() static.New()
helmet/v2 fiber/v3/middleware/helmet

Test Plan

  • All existing tests pass
  • Build succeeds
  • Manual testing of password change flow
  • Manual testing of password reset flow (if enabled)

Related

Copilot AI review requested due to automatic review settings February 5, 2026 08:23
@gemini-code-assist
Copy link

Summary of Changes

Hello @CybotTM, 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 focuses on a significant technical upgrade, migrating the application's web framework from Fiber v2 to Fiber v3. This transition involves adapting to several breaking changes introduced in the new Fiber version, such as modifications to how request contexts are handled, changes in body parsing methods, and updates to middleware usage. The primary goal is to ensure the application remains compatible with the latest framework advancements, benefiting from performance enhancements and modern API design, while preserving all existing functionalities.

Highlights

  • Fiber Framework Upgrade: The web framework has been upgraded from Fiber v2 to Fiber v3, incorporating the latest features and improvements.
  • Context Handling Changes: Handler signatures have been updated across the application to use fiber.Ctx (interface) instead of *fiber.Ctx (pointer), aligning with Fiber v3's new API.
  • Body Parser Migration: The body parsing mechanism has been updated from c.BodyParser() to c.Bind().Body() to match the Fiber v3 API.
  • Middleware Updates: The filesystem middleware for serving static files has been replaced with the new static middleware, and the helmet middleware is now imported directly from fiber/v3/middleware/helmet as it's bundled within Fiber v3.
  • Dependency Management: The go.mod and go.sum files have been updated to reflect the new Fiber v3 dependencies, including the removal of old v2 related modules and the addition of new indirect dependencies.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • go.mod
    • Updated the main Fiber dependency from github.com/gofiber/fiber/v2 to github.com/gofiber/fiber/v3.
    • Removed github.com/gofiber/helmet/v2 as it's now integrated within Fiber v3's middleware.
    • Cleaned up various indirect dependencies no longer required by Fiber v3 (e.g., clipperhouse/stringish, savsgio/dictpool).
    • Added new indirect dependencies required by Fiber v3 (e.g., github.com/gofiber/schema, github.com/gofiber/utils/v2).
  • go.sum
    • Updated checksums to align with the changes made in go.mod, reflecting the new and removed dependencies.
  • internal/rpc/handler.go
    • Updated the Fiber import path from fiber/v2 to fiber/v3.
    • Modified all function signatures that accept a Fiber context to use fiber.Ctx instead of *fiber.Ctx.
    • Changed the body parsing logic from c.BodyParser(&body) to c.Bind().Body(&body).
  • internal/rpc/ip_extraction.go
    • Updated the Fiber import path from fiber/v2 to fiber/v3.
    • Modified the extractClientIP function signature to use fiber.Ctx instead of *fiber.Ctx.
  • internal/rpc/ip_extraction_internal_test.go
    • Updated the Fiber import path from fiber/v2 to fiber/v3.
  • main.go
    • Updated Fiber and middleware import paths to fiber/v3 versions.
    • Replaced github.com/gofiber/fiber/v2/middleware/filesystem with github.com/gofiber/fiber/v3/middleware/static for serving static assets.
    • Aliased the internal static package as webstatic to prevent naming conflicts with the new fiber/v3/middleware/static.
    • Modified route handler function signatures to use fiber.Ctx instead of *fiber.Ctx.
Activity
  • The author, CybotTM, initiated this pull request to upgrade the application's web framework to Fiber v3.
  • The PR description provides a comprehensive list of changes, details on breaking changes handled, and a test plan.
  • The author has proactively engaged with the Fiber ecosystem by reporting and fixing bugs in the fiber migrate tool, which is linked in the PR description.
  • The test plan indicates that all existing tests pass and the build succeeds, with manual testing for password change and reset flows still pending or planned.
  • No human activity (comments, reviews) has been recorded on this pull request yet.
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.

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.70%. Comparing base (a9fd9f7) to head (2cd48ff).
⚠️ Report is 70 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #440      +/-   ##
==========================================
+ Coverage   45.58%   51.70%   +6.12%     
==========================================
  Files          14       14              
  Lines         702      702              
==========================================
+ Hits          320      363      +43     
+ Misses        365      320      -45     
- Partials       17       19       +2     
Flag Coverage Δ
backend 51.70% <100.00%> (+6.12%) ⬆️
unittests 51.70% <100.00%> (+6.12%) ⬆️

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

Files with missing lines Coverage Δ
internal/rpc/handler.go 54.79% <100.00%> (+54.79%) ⬆️
internal/rpc/ip_extraction.go 93.75% <100.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f9ae4b...2cd48ff. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 successfully upgrades the web framework from Fiber v2 to v3. All breaking changes seem to be handled correctly, including the updates to imports, handler signatures (*fiber.Ctx to fiber.Ctx), body parsing (c.BodyParser to c.Bind().Body), and static file serving (filesystem to static middleware). The code modifications are consistent with the official Fiber v3 migration guide. The change is well-executed and I have no further recommendations.

@entelligence-ai-pr-reviews
Copy link

Walkthrough

This PR migrates the project from Fiber v2 to v3, a major version upgrade of the web framework. The migration involves updating all Fiber-related imports and dependencies, modifying handler signatures to pass fiber.Ctx by value instead of by pointer, and updating the body parsing API from BodyParser() to Bind().Body(). The static file serving middleware is replaced from filesystem to static with updated configuration parameters. The helmet middleware is migrated from a separate v2 package to Fiber v3's core middleware. New serialization libraries and Fiber v3 utilities are added while v2-specific dependencies are removed. An import alias is introduced to avoid naming conflicts with the new static middleware.

Changes

File(s) Summary
go.mod Upgraded Fiber framework from v2 to v3, removed v2 dependencies (fiber/v2, helmet/v2, clipperhouse/stringish, clipperhouse/uax29, mattn/go-runewidth, savsgio/dictpool, savsgio/gotils), and added new indirect dependencies (gofiber/schema v1.6.0, gofiber/utils/v2 v2.0.0).
go.sum Updated dependency checksums for Fiber v3 upgrade, added new serialization libraries (fxamacker/cbor v2.9.0, shamaton/msgpack v3.0.0, x448/float16 v0.8.4), removed unused indirect dependencies and v2-specific transitive dependencies.
internal/rpc/handler.go
internal/rpc/ip_extraction.go
Updated Fiber import from v2 to v3, changed all function signatures to accept fiber.Ctx by value instead of by pointer (*fiber.Ctxfiber.Ctx), and updated body parsing from c.BodyParser(&body) to c.Bind().Body(&body).
internal/rpc/ip_extraction_internal_test.go Updated Fiber framework import from v2 to v3 with no changes to test logic.
main.go Migrated Fiber imports from v2 to v3, replaced filesystem middleware with static middleware (updated configuration from Root to FS), moved helmet from separate package to core middleware, updated route handler signatures to use fiber.Ctx instead of *fiber.Ctx, aliased internal static package as webstatic to avoid naming conflicts, and added trailing comma to IdleTimeout comment.

Sequence Diagram

This diagram shows the interactions between components:

sequenceDiagram
    participant Client
    participant Handler
    participant RateLimiter
    participant TokenStore
    participant LDAP

    Client->>Handler: POST JSON-RPC Request
    Note over Handler: Handle(c fiber.Ctx)
    Handler->>Handler: c.Bind().Body(&body)
    Note over Handler: Parse JSON-RPC method

    alt method == "change-password"
        Handler->>Handler: handleChangePassword(c, params, clientIP)
        Handler->>RateLimiter: Check IP rate limit
        RateLimiter-->>Handler: Rate limit status
        Handler->>Handler: changePasswordWithIP(params, clientIP)
        Handler->>LDAP: Authenticate & change password
        LDAP-->>Handler: Success/Error
        Handler->>Handler: sendSuccessResponse(c, data)
        Handler-->>Client: JSON-RPC Success Response

    else method == "request-password-reset"
        Handler->>Handler: handleRequestPasswordReset(c, params, clientIP)
        Handler->>TokenStore: Check if enabled
        Handler->>RateLimiter: Check IP rate limit
        RateLimiter-->>Handler: Rate limit status
        Handler->>Handler: requestPasswordResetWithIP(params, clientIP)
        Handler->>TokenStore: Generate & store reset token
        TokenStore-->>Handler: Token created
        Handler->>Handler: sendSuccessResponse(c, data)
        Handler-->>Client: JSON-RPC Success Response

    else method == "reset-password"
        Handler->>Handler: handleResetPassword(c, params)
        Handler->>TokenStore: Check if enabled
        Handler->>Handler: resetPassword(params)
        Handler->>TokenStore: Validate token
        TokenStore-->>Handler: Token valid
        Handler->>LDAP: Reset password
        LDAP-->>Handler: Success/Error
        Handler->>Handler: sendSuccessResponse(c, data)
        Handler-->>Client: JSON-RPC Success Response
    end

    Note over Handler,Client: Framework: Fiber v3<br/>New API: fiber.Ctx (value type)<br/>New binding: c.Bind().Body()
Loading

🔗 Cross-Repository Impact Analysis

Enable automatic detection of breaking changes across your dependent repositories. → Set up now

Learn more about Cross-Repository Analysis

What It Does

  • Automatically identifies repositories that depend on this code
  • Analyzes potential breaking changes across your entire codebase
  • Provides risk assessment before merging to prevent cross-repo issues

How to Enable

  1. Visit Settings → Code Management
  2. Configure repository dependencies
  3. Future PRs will automatically include cross-repo impact analysis!

Benefits

  • 🛡️ Prevent breaking changes across repositories
  • 🔍 Catch integration issues before they reach production
  • 📊 Better visibility into your multi-repo architecture

▶️AI Code Reviews for VS Code, Cursor, Windsurf
Install the extension

Note for Windsurf Please change the default marketplace provider to the following in the windsurf settings:

Marketplace Extension Gallery Service URL: https://marketplace.visualstudio.com/_apis/public/gallery

Marketplace Gallery Item URL: https://marketplace.visualstudio.com/items

Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts below

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:
    @entelligenceai + *your message*
Example: @entelligenceai Can you suggest improvements for this code?
  • Help the Bot learn by providing feedback on its responses.
    @entelligenceai + *feedback*
Example: @entelligenceai Do not comment on `save_auth` function !

Also you can trigger various commands with the bot by doing
@entelligenceai command

The current supported commands are

  1. config - shows the current config
  2. retrigger_review - retriggers the review

More commands to be added soon.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the Fiber web framework from v2 to v3, a major version update that includes several breaking API changes. The upgrade correctly handles the key breaking changes: handler signatures now use interface-based fiber.Ctx instead of pointer-based *fiber.Ctx, body parsing has changed from BodyParser() to Bind().Body(), the filesystem middleware has been replaced with the static middleware, and the helmet middleware is now bundled with Fiber v3.

Changes:

  • Updated all Fiber imports from fiber/v2 to fiber/v3
  • Changed all handler function signatures from *fiber.Ctx to fiber.Ctx (interface)
  • Updated body parsing from c.BodyParser() to c.Bind().Body()
  • Migrated from filesystem middleware to static middleware with updated configuration
  • Removed external helmet/v2 dependency in favor of bundled fiber/v3/middleware/helmet
  • Aliased internal static package as webstatic to avoid naming conflict with Fiber's static middleware

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
main.go Updated Fiber imports, middleware configuration (static, helmet), and handler signatures to match v3 API
internal/rpc/handler.go Updated handler signatures from *fiber.Ctx to fiber.Ctx and body parser from BodyParser() to Bind().Body()
internal/rpc/ip_extraction.go Updated extractClientIP function signature to use fiber.Ctx interface
internal/rpc/ip_extraction_internal_test.go Updated Fiber import to v3
go.mod Removed v2 dependencies and added v3 with appropriate indirect dependencies
go.sum Cleaned up v2 entries and added v3 checksums, including new dependencies like gofiber/schema and gofiber/utils/v2

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CybotTM CybotTM force-pushed the feat/fiber-v3-upgrade branch from 8082508 to 784af14 Compare February 5, 2026 08:39
- Update imports from fiber/v2 to fiber/v3
- Change handler signatures from *fiber.Ctx to fiber.Ctx (interface)
- Update body parser: c.BodyParser() -> c.Bind().Body()
- Migrate filesystem middleware to static middleware
- Use helmet from fiber/v3/middleware/helmet
- Alias internal static package as webstatic to avoid conflict

Breaking changes handled:
- Handler context is now an interface, not a pointer
- filesystem middleware replaced by static middleware
- BodyParser moved to Bind().Body()

All tests pass.
Add comprehensive tests for handler.go Fiber v3 HTTP layer:
- TestHandle: tests routing for all RPC methods
- TestHandleInvalidJSON: tests body parsing error path
- TestHandleChangePasswordError: tests LDAP error handling
- TestSendSuccessResponse: tests JSON response helper
- TestSendErrorResponse: tests error response helper
- TestHandleWithPasswordResetEnabled: tests reset feature
- TestHandleIPRateLimited: tests IP rate limiting

Also fixes trailing comma in main.go comment (Copilot review).
@CybotTM CybotTM force-pushed the feat/fiber-v3-upgrade branch from 784af14 to 2cd48ff Compare February 5, 2026 08:56
@CybotTM CybotTM merged commit 2d915cd into main Feb 5, 2026
13 of 14 checks passed
@CybotTM CybotTM deleted the feat/fiber-v3-upgrade branch February 5, 2026 08:58
@github-actions github-actions bot added the released:v1.2.0 Released in v1.2.0 label Feb 22, 2026
@github-actions
Copy link
Contributor

Released in v1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released:v1.2.0 Released in v1.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants