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

graph fetch and graph publish round trip is not a clean round trip #469

Closed
EverlastingBugstopper opened this issue Apr 26, 2021 · 1 comment · Fixed by #475
Closed

graph fetch and graph publish round trip is not a clean round trip #469

EverlastingBugstopper opened this issue Apr 26, 2021 · 1 comment · Fixed by #475
Labels

Comments

@EverlastingBugstopper
Copy link
Contributor

EverlastingBugstopper commented Apr 26, 2021

If you attempt to rover graph publish an identical schema to the registry, this is the output:

$ rover graph publish averys-graph --schema ./schema.graphql
Publishing SDL to cher@current using credentials from the default profile.
averys-graph@current#11630a Published successfully [No Changes]
Schema Hash: 
11630a

However, if you attempt a full circle fetch and subsequent publish, this is the output:

$ rover graph fetch averys-graph > ./schema.graphql
Fetching SDL from cher@current using credentials from the default profile.
$ rover graph publish averys-graph --schema ./schema.graphql
Publishing SDL to cher@current using credentials from the default profile.
averys-graph@current#11630a Published successfully [Fields: +0 -0 △0, Types: +0 -0 △0]
Schema Hash: 
11630a

It would seem to me that this should be a clean operation, and the output of the publish should be Published successfully [No Changes]


Observing the file, after each one of these round trips, the schema file extends by one new line. This did not happen in 0.0.9, and is a regression introduced by this PR. It seems like a hard line to walk since we definitely want newlines appended to the end if we're in the terminal, but it seems like we wouldn't want to append that same newline for redirecting to a file. Perhaps we need something akin to print_descriptor that is print_content that does atty::is checks for us?

@EverlastingBugstopper EverlastingBugstopper added bug 🐞 triage issues and PRs that need to be triaged labels Apr 26, 2021
@EverlastingBugstopper
Copy link
Contributor Author

Confirmed that if I change the println to a print it will look bad in shells, but it won't append that extra newline to the schema file itself!

@abernix abernix removed the triage issues and PRs that need to be triaged label Jun 15, 2022
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.

2 participants