-
Notifications
You must be signed in to change notification settings - Fork 1
draft: planner service over http #349
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
base: main
Are you sure you want to change the base?
Conversation
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.
Summary of Changes
Hello @dotansimha, 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 introduces a significant new capability to the gateway by exposing its GraphQL query planning functionality over HTTP. The primary goal is to allow external systems or debugging tools to interact directly with the gateway's planner, enabling them to retrieve supergraph metadata (version and schema) and, crucially, to request a query plan for any given GraphQL operation. This change modularizes the planner's HTTP interface and enhances the gateway's shared state to support these new endpoints, laying the groundwork for more advanced introspection and integration.
Highlights
- New Planner Service Module: A new Rust module,
planner_service
, has been introduced to encapsulate the logic for exposing the GraphQL query planner over HTTP. - New HTTP Endpoints for Planner: The gateway now exposes three new HTTP endpoints:
/supergraph/version
for retrieving the supergraph's version,/supergraph/schema
for its SDL, and/build-query-plan
for generating a query plan from a given GraphQL operation. - Enhanced Gateway Shared State: The
GatewaySharedState
has been extended to store the supergraph version and its SDL string, making this information readily available to the new HTTP handlers. - Comprehensive Query Plan Generation: The
/build-query-plan
endpoint handles the full lifecycle of a GraphQL operation for planning purposes, including parsing, validation against the consumer schema, normalization, and generating a detailed query plan.
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
-
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. ↩
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 planner service over HTTP, which is a valuable addition for debugging and integration purposes. The implementation is largely well-structured. I've identified a critical issue related to random number generation that would prevent compilation, a redundant Axum layer that can be removed for clarity, and a couple of performance improvements using Arc<String>
to avoid expensive cloning of the schema SDL. My detailed comments are below.
✅
|
🐋 This PR was built and pushed to the following Docker images: Image Names: Platforms: Image Tags: Docker metadata{
"buildx.build.ref": "builder-df6adc43-ee81-4b1a-a783-7a0969fce634/builder-df6adc43-ee81-4b1a-a783-7a0969fce6340/lo4b7vmu8gn840quwgyjg1q1f",
"containerimage.descriptor": {
"mediaType": "application/vnd.oci.image.index.v1+json",
"digest": "sha256:b49c410e5bc25d7728a3d8941a9c67ff6cbe1b0383461ae14703fa6df6d95713",
"size": 1609
},
"containerimage.digest": "sha256:b49c410e5bc25d7728a3d8941a9c67ff6cbe1b0383461ae14703fa6df6d95713",
"image.name": "ghcr.io/graphql-hive/router:pr-349,ghcr.io/graphql-hive/router:sha-28fae1e"
} |
e9864f4
to
a80cb5b
Compare
No description provided.