-
Notifications
You must be signed in to change notification settings - Fork 2
Adds expressions to headers propagation #453
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
Conversation
Summary of ChangesHello @kamilkisiela, 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 significantly enhances the router's header manipulation capabilities by introducing support for dynamic header values derived from VRL (Vector Remap Language) expressions. This allows for highly flexible and powerful header generation, where values can be computed based on various contextual information such as client request details, GraphQL operation specifics, and subgraph response headers. The change involves integrating the Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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 introduces a powerful new feature for header manipulation using VRL expressions. The implementation is well-structured, but there are a few critical issues that could lead to panics due to unhandled errors when resolving VRL expressions. Additionally, there are some incomplete sections marked with TODO
that need to be addressed to fully realize the feature, a bug in default port detection for URLs, and some opportunities for performance and documentation improvements. My review provides specific feedback on these points.
("name".into(), details.operation.name.clone().into()), | ||
("type".into(), details.operation.kind.into()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The operation
object in the VRL context is missing the query
field, even though OperationDetails
contains it. To provide complete information to VRL expressions, you should also include the query
string.
("name".into(), details.operation.name.clone().into()), | |
("type".into(), details.operation.kind.into()), | |
("name".into(), details.operation.name.clone().into()), | |
("type".into(), details.operation.kind.into()), | |
("query".into(), details.operation.query.into()), |
✅
|
🐋 This PR was built and pushed to the following Docker images: Image Names: Platforms: Image Tags: Docker metadata{
"buildx.build.ref": "builder-0c067d5b-9522-4ce7-86e0-d544eda133f6/builder-0c067d5b-9522-4ce7-86e0-d544eda133f60/hyfuq2izgtns03hdq9r125f8f",
"containerimage.descriptor": {
"mediaType": "application/vnd.oci.image.index.v1+json",
"digest": "sha256:31f171af6f5692ac0e1c767eb0a9c8e2501a0185f8793875b219e237ccbae86c",
"size": 1609
},
"containerimage.digest": "sha256:31f171af6f5692ac0e1c767eb0a9c8e2501a0185f8793875b219e237ccbae86c",
"image.name": "ghcr.io/graphql-hive/router:pr-453,ghcr.io/graphql-hive/router:sha-c4f5781"
} |
To hold the VRL functions. This should improve performance.
/gemini review |
There was a problem hiding this 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 introduces a significant new feature allowing the use of VRL expressions for dynamic header generation. The implementation is extensive, touching on configuration, compilation, and execution logic. A major part of the change is also a commendable refactoring of error handling to use Result
propagation throughout the execution plan, which greatly improves robustness. My review focuses on a few areas for improvement: completing a TODO
to pass the full query context to expressions, enhancing the VRL value conversion to handle complex types, and adding the necessary documentation for this powerful new feature.
No description provided.