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

Closes #2989: Add deletion-request ping support for legacy_client_id #2992

Merged
merged 6 commits into from
Jun 26, 2020

Conversation

psymoon
Copy link
Contributor

@psymoon psymoon commented Jun 24, 2020

@psymoon psymoon requested a review from mcomella June 24, 2020 16:14
// Generate markdown docs for the collected metrics.
ext.gleanGenerateMarkdownDocs = true
ext.gleanDocsDirectory = "$rootDir/docs/glean"
apply from: 'https://github.com/mozilla-mobile/android-components/raw/v' + rootProject.ext.moz_components_version + '/components/service/glean/scripts/sdk_generator.gradle'
Copy link

Choose a reason for hiding this comment

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

This is no longer the supported way to use the Glean code generation plugin. See here:

https://mozilla.github.io/glean/book/user/adding-glean-to-your-project.html#adding-new-metrics

Copy link
Contributor Author

@psymoon psymoon Jun 24, 2020

Choose a reason for hiding this comment

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

@mdboom this is using older a-c/glean version (24.0.0), I get the following compilation error:
Plugin with id 'org.mozilla.telemetry.glean-gradle-plugin' not found.

Copy link

Choose a reason for hiding this comment

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

Ok. Be aware that the sdk_generator.gradle script has no way to ensure that it's running the correct version of the Glean generator, so this problem of generating the wrong code could re-occur in the future. If there's any way you could upgrade to a-c 27.0.0 or later, you would have access to the Glean Gradle plugin, which resolves that issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mdboom I think we will address this in #2990.
AFAIK, we are currently lacking QA support for big a-c upgrade. I think it's safer to upgrade a-c version to 24 for deletion-request ping support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mcomella what do you think about this ^?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're only expecting to build one build from this in the next few weeks, I'd think this is probably fine to move forward with this.

@mdboom Do you agree?

@psymoon If mdboom agrees, can you file an issue about "upgrade to a-c 27 and use glean plugin" and talk to athomasmoz to ensure it's at the top of the backlog? It should be the first thing we do before adding more code (or at least validate that it won't break). Ideally, we'll upgrade to the latest version, but if not, we should do that issue.

Copy link

Choose a reason for hiding this comment

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

That makes sense. Thanks for checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed #2993.

@psymoon psymoon force-pushed the ccpa branch 2 times, most recently from df32e3a to 9f14808 Compare June 24, 2020 19:32
@psymoon
Copy link
Contributor Author

psymoon commented Jun 24, 2020

Request for data collection review form

  1. What questions will you answer with this data?

This data will be used to delete legacy telemetry data associated with the id when they opt out of telemetry.

  1. Why does Mozilla need to answer these questions? Are there benefits for users? Do we need this information to address product or business requirements?

This allows us to comply with user privacy regulations.

  1. What alternative methods did you consider to answer these questions? Why were they not sufficient?

Existing legacy telemetry does not currently have the ability to send a deletion request ping and this was the easiest way to get that information

  1. Can current instrumentation answer these questions?

N/A

  1. List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories on the Mozilla wiki.
Measurement Description Data Collection Category Tracking Bug #
Legacy telemetry client id Category 1 Issue 2989
  1. How long will this data be collected?

For the lifetime of the application, owned by the amazon-dev team.

  1. What populations will you measure?
  • All users with telemetry enabled, on release channel.
  1. If this data collection is default on, what is the opt-out mechanism for users?

There is an option in settings to stop sending usage data that will be used as the opt-out mechanism.

  1. Please provide a general description of how you will analyze this data.

This will be analyzed with the normal Glean methods such as GUD and GLAM.

  1. Where do you intend to share the results of your analysis?

Internally with Mozilla, through normal Glean reporting methods.

Copy link
Contributor

@mcomella mcomella left a comment

Choose a reason for hiding this comment

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

I'm not going to be able to finish the review today but here are a few nits I've found.

Copy link
Contributor

@liuche liuche left a comment

Choose a reason for hiding this comment

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

Data Review Form (to be filled by Data Stewards)

  1. Is there or will there be documentation that describes the schema for the ultimate data set in a public, complete, and accurate way?

Yes, this is documented in metrics.md, as well as in the Glean telemetry docs: https://mozilla.github.io/glean/book/user/pings/deletion_request.html

  1. Is there a control mechanism that allows the user to turn the data collection on and off?

This ping will be sent when the user turns off telemetry so that all their telemetry data can be deleted by the server. Any additional telemetry will not be collected after turning data collection off, so yes, data collection can be turned off by the in-app telemetry toggle.

  1. If the request is for permanent data collection, is there someone who will monitor the data over time?

This ping is sent only by the client to request deleting data, so we will not have data from this ping.

  1. Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?

Type 2

  1. Is the data collection request for default-on or default-off?

Default on for telemetry

  1. Does the instrumentation include the addition of any new identifiers (whether anonymous or otherwise; e.g., username, random IDs, etc. See the appendix for more details)?

Sends client id, which is necessary to delete the telemetry data associated with this client

  1. Is the data collection covered by the existing Firefox privacy notice?

Yes

  1. Does there need to be a check-in in the future to determine whether to renew the data? (Yes/No) (If yes, set a todo reminder or file a bug if appropriate)**

No, data deletion request

  1. Does the data collection use a third-party collection tool? If yes, escalate to legal.

No

Copy link
Contributor

@mcomella mcomella left a comment

Choose a reason for hiding this comment

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

lgtm. I verified the fix by launching the app in an emulator, disabling telemetry upload, and verifying the breakpoint I set that enqueues the deletion ping in the Glean library was set. This is the breakpoint I checked:
Screen Shot 2020-06-25 at 15 50 58

I didn't know how to verify the legacy client ID was set so I didn't verify that – I expect QA will have more expertise to do that by validating what hits the server. However, the code looks straightforward so I'm not too concerned.

Thanks psymoon!

@@ -4,6 +4,9 @@

import org.mozilla.gradle.tasks.ValidateAndroidAppReleaseConfiguration

plugins {
id "com.jetbrains.python.envs" version "0.0.26"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? Is this used by the glean script?

Copy link

Choose a reason for hiding this comment

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

@@ -216,6 +224,10 @@ dependencies {
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.10.0'
testImplementation 'com.squareup.okhttp3:mockwebserver:3.10.0'

// For the initial release of Glean 19, we require consumer applications to
// depend on a separate library for unit tests. This will be removed in future releases.
testImplementation "org.mozilla.telemetry:glean-forUnitTests:21.3.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be 24.0.0? Same as ext.moz_components_version?

Copy link

Choose a reason for hiding this comment

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

No, this is correct. This is the version of Glean that ships with a-c 2.4.0.0. This is the gotcha I was talking about that the Glean Gradle plugin solves (handling this mapping automatically). Unfortunately, the Glean Gradle plugin isn't available prior to a-c 27.0.0.

@psymoon psymoon merged commit f2e6895 into mozilla-mobile:master Jun 26, 2020
@mcomella
Copy link
Contributor

I didn't know how to verify the legacy client ID was set so I didn't verify that

I reverified using the glean debug ping viewer and saw a legacy client ID was set. However, I didn't verify it was the same one as on the device – I'm going to assume that is correct.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants