-
Notifications
You must be signed in to change notification settings - Fork 66
✨ prototyping dynamic graphql handler for catalogd #2109
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
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
f0f601d
to
c4cdc70
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2109 +/- ##
==========================================
- Coverage 73.48% 70.00% -3.49%
==========================================
Files 78 94 +16
Lines 7240 8090 +850
==========================================
+ Hits 5320 5663 +343
- Misses 1568 2045 +477
- Partials 352 382 +30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
c4cdc70
to
2dd3ca4
Compare
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.
Pull Request Overview
This PR introduces a prototype GraphQL handler for catalogd, enabling dynamic GraphQL API generation based on FBC content. The implementation refactors the existing storage and HTTP handlers to decouple storage and serving concerns into separate packages.
- Adds GraphQL handler with dynamic schema generation from FBC content
- Refactors storage layer into modular components (files, indices, GraphQL schemas)
- Replaces monolithic HTTP handler with composable middleware-based handlers
Reviewed Changes
Copilot reviewed 37 out of 38 changed files in this pull request and generated 10 comments.
Show a summary per file
File | Description |
---|---|
manifests/experimental*.yaml | Enable APIV1GraphQLHandler feature gate |
internal/catalogd/storage/storage.go | Refactored storage interface with modular instances |
internal/catalogd/storage/graphql.go | New GraphQL schema storage component |
internal/catalogd/handler/api/v1/*.go | New modular API v1 handlers (all, metas, graphql) |
internal/catalogd/handler/middleware/*.go | HTTP middleware components (logging, metrics, gzip) |
cmd/catalogd/main.go | Updated main to use new modular architecture |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR adds a graphql handler to the catalogd server (behind a feature gate). In order to add the graphql handler, I decided to refactor the storage and http handlers to decouple the storage and serving aspects into separate packages.
The idea with the GraphQL storage is that when we store an FBC, we build up a graphql schema dynamically based on the content of the FBC. The GraphQL handler the uses the stored (in memory) schemas for each catalog and serves a GraphQL API for them. The result being that catalogd is still a "dumb pipe" for FBC data. The GraphQL API is directly derived from the FBC API (or at least the parts of the FBC API that are in use somewhere in the served FBC).
To play with it, I've enabled the GraphQL explorer handler, so you can:
And then open https://localhost:8443/catalogs/operatorhubio/api/v1/graphql
And here's are some interesting queries to run:
Bundle search metadata
What OLMv1 operator-controller actually needs for resolution:
Reviewer Checklist