-
Notifications
You must be signed in to change notification settings - Fork 93
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
feat: rover supergraph fetch
#485
Conversation
0159bf2
to
d06f739
Compare
d06f739
to
07565df
Compare
I've updated the top-level comment with the latest changes to use the |
i also ran into something strange where the |
For future reference, from slack:
|
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.
This looks good to me!
I added #499 to address querying errors, so it can be done outside of this PR.
When schema_tag is null and we detect that the variant they passed is valid, we return this error
I am into the showing the latest composition error here. Something to think about is that our errors currently do not show any additional output aside form error
, suggestion
. So we will have to think about how to append additional output from a visual and logical perspective. But I think that's also something that can be done outside of this PR, so we don't block merging this in for too long.
@@ -18,6 +18,7 @@ use crate::utils::table::{self, cell, row}; | |||
#[derive(Clone, PartialEq, Debug)] | |||
pub enum RoverStdout { | |||
DocsList(HashMap<&'static str, &'static str>), | |||
SupergraphSdl(String), |
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.
Definitely a nit, feel free to disregard 😄 I wonder if we'd be fine using the SDL variant here?
Or better yet, I know we have a lot of variants that just print a string with a label above it. Maybe we could instead use a LabeledString(String, String)
variant or something to make everything consistent and to keep us from having to print_descriptor
and print_content
over and over again.
If we ever did something like syntax highlighting SDL in terminal outputs, I could imagine having more specific variants like SDL
be useful, but I'm not seeing much usefulness out of breaking them up into multiple variants rihgt now
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.
mmmm, i'd like to keep this as is for now since they do have a separate descriptor - can we handle a refactor like this in a separate issue/PR combo?
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.
Totally, just a passing thought!
so the composition errors that could be returned here could be quite long and span multiple lines, it might look something like this as a first pass:
thoughts? |
rover supergraph fetch
@EverlastingBugstopper I am happy with wording/output. My own nit is on the layout: what do you think about giving it a new line in between each composition error, sort of like we have when we run
|
Sure! That seems fine to me - we print out composition errors in |
I made it so the composition errors would look like they do everywhere else in the CLI as a first pass - if we decide we want the new lines added I figure we can change that all at once as a part of solving #508 |
Co-authored-by: Irina Shestak <shestak.irina@gmail.com>
77af1a4
to
160ab1e
Compare
fixes #452
ran into some pretty interesting edge cases that I think are handled pretty well, with test cases to cover them.
the happy path will just return the latest successful composed
supergraphSDL
. we also do the usual detection for propergraph@variant
combinations.When
schema_tag
is null, and the variant they passed is valid, it means there has been no successful composition for this supergraph quite yet, so we return the latest composition error.If both
compositionPublish
andmostRecentCompositionPublish
arenull
, and the graph@variant exists, I figured it was safe to assume that users were attempting to runsupergraph fetch
on a non-federated graph. This might be a semi-reliable way to extend our other queries to check if they are runningsupergraph
orsubgraph
commands on non-federated graphs as part of #121. Unless of course this is an invalid assumption on my part which should be addressed before merging this.