Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughA new "Request Headers" plugin has been introduced to the oRPC server framework. This includes a plugin implementation, documentation, test suite, and updates to the documentation sidebar and plugin exports. The plugin injects a standardized Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Server
participant RequestHeadersPlugin
participant Handler
Client->>Server: Sends HTTP request with headers
Server->>RequestHeadersPlugin: Processes request context
RequestHeadersPlugin->>RequestHeadersPlugin: Injects reqHeaders into context
RequestHeadersPlugin->>Handler: Passes enriched context
Handler->>Handler: Accesses reqHeaders from context
Handler-->>Client: Returns response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🧰 Additional context used🧬 Code Graph Analysis (1)apps/content/docs/plugins/request-headers.md (1)
⏰ 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). (3)
🔇 Additional comments (12)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Summary of Changes
Hello @unnoq, 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 delivers a new RequestHeadersPlugin for the oRPC server, designed to streamline the process of accessing HTTP request headers within server-side logic. By integrating this plugin, developers can easily retrieve and utilize incoming headers from the context object, enhancing the flexibility and functionality of their oRPC procedures. The changes include the core plugin implementation, its exposure through the main plugins index, a new comprehensive documentation page, and a suite of unit tests to ensure reliability.
Highlights
- New Feature: Request Headers Plugin: Introduces a new
RequestHeadersPluginfor the oRPC server, enabling easy access to incoming request headers within the oRPC context. - Context Injection: The plugin automatically injects a
Headersobject containing all request headers into thecontext.reqHeadersproperty for procedures and interceptors. - Comprehensive Documentation: Adds a new documentation page (
request-headers.md) explaining the plugin's purpose, how to set up context, and how to configure handlers to use it. - Robust Testing: Includes dedicated unit tests to verify the plugin's functionality, ensuring headers are correctly captured, context is handled safely (cloning), and pre-existing
reqHeadersare respected.
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 or fill out our survey to provide feedback.
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
-
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 ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
More templates
@orpc/arktype
@orpc/client
@orpc/contract
@orpc/experimental-durable-event-iterator
@orpc/hey-api
@orpc/json-schema
@orpc/nest
@orpc/openapi
@orpc/openapi-client
@orpc/react
@orpc/react-query
@orpc/server
@orpc/shared
@orpc/solid-query
@orpc/standard-server
@orpc/standard-server-aws-lambda
@orpc/standard-server-fetch
@orpc/standard-server-node
@orpc/standard-server-peer
@orpc/svelte-query
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/vue-colada
@orpc/vue-query
@orpc/zod
commit: |
There was a problem hiding this comment.
Code Review
This pull request introduces a new RequestHeadersPlugin for the server. This is a great addition for standardizing header access across different parts of an application.
The implementation is clean, concise, and follows good practices by ensuring context immutability. The accompanying tests are thorough, covering the core functionality, context cloning behavior, and the case where headers are already present in the context. The documentation is also clear and provides helpful examples for users.
Overall, this is a high-quality contribution with no outstanding issues. Well done!
|
Hi @unnoq , this request plugin will be available in Thanks and sorry for bothering you. |
It will available in next version, You can use |
Summary by CodeRabbit
New Features
Tests