Skip to content

feat(auth): send Glean server-deletion-request ping on account deletion - #21436

Open
akkomar wants to merge 1 commit into
mozilla:mainfrom
akkomar:DENG-11729
Open

akkomar wants to merge 1 commit into
mozilla:mainfrom
akkomar:DENG-11729

Conversation

@akkomar

@akkomar akkomar commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Because

  • Data Engineering finds FxA account deletions by parsing auth-server logs (fxa_delete_events), which blocks decommissioning Amplitude logging (FXA-8776)
  • Glean server telemetry now supports a server-deletion-request ping that the pipeline can consume directly (DENG-4079)

This commit

  • Sends account.user_id and account.user_id_sha256 in the built-in server-deletion-request ping and regenerates server_events.ts
  • Submits the ping wherever DB.deleteAccount and accountDeleted.byCloudTask are logged
  • Keeps the existing deletion logs for a parallel validation period

Issue that this pull request solves

Closes: DENG-11729

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

Because:

* Data Engineering finds FxA account deletions by parsing auth-server
  logs (fxa_delete_events), which is fragile and blocks decommissioning
  Amplitude
* Glean server telemetry now supports a server-deletion-request ping that
  the pipeline can consume directly (DENG-4079)

This commit:

* Sends account.user_id and account.user_id_sha256 in the built-in
  server-deletion-request ping and regenerates server_events.ts
* Submits the ping wherever DB.deleteAccount and accountDeleted.byCloudTask
  are logged
* Keeps the existing deletion logs for a parallel validation period
Copilot AI lite review requested due to automatic review settings October 9, 2026 16:47
@akkomar
akkomar requested a review from a team as a code owner October 9, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It touches account-deletion behavior and server-side telemetry emission in fxa-auth-server, which warrants final human review despite good test coverage.

1 open finding
What changed in this PR

Adds Glean support for FxA account deletions by emitting the built-in server-deletion-request ping from fxa-auth-server, enabling downstream deletion workflows to rely on telemetry rather than log parsing.

Changes:

  • Add account.user_id and account.user_id_sha256 to the server-deletion-request ping and enable those metrics to be sent in that ping.
  • Introduce a createServerDeletionRequestPing helper and call it from DB.deleteAccount and the cloud-task deletion path when no DB row was deleted.
  • Regenerate server_events.ts and add unit tests validating ping submission behavior.
File Description
packages/​fxa-shared/​metrics/​glean/​fxa-backend-pings.yaml Update comment to reflect use of server-deletion-request built-in ping.
packages/​fxa-shared/​metrics/​glean/​fxa-backend-metrics.yaml Allow account ID metrics to be sent in server-deletion-request.
packages/​fxa-auth-server/​lib/​metrics/​glean/​server-deletion-request.ts Add helper to emit server-deletion-request ping with uid + sha256.
packages/​fxa-auth-server/​lib/​metrics/​glean/​server-deletion-request.spec.ts Add unit tests for deletion-request ping submission/no-op behavior.
packages/​fxa-auth-server/​lib/​metrics/​glean/​server_events.ts Add generated logger for server-deletion-request ping and factory.
packages/​fxa-auth-server/​lib/​metrics/​glean/​index.ts Reuse sha256HashUid helper (dedupe hashing implementation).
packages/​fxa-auth-server/​lib/​db.ts Emit deletion-request ping from the central account deletion DB method.
packages/​fxa-auth-server/​lib/​db.spec.ts Test that db.deleteAccount submits the deletion-request ping.
packages/​fxa-auth-server/​lib/​account-delete.ts Emit ping for cloud-task deletions when the account row is already gone.
packages/​fxa-auth-server/​lib/​account-delete.spec.ts Test cloud-task deletion-request ping behavior and non-duplication.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +7201 to +7202
* @returns {EventsServerEventLogger} An instance of EventsServerEventLogger.
*/

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is generated by glean_parser, will fix upstream

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants