Skip to content

docs: add RoutePatternMatch documentation#3722

Merged
ReneWerner87 merged 2 commits intomainfrom
codex/2025-08-31-14-13-37
Sep 1, 2025
Merged

docs: add RoutePatternMatch documentation#3722
ReneWerner87 merged 2 commits intomainfrom
codex/2025-08-31-14-13-37

Conversation

@ReneWerner87
Copy link
Member

Summary

  • expand RoutePatternMatch comment to describe pattern syntax and configuration
  • document RoutePatternMatch helper with signature and examples

Testing

  • make audit (fails: lock value copy in generated msgp files)
  • make generate
  • make betteralign
  • make modernize
  • make format
  • make test

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

Copilot AI review requested due to automatic review settings August 31, 2025 14:13
@ReneWerner87 ReneWerner87 requested a review from a team as a code owner August 31, 2025 14:13
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 31, 2025

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

Adds documentation for the public RoutePatternMatch API in docs/guide/utils.md and refines the GoDoc comments for RoutePatternMatch in path.go. No implementation, signature, or runtime behavior changes.

Changes

Cohort / File(s) Summary
Docs: RoutePatternMatch usage
docs/guide/utils.md
Adds a new documentation section describing RoutePatternMatch(path, pattern string, cfg ...Config) bool, supported pattern syntax (parameters, wildcards, optional segments), optional Config flags, and usage examples.
Code comments: RoutePatternMatch
path.go
Updates GoDoc for RoutePatternMatch to clarify it reports whether a path matches a Fiber route pattern, documents supported pattern features and Config effects; implementation and signature unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • gaby
  • sixcolors
  • efectn

Poem

I nibble notes on paths and stars,
Hopping through docs and tiny pars,
Case and slash, optional too,
I match the trail and peek at you.
A rabbit's cheer for lines made true. 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ce11d27 and 8d2b302.

📒 Files selected for processing (1)
  • path.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • path.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: unit (1.25.x, macos-13)
  • GitHub Check: unit (1.25.x, macos-latest)
  • GitHub Check: unit (1.25.x, windows-latest)
  • GitHub Check: repeated
  • GitHub Check: Compare
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/2025-08-31-14-13-37

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
🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

Copy link
Contributor

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 adds comprehensive documentation for the RoutePatternMatch utility function. The changes improve the function's inline documentation and provide user-facing documentation with examples in the utils guide.

  • Expanded the function comment to describe pattern syntax and configuration options
  • Added detailed documentation to the utils guide with signature and usage examples

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
path.go Enhanced inline documentation for RoutePatternMatch function
docs/guide/utils.md Added new section documenting RoutePatternMatch with examples

Copy link
Contributor

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

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 improving the clarity and completeness of the documentation for the RoutePatternMatch utility. The changes aim to make it easier for developers to understand how to use this function, its pattern syntax, and configuration options, both within the code and in the user guide.

Highlights

  • Documentation Expansion: Expanded the documentation for RoutePatternMatch in docs/guide/utils.md to include its purpose, signature, and practical examples of its usage.
  • GoDoc Improvement: Enhanced the GoDoc comment for the RoutePatternMatch function in path.go to provide a more detailed explanation of its pattern syntax, configuration options, and overall utility.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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

Copy link
Contributor

@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 enhances the documentation for the RoutePatternMatch utility function. The function-level comment in path.go has been expanded with more details about pattern syntax and configuration, which is a great improvement. The documentation in docs/guide/utils.md has a new section for RoutePatternMatch, which is also good. I have one suggestion to make the examples in the guide more comprehensive by including wildcards and optional segments, as mentioned in the description.

@codecov
Copy link

codecov bot commented Aug 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.05%. Comparing base (e878cd8) to head (8d2b302).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3722      +/-   ##
==========================================
- Coverage   92.08%   92.05%   -0.03%     
==========================================
  Files         115      115              
  Lines       11535    11535              
