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

[Vega] Improve error message in case of invalid $schema URL #114459

Merged
merged 2 commits into from
Oct 12, 2021

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Oct 11, 2021

Summary

Fixes #113899

This PR wraps the schema parser and provides a better error for the invalid case.

Screenshot 2021-10-11 at 12 15 47

Checklist

Delete any items that are not applicable to this PR.

@dej611 dej611 added release_note:fix Feature:Vega Vega visualizations Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 labels Oct 11, 2021
@dej611 dej611 requested a review from a team as a code owner October 11, 2021 10:31
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors (Team:VisEditors)

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
visTypeVega 1.9MB 1.9MB +197.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works as expected, LGTM - left one nit

schemaVersion: schema.version,
libraryVersion: libVersion,
},
'The URL for the JSON "$schema" is incorrect. Correct the URL, then click Update.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would call it spec "$schema", as it's not necessarily JSON.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the $schema value cannot be anything else than a URL ending with json (source: https://github.com/vega/schema/blob/55615e9ec4d1aeae002799b90dff60aad9f31b19/parser.ts#L5 )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn’t make this connection. Looks good to me then 👍

@dej611 dej611 merged commit ba8abc4 into elastic:master Oct 12, 2021
@dej611 dej611 deleted the fix/113899 branch October 12, 2021 15:01
dej611 added a commit to dej611/kibana that referenced this pull request Oct 13, 2021
…114459)

* 🐛 Catch the schema parser and provide a better error message

* 🌐 Add i18n
dej611 added a commit that referenced this pull request Oct 13, 2021
…#114771)

* 🐛 Catch the schema parser and provide a better error message

* 🌐 Add i18n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Vega Vega visualizations release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Vega] Improve the error when schema is messed up
4 participants