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

For #21009 - New Recently closed tabs telemetry #22588

Merged
merged 2 commits into from
Feb 3, 2022
Merged

For #21009 - New Recently closed tabs telemetry #22588

merged 2 commits into from
Feb 3, 2022

Conversation

Mugurell
Copy link
Contributor

This adds a new recently_closed_tabs category with then events for all user
interactions on the screen.

The already existent events.recently_closed_tabs_opened is still kept for a
bit more time to still have this data available while the new telemetry ride
the trains but can later be removed in favor of this newly added events.

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@Mugurell Mugurell requested review from a team as code owners November 25, 2021 11:14
@Mugurell
Copy link
Contributor Author

Mugurell commented Nov 26, 2021

Request for data collection review form

All questions are mandatory. You must receive review from a data steward peer on your responses to these questions before shipping new data collection.

  1. What questions will you answer with this data?
  • How is the "Recently closed tabs" feature used.
  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 will help us understand usage patterns around history.
  1. What alternative methods did you consider to answer these questions? Why were they not sufficient?
  • There are no other alternatives.

  1. Can current instrumentation answer these questions?
  • No
  1. List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories found on the Mozilla wiki.

    Note that the data steward reviewing your request will characterize your data collection based on the highest (and most sensitive) category.
Measurement Description Data Collection Category Tracking Bug #
opened - User opened the "Recently closed tabs" screen. Category 2 - interaction data #21009
closed - User closed the "Recently closed tabs" screen. Category 2 - interaction data #21009
show_full_history - User tapped "Show full history" to see all history. Category 2 - interaction data #21009
open_tab - User tapped on a tab item to be opened. Category 2 - interaction data #21009
delete_tab - User tapped the delete button of a tab item. Category 2 - interaction data #21009
menu_close - User tapped the close button - "X" to return to the previous screen. Category 2 - interaction data #21009
menu_share - User tapped the share menu option for multi selected tabs. Category 2 - interaction data #21009
menu_delete - User tapped the delete menu option for multi selected tabs. Category 2 - interaction data #21009
menu_open_in_normal_tab - User tapped the "Open in new tab" menu option for multi selected tabs. Category 2 - interaction data #21009
menu_open_in_private_tab - User tapped the "Open in private tab" menu option for multi selected tabs. Category 2 - interaction data #21009
enter_multiselect - User tapped on a tab item to enter multi select mode. Category 2 - interaction data #21009
exit_multiselect - User pressed back or tapped the last selected tab item to exit multiselect. Category 2 - interaction data #21009
  1. Please provide a link to the documentation for this data collection which describes the ultimate data set in a public, complete, and accurate way.
  1. How long will this data be collected? Choose one of the following:
  • For one year from now, until 2023-01-31, with the option to renew at that point.

  1. What populations will you measure?
  • All channels, all locales, all countries

  1. If this data collection is default on, what is the opt-out mechanism for users?
  • Default Glean SDK opt-out mechanism.

  1. Please provide a general description of how you will analyze this data.
  • Glean and Amplitude.

  1. Where do you intend to share the results of your analysis?
  • 
Only on Glean, Amplitude, and with mobile teams.

  1. Is there a third-party tool (i.e. not Telemetry) that you are proposing to use for this data collection?
  • No third-party tools.

@Mugurell Mugurell added needs:data-review PR is awaiting a data review needs:review PRs that need to be reviewed labels Nov 26, 2021
app/metrics.yaml Outdated
- interaction
notification_emails:
- android-probes@mozilla.com
expires: "2022-02-01"
Copy link
Contributor

@rocketsroger rocketsroger Dec 13, 2021

Choose a reason for hiding this comment

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

Are you sure you want to set it in a month and a half?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since "Recently closed tabs" is a section in History I went with using the same expiry date as for some history probes -

fenix/app/metrics.yaml

Lines 2495 to 2527 in b41542d

history:
opened:
type: event
description: |
A user opened the history screen
bugs:
- https://github.com/mozilla-mobile/fenix/issues/2362
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/3940
- https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/20517#pullrequestreview-718069041
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
expires: "2022-02-01"
removed:
type: event
description: |
A user removed a history item
bugs:
- https://github.com/mozilla-mobile/fenix/issues/2362
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/3940
- https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/20517#pullrequestreview-718069041
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
expires: "2022-02-01"
with the idea to have all these renewed at the same time.
Can change to maybe a year from now it it would fit better. Please advise.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. I would suggest going for a year though. I think it's OK not to expire at the same time as other probes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. Updated the expiry date to 2023-01-31.

Copy link
Contributor

@rocketsroger rocketsroger Jan 28, 2022

Choose a reason for hiding this comment

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

Sorry for the late review. Don't forget to update metrics.yml with data-review URL. Thanks,

@rocketsroger
Copy link
Contributor

Request for data collection review form

All questions are mandatory. You must receive review from a data steward peer on your responses to these questions before shipping new data collection.

1. What questions will you answer with this data?


* How is the "Recently closed tabs" feature used.


2. 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 will help us understand usage patterns around history.


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


* There are no other alternatives.


4. Can current instrumentation answer these questions?


* No


5. List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories found on the Mozilla wiki.
   
   Note that the data steward reviewing your request will characterize your data collection based on the highest (and most sensitive) category.

