Fix 1504200: Add ping validation feature to glean_parser#15
Conversation
Dexterp37
left a comment
There was a problem hiding this comment.
The idea looks great, thanks for tackling this. I think that we should not have multiple source of truth, wrt the schema. Let's have it only in one place. If it's already out of sync, let's update the main schema.
| @@ -0,0 +1,424 @@ | |||
| { | |||
There was a problem hiding this comment.
I think I have strong feelings about this, given that I messed up quite a few time Desktop Telemetry due to out of sync dependencies (that I forgot to update :) ).
What about we keep this generic, drop the schema off this repo, pass in a path to the schema when invoking the command?
|
|
||
|
|
||
| def test_validate_ping(): | ||
| content = { |
There was a problem hiding this comment.
If we're moving the schema off this repo, let's keep this shorter: let's use a small JSON and provide a sample schema stub.
Dexterp37
left a comment
There was a problem hiding this comment.
The idea looks great, thanks for tackling this. I think that we should not have multiple source of truth, wrt the schema. Let's have it only in one place. If it's already out of sync, let's update the main schema.
|
With respect to managing the schema:
|
|
I've updated this to allow the end user to specify the schema URL. It is cached, unless it's pointing to master which is a moving target and probably shouldn't be cached. Thanks for another round of review, @Dexterp37 |
7be1ec8 to
1b35fb2
Compare
1b35fb2 to
89bc5dc
Compare
This adds a feature to glean_parser to validate pings. It's basically a straightforward use of the
jsonschemalibrary that the backend uses to do that.I've just copied the ping schema into this repo rather than doing anything fancy like fetching it from a URL because:
mozilla-pipeline-schemas. At least until things settle down we probably want to be more nimble and have the ability to put what we need to in here.We definitely can and should revisit that later.