==========================================
- Hits        10622    10619       -3     
- Misses        662      664       +2     
- Partials      251      252       +1     
Flag Coverage Δ
unittests 92.05% <ø> (-0.03%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
docs/guide/utils.md (2)

120-126: Clarify defaults and normalization in the description
Briefly call out defaults (CaseSensitive=false, StrictRouting=false) and that patterns are normalized to start with “/”. Keeps docs self-contained and aligned with implementation.

-Checks whether a given path matches a Fiber route pattern. Useful for testing
-patterns without registering them. Patterns may contain parameters, wildcards
-and optional segments. An optional `Config` allows control over case sensitivity
-and strict routing.
+Checks whether a given path matches a Fiber route pattern. Useful for testing
+patterns without registering them. Patterns may contain parameters, wildcards,
+and optional segments. By default CaseSensitive=false and StrictRouting=false.
+Patterns not starting with "/" are normalized to start with "/". An optional
+`Config` allows control over case sensitivity and strict routing.

131-139: Add trailing-slash/StrictRouting example
A quick example prevents confusion around default StrictRouting=false behavior.

 fiber.RoutePatternMatch(
     "/User/john",
     "/user/:name",
     fiber.Config{CaseSensitive: true},
 ) // false
+
+// Trailing slash handling (StrictRouting=false by default)
+fiber.RoutePatternMatch("/user/", "/user")                                    // true
+fiber.RoutePatternMatch("/user/", "/user", fiber.Config{StrictRouting: true}) // false
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e878cd8 and ce11d27.

📒 Files selected for processing (2)
  • docs/guide/utils.md (1 hunks)
  • path.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/**

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Review and update the contents of the docs folder if necessary when modifying code

Files:

  • docs/guide/utils.md
🧠 Learnings (2)
📓 Common learnings
Learnt from: ckoch786
PR: gofiber/fiber#3230
File: docs/whats_new.md:944-951
Timestamp: 2024-12-15T19:56:45.935Z
Learning: Detailed usage examples and explanations for new methods like `RemoveRoute` and `RemoveRouteByName` are documented in `docs/api/app.md`, so it's unnecessary to duplicate them in `docs/whats_new.md`.
📚 Learning: 2024-12-15T19:56:45.935Z
Learnt from: ckoch786
PR: gofiber/fiber#3230
File: docs/whats_new.md:944-951
Timestamp: 2024-12-15T19:56:45.935Z
Learning: Detailed usage examples and explanations for new methods like `RemoveRoute` and `RemoveRouteByName` are documented in `docs/api/app.md`, so it's unnecessary to duplicate them in `docs/whats_new.md`.

Applied to files:

  • docs/guide/utils.md
🪛 GitHub Check: lint
path.go

[failure] 133-133:
behaviour is a misspelling of behavior (misspell)

🪛 GitHub Actions: golangci-lint
path.go

[error] 133-133: golangci-lint: path.go:133:19: behaviour is a misspelling of behavior (misspell)

🪛 LanguageTool
docs/guide/utils.md

[grammar] ~124-~124: There might be a mistake here.
Context: ...ig` allows control over case sensitivity and strict routing. ```go title="Signat...

(QB_NEW_EN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Compare
  • GitHub Check: unit (1.25.x, windows-latest)
  • GitHub Check: unit (1.25.x, macos-13)
  • GitHub Check: repeated

@ReneWerner87 ReneWerner87 added this to v3 Sep 1, 2025
@ReneWerner87 ReneWerner87 added this to the v3 milestone Sep 1, 2025
@ReneWerner87 ReneWerner87 merged commit e83a762 into main Sep 1, 2025
19 of 20 checks passed
@ReneWerner87 ReneWerner87 deleted the codex/2025-08-31-14-13-37 branch September 1, 2025 07:31
@github-project-automation github-project-automation bot moved this to Done in v3 Sep 1, 2025
Abhirup-99 pushed a commit to Abhirup-99/fiber that referenced this pull request Nov 3, 2025
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.

2 participants