Conversation
There was a problem hiding this comment.
Pull request overview
This PR refines FxA Settings Glean telemetry so set-password and change/create-password flows can be segmented by a new reason extra key, enabling accurate measurement of OTP/passwordless adoption and distinguishing password creation vs change in account settings.
Changes:
- Add
reasonextra_keys tothird_party_auth_set_password.*events (otpvsthird_party_auth) and emit them from the post-verify set-password flow. - Add
reasonextra_key toaccount_pref.change_password_submit(createvschange) and emit it from Settings → Security. - Update the Glean YAML schema and regenerate TypeScript metric bindings; wire the new extra keys through the fxa-settings Glean event bridge.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/fxa-shared/metrics/glean/web/thirdPartyAuthSetPassword.ts | Regenerated event metric bindings to accept reason extra key for view/engage/submit/success. |
| packages/fxa-shared/metrics/glean/web/event.ts | Regenerated file with an import reordering. |
| packages/fxa-shared/metrics/glean/web/accountPref.ts | Regenerated binding for changePasswordSubmit to accept reason extra key. |
| packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml | Adds reason extra_keys for relevant events and updates metric descriptions/bugs list. |
| packages/fxa-settings/src/pages/PostVerify/SetPassword/index.tsx | Emits third_party_auth_set_password view/engage/submit events with reason. |
| packages/fxa-settings/src/pages/PostVerify/SetPassword/container.tsx | Emits third_party_auth_set_password success event with reason. |
| packages/fxa-settings/src/lib/glean/index.ts | Bridges new reason extra keys into recorded Glean event metrics; adds missing third_party_auth_set_password cases. |
| packages/fxa-settings/src/components/Settings/Security/index.tsx | Emits account_pref.change_password_submit with reason (create/change). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - interaction | ||
| extra_keys: | ||
| reason: | ||
| description: Whether the user is creating a password for an OTP/passwordless account ('create') or changing an existing password ('change'). |
Comment on lines
535
to
+538
| case 'account_pref_change_password_submit': | ||
| accountPref.changePasswordSubmit.record(); | ||
| accountPref.changePasswordSubmit.record({ | ||
| reason: gleanPingMetrics?.event?.['reason'] || '', | ||
| }); |
Comment on lines
+727
to
+745
| case 'third_party_auth_set_password_view': | ||
| thirdPartyAuthSetPassword.view.record({ | ||
| reason: gleanPingMetrics?.event?.['reason'] || '', | ||
| }); | ||
| break; | ||
| case 'third_party_auth_set_password_engage': | ||
| thirdPartyAuthSetPassword.engage.record({ | ||
| reason: gleanPingMetrics?.event?.['reason'] || '', | ||
| }); | ||
| break; | ||
| case 'third_party_auth_set_password_submit': | ||
| thirdPartyAuthSetPassword.submit.record({ | ||
| reason: gleanPingMetrics?.event?.['reason'] || '', | ||
| }); | ||
| break; | ||
| case 'third_party_auth_set_password_success': | ||
| thirdPartyAuthSetPassword.success.record(); | ||
| thirdPartyAuthSetPassword.success.record({ | ||
| reason: gleanPingMetrics?.event?.['reason'] || '', | ||
| }); |
| type: event | ||
| description: | | ||
| Click on "Change" on account settings page to change password for account | ||
| Click on "Change" or "Create" on account settings page to change or create password for account |
| /** | ||
| * Click on "Change" on account settings page to change password for account | ||
| * Click on "Change" or "Create" on account settings page to change or create | ||
| * password for account |
Comment on lines
+48
to
+49
| * User successfully set password after authenticating with third party auth or | ||
| * OTP |
StaberindeZA
approved these changes
Apr 21, 2026
Contributor
StaberindeZA
left a comment
There was a problem hiding this comment.
lgtm. Wasn't able to test it, but code looks good.
Because:
- OTP/passwordless users going through the set-password flow were
indistinguishable from third-party-auth users in Glean telemetry,
making OTP adoption impossible to measure.
- change_password_submit did not distinguish between changing an
existing password and creating one for the first time.
- The third_party_auth_set_password view and engage events were
declared in the schema but never fired from code.
This commit:
- Adds reason extra_key to all four third_party_auth_set_password
events ('otp' vs 'third_party_auth'), wires view/engage/submit
in SetPassword/index.tsx, and success in container.tsx. Engage
fires on the first keystroke (not focus) to match the pattern
used by SigninPasswordlessCode.
- Adds reason extra_key to change_password_submit ('change' vs
'create') and emits it from Settings/Security CTA.
- Regenerates the Glean bindings for accountPref.ts,
thirdPartyAuthSetPassword.ts, and event.ts.
- Bridges the new reason extras in fxa-settings/src/lib/glean/index.ts
and adds unit-test coverage for both reason values on all five
affected events in glean/index.test.ts.
- Extends signinPasswordless.spec.ts to assert reason='otp' on all
four set-password events during the Sync OTP flow (attaches a
fresh GleanEventsHelper to the Sync browser page).
- Extends settings/changePassword.spec.ts to assert reason='change'
on account_pref_change_password_submit.
Fixes FXA-13429
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
change_password_submitdid not distinguish between changing an existing password and creating one for the first time.This pull request
reasonextra_key ('change'vs'create') tochange_password_submitand wires it throughSecurity/index.tsx.reasonextra_key ('otp'vs'third_party_auth') to all fourthird_party_auth_set_passwordevents and passes it fromPostVerify/SetPassword/container.tsxandindex.tsx.fxa-shared/metrics/glean/fxa-ui-metrics.yamland regeneratesaccountPref.ts,event.ts, andthirdPartyAuthSetPassword.tsbindings.Issue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-13429
Checklist
Other information
How to test:
third_party_auth_set_passwordGlean events includereason: "otp".