Skip to content

✨ 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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joelanford
Copy link
Member

Veeeeeerrrrrrrrrry rough around the edges PR that gets a graphql handler added to the catalogd server (behind a feature gate). Not really happy at all yet with the library refactoring that adds the Indexer and Index types. But for now it at least gets the job done for this prototype.

The idea here is that when we store an FBC, we build up a graphql schema dynamically based on the content of the FBC. 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:

make run-experimental
kubectl port-forward -n olmv1-system service/catalogd-service 8443:443

And then open https://localhost:8443/catalogs/operatorhubio/api/v1/graphql

And here's are some interesting queries to run:

Bundle search metadata

{
  olmBundle {
    package
    name
    properties(type: "olm.csv.metadata") {
      value(jq:".annotations | [to_entries[] | select(.key | test(\"features|valid-subscription|description|capabilities|categories\"))] | from_entries")
    }
  }
}

What OLMv1 operator-controller actually needs for resolution:

{
  olmChannel {
    package
    name
    entries {
      name
      replaces
      skips
      skipRange
    }
  }
  olmBundle {
    package
    name
    image
  }
}

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 17, 2025
Copy link

netlify bot commented Jul 17, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit f0f601d
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/687b1c484967640008839bcd
😎 Deploy Preview https://deploy-preview-2109--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

openshift-ci bot commented Jul 17, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tmshort for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant