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

schema-reporting: Check whether overrideReportedSchema is parsable/valid #4492

Conversation

sachindshinde
Copy link
Contributor

The Apollo API has recently changed such that reportServerInfo will now return error for schemas that don't parse or validate.

This PR changes apollo-engine-reporting to check in the EngineReportingAgent constructor whether override schemas successfully parse and validate, so that we may return early before talking to the Apollo API.

@sachindshinde sachindshinde changed the title schema-reporting: schema-reporting: Check whether overrideReportedSchema is parsable/valid Aug 18, 2020
@sachindshinde sachindshinde requested a review from jsegaran August 18, 2020 20:49
@sachindshinde sachindshinde force-pushed the sachin/parse-and-validate-override-schema-in-schema-reporting branch from b2f6560 to 5a60140 Compare August 18, 2020 20:57
Copy link
Contributor

@jsegaran jsegaran left a 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. We probably want to make a minor version bump for this, and a changelog.

@sachindshinde sachindshinde force-pushed the sachin/parse-and-validate-override-schema-in-schema-reporting branch from 5a60140 to 4100986 Compare September 1, 2020 18:01
@sachindshinde sachindshinde changed the base branch from main to release-2.18.0 September 1, 2020 18:40
@sachindshinde sachindshinde force-pushed the sachin/parse-and-validate-override-schema-in-schema-reporting branch from 61ad418 to 9061ed1 Compare September 1, 2020 18:43
@sachindshinde sachindshinde merged commit 11357f2 into release-2.18.0 Sep 1, 2020
@zionts zionts deleted the sachin/parse-and-validate-override-schema-in-schema-reporting branch September 1, 2020 22:50
@trevor-scheer trevor-scheer added this to the Release 2.18.0 milestone Sep 2, 2020
@trevor-scheer trevor-scheer added 📡 schema-reporting 🧮 usage-reporting ⛲️ feature New addition or enhancement to existing solutions and removed 🧮 usage-reporting labels Sep 2, 2020
@trevor-scheer
Copy link
Member

@sachindshinde would you please add tests to cover this new option when you get the chance? If you can't (that's ok!) please open an issue that references this PR. Thank you 😄

@sachindshinde
Copy link
Contributor Author

@trevor-scheer I talked to David, when his large PR for apollo-engine-reporting lands it won't immediately have these changes, so it'll be removed from the codebase shortly (which is fine, since this PR was really just an optimization and wasn't motivated by any specific customer's need). But we intend to add these changes back to the new code after it lands (and when we do, we'll definitely add some tests then 🙂).

glasser added a commit that referenced this pull request Sep 18, 2020
The Apollo API has recently changed such that `reportServerInfo` will now return
error for schemas that don't parse or validate.

This PR changes `apollo-engine-reporting` to check in the `EngineReportingAgent`
constructor whether override schemas successfully parse and validate, so that we
may return early before talking to the Apollo API.

(Originally #4492 by @sachindshinde, merged directly into release-2.18.0;
because the main change being released with v2.18 is #4453 which entirely
replaced the file which that PR changed, this is being reconstructed as part of
PR #4453.)
@glasser
Copy link
Member

glasser commented Sep 18, 2020

Incorporated this change into #4453. I did not add the tests though; @sachindshinde, can you do so? (#4453 should merge into release-2.18.0 shortly.)

@glasser glasser mentioned this pull request Sep 18, 2020
glasser added a commit that referenced this pull request Sep 18, 2020
The Apollo API has recently changed such that `reportServerInfo` will now return
error for schemas that don't parse or validate.

This PR changes `apollo-engine-reporting` to check in the `EngineReportingAgent`
constructor whether override schemas successfully parse and validate, so that we
may return early before talking to the Apollo API.

(Originally #4492 by @sachindshinde, merged directly into release-2.18.0;
because the main change being released with v2.18 is #4453 which entirely
replaced the file which that PR changed, this is being reconstructed as part of
PR #4453.)
@sachindshinde
Copy link
Contributor Author

@glasser Yep, I can add tests in a new PR 🙂

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⛲️ feature New addition or enhancement to existing solutions 📡 schema-reporting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants