mozilla / shield-studies-addon-utils

Mozilla Public License 2.0
6 stars 21 forks source link

Support Pioneer pipeline + merging ideas from pioneer-utils #263

Closed motin closed 5 years ago

motin commented 6 years ago

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 of studyType: "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-pipeline

Note: 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 https://github.com/mozilla/shield-studies-addon-utils/issues/177#issuecomment-391129721

Fixes #142 (Support different data pipelines) Fixes #128 (Merge ideas from Pioneer Utils) Fixes https://github.com/mozilla/pioneer-utils/issues/25 (Request to merge / unfork: Shield-Studies-Addon-Utils) Fixes https://github.com/mozilla/pioneer-utils/issues/13 (Unit tests) Fixes https://github.com/mozilla/pioneer-utils/issues/7 (Set up CI) Fixes https://github.com/mozilla/pioneer-utils/issues/40 (Async/await for endStudy and submitEventPing) Fixes https://github.com/mozilla/pioneer-utils/issues/41 (Add EVENTS.INSTALLED)

motin commented 5 years ago

Good news - the packets using shield schemas in pioneer telemetry are now being parsed correctly in the pipeline: https://github.com/mozilla-services/mozilla-pipeline-schemas/issues/199#issuecomment-435114227

motin commented 5 years ago

@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.