Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release-v1.0.0' into release
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
Dexterp37 committed Mar 9, 2021
2 parents b1e49c2 + e13e09f commit 951ac16
Show file tree
Hide file tree
Showing 22 changed files with 1,597 additions and 779 deletions.
20 changes: 17 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Unreleased changes

[Full changelog](https://github.com/mozilla-rally/core-addon/compare/v0.10.0...master)
[Full changelog](https://github.com/mozilla-rally/core-addon/compare/v1.0.0...master)

# v1.0.0 (2021-03-09)

[Full changelog](https://github.com/mozilla-rally/core-addon/compare/v0.10.0...v1.0.0)

* [#432](https://github.com/mozilla-rally/rally-core-addon/pull/432): Add additional `target="_blank"` and `rel="noopener noreferrer"` to external links.
* [#434](https://github.com/mozilla-rally/rally-core-addon/pull/434): Change "will" to "may" in the "leave rally" modal copy.
* [#436](https://github.com/mozilla-rally/rally-core-addon/pull/436/): Change wording on demographic survey to "race / ethnicity".
* [#435](https://github.com/mozilla-rally/rally-core-addon/pull/435): Remove waitlist link from non-US add-on splash page.
* [#443](https://github.com/mozilla-rally/rally-core-addon/pull/443): Prepare for release:
* enable data submission;
* change the website URL to `rally.mozilla.org`;
* [#453](https://github.com/mozilla-rally/rally-core-addon/pull/453): Send deletion ID in uninstall URL, to handle deletion pings when add-on is removed directly.


# v0.10.0 (2021-02-19)

Expand All @@ -11,10 +25,10 @@
* [#398](https://github.com/mozilla-rally/rally-core-addon/pull/398): Use shorter name for core add-on, for UI display purposes.
* [#392](https://github.com/mozilla-rally/rally-core-addon/pull/392): Implement the new consent logic to prevent running side-loaded studies.
* [#403](https://github.com/mozilla-rally/rally-core-addon/pull/403): Support opening the Rally control panel from the Rally website through the `open-rally` custom event.
* [#417](https://github.com/mozilla-rally/rally-core-addon/pull/417): Add `rel="noopener noreferrer"` to `a` tags with target="_blank".
* [#417](https://github.com/mozilla-rally/rally-core-addon/pull/417): Add `rel="noopener noreferrer"` to `a` tags with `target="_blank"`.
* [#407](https://github.com/mozilla-rally/rally-core-addon/pull/407): Update the study card background parallax to be a fixed height.
* [#419](https://github.com/mozilla-rally/rally-core-addon/pull/419): Update the "leave rally" and "leave this study" modal copy.
* [#383](https://github.com/mozilla-rally/rally-core-addon/pull/383): Adds IRB consent notice into the Core Add-On.
* [#383](https://github.com/mozilla-rally/rally-core-addon/pull/383): Add IRB consent notice into the Core Add-On.

# v0.9.0 (2021-02-09)

Expand Down
44 changes: 36 additions & 8 deletions core-addon/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const DataCollection = require("./DataCollection.js");

// The path of the embedded resource used to control options.
const OPTIONS_PAGE_PATH = "public/index.html";
// The website to post deletion IDs to.
const OFFBOARD_URL = "https://production.rally.mozilla.org/offboard";
// The static website to send offboarded users to (those with no deletion ID).
const LEAVE_URL = "__BASE_SITE__/leaving-rally";

module.exports = class Core {
/**
Expand Down Expand Up @@ -42,9 +46,27 @@ module.exports = class Core {
this._connectionPort = null;
}

/**
* Set the URL to be opened in a new tab when the core add-on is uninstalled.
*
* After enrollment, a deletion ID will be available to provide to this URL.
* However, if the user uninstalls the core add-on without enrolling first, then
* this will open the offboarding URL without the deletion ID.
*/
async setUninstallURL() {
// set the URL to redirect when a user uninstalls Rally.
const deletionId = await this._storage.getDeletionID();
if (deletionId) {
// if enrolled,include the deletion ID, for deleting data without exposing the Rally ID.
browser.runtime.setUninstallURL(`${OFFBOARD_URL}?id=${deletionId}`);
} else {
browser.runtime.setUninstallURL(LEAVE_URL);
}
}

initialize() {
// set the URL to redirect when a user uninstalls Rally
browser.runtime.setUninstallURL("__BASE_SITE__/leaving-rally");
this.setUninstallURL();

// Whenever the addon icon is clicked, open the control page.
browser.browserAction.onClicked.addListener(this._openControlPanel);
// After installing the addon, make sure to show the control page.
Expand Down Expand Up @@ -367,14 +389,19 @@ module.exports = class Core {
* is complete (does not block on data upload).
*/
async _enroll() {
// Generate a proper random UUID.
const uuid = await browser.firefoxPrivilegedApi.generateUUID();
// Generate a proper random UUID, for Rally and also for the deletion ping.
const rallyId = await browser.firefoxPrivilegedApi.generateUUID();
const deletionId = await browser.firefoxPrivilegedApi.generateUUID();

// Store IDs locally for future use.
await this._storage.setRallyID(rallyId);
await this._storage.setDeletionID(rallyId);

// Store it locally for future use.
await this._storage.setRallyID(uuid);
// Override the uninstall URL to include the rallyID, for deleting data without exposing the Rally ID.
await this.setUninstallURL();

// Finally send the ping.
await this._dataCollection.sendEnrollmentPing(uuid);
await this._dataCollection.sendEnrollmentPing(rallyId, undefined, deletionId);
}

/**
Expand Down Expand Up @@ -470,8 +497,9 @@ module.exports = class Core {
await this._dataCollection.sendDeletionPing(rallyId, studyId);
}

// Clear locally stored ID.
// Clear locally stored IDs.
await this._storage.clearRallyID();
await this._storage.clearDeletionID();

// Clear the list of studies user took part in.
await this._storage.clearActivatedStudies();
Expand Down
21 changes: 13 additions & 8 deletions core-addon/DataCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const CORE_ENCRYPTION_JWK = {

module.exports = class DataCollection {
/**
* Sends an empty ping with the provided info.
* Sends an otherwise-empty ping with the deletion ID other provided info.
*
* @param {String} rallyId
* The id of the Rally platform.
Expand All @@ -26,16 +26,20 @@ module.exports = class DataCollection {
* @param {String} namespace
* The namespace to route the ping. This will define the
* `schemaNamespace` and `studyName` properties of the ping.
* @param {String} deletionId
* It's sent in the ping, if present, to track deletion of user data without exposing the Rally ID.
*/
async _sendEmptyPing(rallyId, payloadType, namespace) {
async _sendPingWithDeletionId(rallyId, payloadType, namespace, deletionId) {
let publicKey;
let keyId;
let payload = {};

if (namespace === "pioneer-core") {
// When routing pings to the "core" environment, we need to use
// the proper encryption key.
keyId = CORE_ENCRYPTION_KEY_ID;
publicKey = CORE_ENCRYPTION_JWK;
payload = { deletionId };
} else {
// When routing empty pings to the environments for the specific
// studies, we can use a bogus key (the payload is empty).
Expand All @@ -59,8 +63,7 @@ module.exports = class DataCollection {
await this.sendPing(
rallyId,
payloadType,
// We expect to send an empty payload.
{},
payload,
namespace,
keyId,
publicKey
Expand All @@ -78,19 +81,21 @@ module.exports = class DataCollection {
* @param {String} [studyAddonid=undefined]
* optional study id. It's sent in the ping, if present, to signal
* that user enroled in the study.
* @param {String} deletionId
* It's sent in the ping, if present, to track deletion of user data without exposing the Rally ID.
*/
async sendEnrollmentPing(rallyId, studyAddonId) {
async sendEnrollmentPing(rallyId, studyAddonId, deletionId) {
// If we were provided with a study id, then this is an enrollment to a study.
// Send the id alongside with the data and change the schema namespace to simplify
// the work on the ingestion pipeline.
if (studyAddonId !== undefined) {
return await this._sendEmptyPing(rallyId, "pioneer-enrollment", studyAddonId);
return await this._sendPingWithDeletionId(rallyId, "pioneer-enrollment", studyAddonId);
}

// Note that the schema namespace directly informs how data is segregated after ingestion.
// If this is an enrollment ping for the pioneer program (in contrast to the enrollment to
// a specific study), use a meta namespace.
return await this._sendEmptyPing(rallyId, "pioneer-enrollment", "pioneer-core");
return await this._sendPingWithDeletionId(rallyId, "pioneer-enrollment", "pioneer-core", deletionId);
}

/**
Expand All @@ -106,7 +111,7 @@ module.exports = class DataCollection {
throw new Error("DataCollection - the deletion-request ping requires a study id");
}

return await this._sendEmptyPing(rallyId, "deletion-request", studyAddonId);
return await this._sendPingWithDeletionId(rallyId, "deletion-request", studyAddonId);
}

/**
Expand Down
12 changes: 12 additions & 0 deletions core-addon/Storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,22 @@ module.exports = class Storage {
return await this.setItem("rallyId", uuid);
}

async getDeletionID() {
return await this.getItem("deletionId");
}

async setDeletionID(uuid) {
return await this.setItem("deletionId", uuid);
}

async clearRallyID() {
return await browser.storage.local.remove("rallyId");
}

async clearDeletionID() {
return await browser.storage.local.remove("deletionId");
}

/**
* Get the provided demographic data.
*
Expand Down
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"author": "Mozilla",
"manifest_version": 2,
"name": "Mozilla Rally",
"version": "0.10.0",
"homepage_url": "https://github.com/mozilla-extensions/pioneer-v2-core-example",
"version": "1.0.0",
"homepage_url": "https://github.com/mozilla-rally/rally-core-addon",

"icons": {
"48": "public/img/rally-favicon.svg",
Expand Down Expand Up @@ -47,7 +47,7 @@

"content_scripts": [
{
"matches": ["https://rally-stage.bespoke.nonprod.dataops.mozgcp.net/*"],
"matches": ["https://rally.mozilla.org/*"],
"js": ["public/addon-build/content-script.js"]
}
],
Expand Down
Loading

1 comment on commit 951ac16

@firefoxci-taskcluster
Copy link

Choose a reason for hiding this comment

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

Uh oh! Looks like an error! Details

Taskcluster-GitHub attempted to create a task for this event with the following scopes:

["assume:repo:github.com/mozilla-rally/rally-core-addon:tag:v1.0.0","queue:route:checks","queue:scheduler-id:taskcluster-github"]

The expansion of these scopes is not sufficient to create the task, leading to the following:

Client ID static/taskcluster/github does not have sufficient scopes and is missing the following scopes:

assume:repo:github.com/mozilla-rally/rally-core-addon:branch:v1.0.0

This request requires the client to satisfy the following scope expression:

{
  "AllOf": [
    "assume:repo:github.com/mozilla-rally/rally-core-addon:branch:v1.0.0",
    "queue:route:checks",
    "queue:route:index.xpi.v2.rally-core-addon.revision.951ac16d42613715b4b98c75a8ba30bf8e23ce31.taskgraph.decision",
    "queue:scheduler-id:xpi-level-1",
    {
      "AnyOf": [
        "queue:create-task:highest:xpi-1/decision",
        "queue:create-task:very-high:xpi-1/decision",
        "queue:create-task:high:xpi-1/decision",
        "queue:create-task:medium:xpi-1/decision",
        "queue:create-task:low:xpi-1/decision",
        "queue:create-task:very-low:xpi-1/decision",
        "queue:create-task:lowest:xpi-1/decision"
      ]
    }
  ]
}

  • method: createTask
  • errorCode: InsufficientScopes
  • statusCode: 403
  • time: 2021-03-09T08:03:54.420Z

Please sign in to comment.