Skip to content
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

rover supergraph compose outputs schema in non-deterministic order #422

Closed
prasek opened this issue Apr 6, 2021 · 1 comment · Fixed by #423
Closed

rover supergraph compose outputs schema in non-deterministic order #422

prasek opened this issue Apr 6, 2021 · 1 comment · Fixed by #423
Labels
Milestone

Comments

@prasek
Copy link

prasek commented Apr 6, 2021

Description

Running rover supergraph compose --config ./supergraph.yaml > supergraph.graphql twice against the same inputs results in different outputs, which isn't friendly to version controlling a composed supergraph with git.

For example, when the above command was run on the same inputs, it generated this diff.

Steps to reproduce

Run rover supergraph compose twice against the same inputs and observe different outputs.

Or clone https://github.com/apollographql/supergraph-demo and run make local and see the diff on supergraph.graphql.

Expected result

Running rover supergraph compose twice against the same inputs and should result in the same output.

Actual result

It generated different outputs.

Environment

Run rover info and paste the results here

Rover Info:
Version: 0.0.7
Install Location: /Users/prasek/.rover/bin/rover
OS: Mac OS 11.2.3 [64-bit]
Shell: /bin/zsh

@prasek prasek added the bug 🐞 label Apr 6, 2021
@abernix
Copy link
Member

abernix commented Apr 6, 2021

This seems like it could be an upstream bug. It's probably worth tracking here to ensure it's resolved regardless of where the deficiency lie, but the fix will — I suspect — need to land within composeAndValidate (or more likely, usage of implementation details within composeAndValidate).

lrlna added a commit that referenced this issue Apr 6, 2021
SupergraphConfig was previously stored in a HashMap, the implementation
of which is non-deterministic in Rust. This commit changes it over to a
BTreeMap which ensures correct ordering.

closes #422
@lrlna lrlna added this to the April 13 milestone Apr 6, 2021
@lrlna lrlna closed this as completed in #423 Apr 6, 2021
lrlna added a commit that referenced this issue Apr 6, 2021
SupergraphConfig was previously stored in a HashMap, the implementation
of which is non-deterministic in Rust. This commit changes it over to a
BTreeMap which ensures correct ordering.

closes #422
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants