-
Notifications
You must be signed in to change notification settings - Fork 94
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): rover subgraph check #110
Conversation
4bc76e6
to
07a786f
Compare
b128a40
to
257dec6
Compare
8a97553
to
842abe1
Compare
eaea7f7
to
5dfe6d7
Compare
5dc2409
to
e84b7cb
Compare
6a0be20
to
9a27a30
Compare
9a27a30
to
da9dcab
Compare
da9dcab
to
5e11eec
Compare
46d2fff
to
d9f22e8
Compare
d9f22e8
to
aaa9990
Compare
let mut num_failures = 0; | ||
for error in composition_errors { | ||
num_failures += 1; | ||
tracing::error!("{}", &error.message); |
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.
as a potential future improvement, we could make a table of these errors similar to checks. Composition errors should always be in the format [Service] Type.field? -> Message
so maybe we could parse out into two columns like location
and message
. But this is fine for 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.
yeah, the way it prints it is as so:
ERROR [films] Person -> A @key directive specifies a field which is not found in this service. Add a field to this type with @external.
ERROR [films] Person -> A @key selects iddd, but Person.iddd could not be found
ERROR [films] Person -> extends from people but specifies an invalid @key directive. Valid @key directives are specified by the originating type. Available @key directives for this type are:
@key(fields: "id")
Error: Encountered 3 composition errors while composing the subgraph
i think if we wanted to print it like a table we'd want to have that data returned in separate fields by the API rather than trying to parse out these strings.
7a51820
to
878946e
Compare
62af115
to
97ed282
Compare
97ed282
to
48b45c6
Compare
rover subgraph check
ready to go. it pretty much copies exactly what the existing CLI does.run the checks, print composition errors if they exist.
if no composition errors, iterate over check results and print a formatted table to
stderr
. if there are failures, count them and return an error so the CLI exits with a non-zero exit code.user testing here for folks familiar with checks would be super great :)