-
Notifications
You must be signed in to change notification settings - Fork 85
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
Create/Delete graph variants using Rover CLI #722
Comments
Hey @AndreyIlyunin - we're doing some thinking around graph provisioning w/Rover as it's something we've wanted internally as well (see #453) I've created some preliminary flowcharts for two possible commands The two flowcharts are here and should be public, if you have any feedback on them (good or bad!) please do let me know 😄 we imagine the flow in CI looking very similar to what you have proposed here:
|
@AndreyIlyunin if this is a common use case, one possible optimization re: (3) above:
what about something like this instead? subgraphs:
films:
routing_url: https://films.example.com
schema:
file: ./films.graphql
people:
routing_url: https://people.example.com
schema:
file: ./people.graphql this would also clear up confusion around having to the use also we could probably add an option to
|
Actually, this is what we are looking for. Thanks! Just to clarify, as it seems a bit tricky from the comments around the new variant creation flow, $ rover create graph@staging-1 --account-id my-account
$ rover subgraph publish graph@staging-1 --schema.graphql it will work for us. What about And I've mentioned that you propose to extend the Anyway, we need an option to handle this programmatically, so both options are great. |
Yep. The single command is the most attractive format for working with variants from the CI. |
I'm not against the other proposed options here but I like the way that They are small and intuitive building blocks! |
I think the best way forward here is going to be to create the |
@EverlastingBugstopper I support that. In the future step, I suspect we may want to have first-class support in some of the APIs for doing this more atomically within a single larger command (if we don't have that today?), but I still believe that comes as a subsequent step. @prasek Are you okay with this as an initial stone-paving step? |
I think there are maybe a few issues we'll need to address as part of this approach:
I think after some thought and investigation that what I've proposed here will still be the cleanest method moving forward, but we'll need to:
|
The history of a variant created this way may be kinda janky. If |
yeah this was something I had considered but thought it might be fine if Apollo's
This is also somewhat strange, especially since graphs themselves can contain multiple federated variants and multiple unfederated variants. Ideally you'd be able to
I'd say no to this one, likely should start out These concerns do seem to highlight some unfortunate realities. I really would like to provide some way for users to create/delete graph variants, but it just seems so coupled to the Studio front end it makes it quite difficult to reason about from a CLI. Would love to hear if anybody has any workarounds/a way we can provide this functionality today as there is a very real need for this! Unfortunately I think that my initial judgment here is that the investigative work we've done here can give some context towards the design of the new graph registry API, but that we should maybe hold off on this until these concerns can be addressed properly. |
It depends on how long it will take for graph create/delete commands to be available -- if it turns out to be a blocking issue for a while, and we could otherwise implement |
@prasek: Reading the above, I'm understanding that @EverlastingBugstopper already followed up on the approach you quoted, noting its faults: I believe at this point we're at the point of needing API changes to proceed. I don't think those API changes for |
After thinking about this a bit more, I have a new proposal that should be a bit less work for us and doesn't require Gravity to make any changes.
This should unblock folks for now and make it a bit easier to work w/the registry in CI pipelines that need to create and destroy per-branch variants. In the future, should we want to separate publish and create semantics, we can still move forward with that by disallowing creation on |
Creating and deleting graph variants using Rover CLI
Ability to manage graph variants using Rover CLI:
This will helps users to move to the managed schemas totally.
And the ability to use Rover CLI subgraph publish features for any environment in the same manner.
For example, the use-case of mine:
My team generating a staging environment per feature.
Our flow is: create a new branch, code it, create new staging env using this branch (that is production-like, with a self subdomain, DBs, and services), merge to master, destroy staging env. (I believe it is not a unique flow)
Our production is using managed schema features,
but we are required to use
serviceList
andexperimental_pollInterval
just because there is no way to create and destroy graph variants via CI for dynamically created staging envs.Currently it is only available through the UI, but this adds to much routines and mistakes-leaky as for humans nature:
So we need to have this in Rover CLI: create a new variant by name, publish its subgraphs (this one is already here, thnx), delete this variant when it comes obsolete.
Please let me know what do you think about it!
Thanks.
The text was updated successfully, but these errors were encountered: