Support Pioneer pipeline + merging ideas from pioneer-utils#263
Conversation
mythmon
left a comment
There was a problem hiding this comment.
This seems pretty straight forward to me. I'd like to hear from Rehan as well though.
| baseUrls: [ | ||
| "https://qsurvey.mozilla.com/s3/Shield-Study-Example-Survey/?reason=ineligible", | ||
| ], | ||
| const publicApiTests = function(studyType) { |
There was a problem hiding this comment.
Why is this const publicApiTests = function(...) instead of function publicApiTests(...)?
There was a problem hiding this comment.
Arbitrary. Changing to conform to the style of the rest of the script
| }); | ||
|
|
||
| describe("PUBLIC API `browser.study` (studyType: pioneer)", function() { | ||
| publicApiTests.bind(this)("pioneer"); |
There was a problem hiding this comment.
I usually see this written as publicApiTests.call(this, "pioneer"). I don't have any reason to prefer one or the other though.
|
|
||
| parameters: [] | ||
|
|
||
| - name: getInternalTestingOverrides |
There was a problem hiding this comment.
Not really relevant to this review, but why is there both a Yaml and JSON version of the schema? That seems like a duplication risk.
There was a problem hiding this comment.
The JSON is generated from YAML. We found it faster to iterate (less verbose, multi-line comments) in YAML.
| return studyUtils._internals; | ||
| }, | ||
|
|
||
| getInternalTestingOverrides: async function getInternalTestingOverrides() { |
There was a problem hiding this comment.
The formatting of this seems inconsistent. Why not async getInternalTestingOverrides() {?
There was a problem hiding this comment.
similar issue above with getDataPermissions
There was a problem hiding this comment.
Originally all function declarations were generated based on the schema YAML in a consistent manner. I believe prettier causes the observed inconsistencies based on the length of the function names.
rehandalal
left a comment
There was a problem hiding this comment.
I did a pass over this. There's a lot to take it but it generally looks fine to me.
| return studyUtils._internals; | ||
| }, | ||
|
|
||
| getInternalTestingOverrides: async function getInternalTestingOverrides() { |
There was a problem hiding this comment.
similar issue above with getDataPermissions
cf783ac to
ed3f17a
Compare
d673ae7 to
99b242c
Compare
5d08c1b to
d625caf
Compare
|
Good news - the packets using shield schemas in pioneer telemetry are now being parsed correctly in the pipeline: mozilla-services/mozilla-pipeline-schemas#199 (comment) |
|
@gregglind This PR is now ready for review and merge. The code has been verified to work in https://github.com/motin/jestr-pioneer-shield-study and the pings have been verified to end up in the correct final destination for Pioneer studies. |
…ing stub class for pioneer
…g pioneer-utils as a dependency
…ility in getStudySetup
…eer opt-in add-on (necessary for the test add-on to pass eligibility checks when tested as a pioneer study)
…ly tracking all pings sent using study utils
…lso in the eyes of the schema guard
704910d to
e367173
Compare
This PR incorporates relevant parts from pioneer-utils v1.0.10 into shield-studies-addon-utils, making the former repository/code obsolete.
A Pioneer study will thus only need to integrate shield-studies-addon-utils and supply
studyType: "pioneer"instead ofstudyType: "shield"in their configuration. To test this code in an existing add-on:npm install --save motin/shield-studies-addon-utils#issues-142-and-128-support-pioneer-pipelineNote: In the current implementation, Pioneer studies exhibit the same behavior (including life-cycle telemetry) as ordinary Shield studies. The only difference is that all study telemetry payloads are encrypted.
The browser.study.* API is hereby augmented with the
browser.study.getDataPermissions()method, returning the current dataPermissions (shield enabled true/false, pioneer enabled true/false). Note: This is a lighter variant of the data permission related features referenced in #177 (comment)Fixes #142 (Support different data pipelines)
Fixes #128 (Merge ideas from Pioneer Utils)
Fixes mozilla/pioneer-utils#25 (Request to merge / unfork: Shield-Studies-Addon-Utils)
Fixes mozilla/pioneer-utils#13 (Unit tests)
Fixes mozilla/pioneer-utils#7 (Set up CI)
Fixes mozilla/pioneer-utils#40 (Async/await for endStudy and submitEventPing)
Fixes mozilla/pioneer-utils#41 (Add EVENTS.INSTALLED)