Measurement Description Data Collection Category Tracking Bug #
opened - User opened the "Recently closed tabs" screen. Category 2 - interaction data #21009
closed - User closed the "Recently closed tabs" screen. Category 2 - interaction data #21009
show_full_history - User tapped "Show full history" to see all history. Category 2 - interaction data #21009
open_tab - User tapped on a tab item to be opened. Category 2 - interaction data #21009
delete_tab - User tapped the delete button of a tab item. Category 2 - interaction data #21009
menu_close - User tapped the close button - "X" to return to the previous screen. Category 2 - interaction data #21009
menu_share - User tapped the share menu option for multi selected tabs. Category 2 - interaction data #21009
menu_delete - User tapped the delete menu option for multi selected tabs. Category 2 - interaction data #21009
menu_open_in_normal_tab - User tapped the "Open in new tab" menu option for multi selected tabs. Category 2 - interaction data #21009
menu_open_in_private_tab - User tapped the "Open in private tab" menu option for multi selected tabs. Category 2 - interaction data #21009
enter_multiselect - User tapped on a tab item to enter multi select mode. Category 2 - interaction data #21009
exit_multiselect - User pressed back or tapped the last selected tab item to exit multiselect. Category 2 - interaction data #21009

6. Please provide a link to the documentation for this data collection which describes the ultimate data set in a public, complete, and accurate way.


* [https://dictionary.telemetry.mozilla.org/apps/fenix
  ](https://dictionary.telemetry.mozilla.org/apps/fenix%E2%80%A8)


7. How long will this data be collected? Choose one of the following:


* For one year from now, until 2023-01-31, with the option to renew at that point.


8. What populations will you measure?


* All channels, all locales, all countries


9. If this data collection is default on, what is the opt-out mechanism for users?


* Default Glean SDK opt-out mechanism.


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


* Glean and Amplitude.


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


* Only on Glean, Amplitude, and with mobile teams.


12. Is there a third-party tool (i.e. not Telemetry) that you are proposing to use for this data collection?


* No third-party tools.

Data Review

  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, through the metrics.yaml file and the Glean Dictionary

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

Yes, through the "Send Usage Data" preference in the application settings

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

N/A, collection set to end or be renewed by 2023-01-31

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

Category 2, Interaction data

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

default-on

  1. Does the instrumentation include the addition of any new identifiers?

No

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

Yes

  1. Does the data collection use a third-party collection tool?

No

Result

data-review+

@rocketsroger rocketsroger removed the needs:data-review PR is awaiting a data review label Jan 28, 2022
Copy link
Contributor

@rocketsroger rocketsroger left a comment

Choose a reason for hiding this comment

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

Looks good to me. Please let me know once you've update metrics.yml with the data review URL.

This adds a new `recently_closed_tabs` category with then events for all user
interactions on the screen.

The already existent `events.recently_closed_tabs_opened` is still kept for a
bit more time to still have this data available while the new telemetry ride
the trains but can later be removed in favor of this newly added events.
@Mugurell
Copy link
Contributor Author

Mugurell commented Feb 1, 2022

Looks good to me. Please let me know once you've update metrics.yml with the data review URL.

Did that now.

@Mugurell Mugurell requested a review from rocketsroger February 1, 2022 16:36
@@ -41,6 +43,8 @@ class RecentlyClosedFragment : LibraryPageFragment<RecoverableTab>(), UserIntera
private lateinit var recentlyClosedInteractor: RecentlyClosedFragmentInteractor
private lateinit var recentlyClosedController: RecentlyClosedController

private lateinit var metrics: MetricController
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you still need this? Looks like you can just use requireComponents.analytics.metrics

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are 3 places where this is used in the fragment (two places where we track events, one where we pass the instance). Seems cleaner to use a use a property instead of accessors chains in all places.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure. Just thought that we can save an assignment with directly using it. I'm OK with either.

@@ -41,6 +43,8 @@ class RecentlyClosedFragment : LibraryPageFragment<RecoverableTab>(), UserIntera
private lateinit var recentlyClosedInteractor: RecentlyClosedFragmentInteractor
private lateinit var recentlyClosedController: RecentlyClosedController

private lateinit var metrics: MetricController
Copy link
Contributor

Choose a reason for hiding this comment

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

Sure. Just thought that we can save an assignment with directly using it. I'm OK with either.

@Mugurell Mugurell added pr:needs-landing PRs that are ready to land [Will be merged by Mergify] and removed needs:review PRs that need to be reviewed pr:needs-landing PRs that are ready to land [Will be merged by Mergify] labels Feb 3, 2022
@Mugurell
Copy link
Contributor Author

Mugurell commented Feb 3, 2022

lint was failing because of

[vcs 2022-02-01T16:39:28.685Z] executing ['git', 'clone', 'https://github.com/mozilla-mobile/fenix', '/builds/worker/checkouts/vcs']
[vcs 2022-02-01T16:39:28.687Z] Cloning into '/builds/worker/checkouts/vcs'...
[vcs 2022-02-01T16:39:34.574Z] error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
[vcs 2022-02-01T16:39:34.574Z] fatal: The remote end hung up unexpectedly
[vcs 2022-02-01T16:39:34.574Z] fatal: early EOF
[vcs 2022-02-01T16:39:34.575Z] fatal: index-pack failed

Restarting CI.

@Mugurell Mugurell closed this Feb 3, 2022
@Mugurell Mugurell reopened this Feb 3, 2022
@rocketsroger rocketsroger added the pr:needs-landing PRs that are ready to land [Will be merged by Mergify] label Feb 3, 2022
@mergify mergify bot merged commit 0be470a into mozilla-mobile:main Feb 3, 2022
@Mugurell Mugurell deleted the recentlyClosedTelemetry branch May 26, 2022 07:55
@Mugurell Mugurell mentioned this pull request May 26, 2022
7 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr:needs-landing PRs that are ready to land [Will be merged by Mergify]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants