Skip to content

chore(shared): move Glean YAML and generated web code out of fxa-shared - #21531

Merged
vbudhram merged 1 commit into
mainfrom
fxa-14711
Oct 16, 2026
Merged

vbudhram merged 1 commit into
mainfrom
fxa-14711

Conversation

@fxa-agent

@fxa-agent fxa-agent Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Do not merge before mozilla/probe-scraper#1090 merges.

Because

  • The FxA Glean YAML files now live in libs/shared/metrics/glean/src/registry/, so the copies in packages/fxa-shared are dead.
  • Only fxa-settings uses the generated web code in packages/fxa-shared/metrics/glean/web.

This pull request

  • Removes the 5 FxA Glean YAML files from packages/fxa-shared/metrics/glean. The registry copies are byte-identical.
  • Keeps glean-backend-metrics-compat.yaml in the registry, because probe-scraper reads it for accounts_backend.
  • Deletes packages/fxa-shared/metrics/glean/pair-reasons.ts. Nothing imports it. fxa-settings has its own copy.
  • Moves the 31 generated files from web/ to packages/fxa-settings/src/lib/glean/web. The files are unchanged.
  • Changes the imports in index.ts and index.test.ts in packages/fxa-settings/src/lib/glean to ./web/<name>.
  • Changes package.json scripts only:
  • Changes no metric definition and nothing a user can see.

Issue that this pull request solves

Closes: FXA-14711

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.

How to review (Optional)

  • Key files/areas to focus on: the package.json scripts.
  • Suggested review order:
  • Risky or complex parts: the script paths, which I could not run.

Screenshots (Optional)

Other information (Optional)

I ran these checks in the sandbox. All passed.

  • On the running local stack, the served settings dev bundle contains src/lib/glean/web/reg.ts.
  • src/lib/glean/index.test.ts in fxa-settings: 166 tests passed.
  • tsc --noEmit for fxa-settings passed.
  • ESLint and Prettier passed on the changed files.
  • packages/fxa-shared/metrics/glean is gone, and git grep fxa-shared/metrics/glean -- packages libs apps is empty.

Not run: glean-generate and glean-lint. The VM cannot download glean_parser. Please run them and confirm that the generated output shows no diff.

@fxa-agent
fxa-agent Bot requested a review from a team as a code owner October 15, 2026 20:08
@fxa-agent fxa-agent Bot added the auto label Oct 15, 2026
@vbudhram
vbudhram requested a lite review from Copilot October 15, 2026 20:12

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.

🟡 Changes recommended

The settings lint target omits glean-lint, and a stale generated module should be removed.

1 open finding
What changed in this PR

This PR relocates Glean registries and generated web metrics from fxa-shared to their owning packages.

Changes:

  • Removes obsolete shared Glean files and scripts.
  • Moves generated web metrics into fxa-settings.
  • Updates Glean generation, lint paths, and imports.
File Summary
packages/​fxa-shared/​package.json Removes obsolete Glean scripts.
packages/​fxa-shared/​metrics/​glean/​pair-reasons.ts Deletes unused helper.
packages/​fxa-shared/​metrics/​glean/​glean-backend-metrics-compat.yaml Removes duplicate registry file.
packages/​fxa-shared/​metrics/​glean/​fxa-ui-pings.yaml Removes duplicate registry file.
packages/​fxa-shared/​metrics/​glean/​fxa-backend-pings.yaml Removes duplicate registry file.
packages/​fxa-shared/​metrics/​glean/​fxa-backend-metrics.yaml Removes duplicate registry file.
packages/​fxa-settings/​src/​lib/​glean/​web/​utm.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​thirdPartyAuth.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​setPasswordThirdPartyAuth.ts Relocated stale generated module; should be removed.
packages/​fxa-settings/​src/​lib/​glean/​web/​session.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​relyingParty.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​reg.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​promoQrMobile.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​postVerifySetPassword.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​passwordReset.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​passkeyEnterPassword.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​passkey.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​login.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​index.ts Relocated event map.
packages/​fxa-settings/​src/​lib/​glean/​web/​firefoxPromo.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​error.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​entrypoint.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​email.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​dtmMobile.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​dtmDesktop.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​deleteAccount.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​cadRedirectMobile.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​cadRedirectDesktop.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​cadMobilePairUseApp.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​cadMobilePair.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​cadFirefox.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​cadApproveDevice.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​cad.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​cachedLogin.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​accountPref.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​accountBanner.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​web/​account.ts Relocated generated metrics.
packages/​fxa-settings/​src/​lib/​glean/​index.ts Updates generated metric imports.
packages/​fxa-settings/​src/​lib/​glean/​index.test.ts Updates test imports.
packages/​fxa-settings/​package.json Adds Glean scripts; lint target should invoke glean-lint.
packages/​fxa-content-server/​package.json Points Glean scripts to the registry.
packages/​fxa-auth-server/​package.json Points Glean scripts to the registry.

🧠 Review effort: Lite


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

"copy-dev-build": "mkdir -p ../fxa-content-server/app/settings ; NODE_ENV=production yarn build-react-dev && cp -R build/dev ../fxa-content-server/app/settings",
"compile": "tsc --noEmit",
"glean-generate": "npx glean translate ../../libs/shared/metrics/glean/src/registry/fxa-ui-pings.yaml ../../libs/shared/metrics/glean/src/registry/fxa-ui-metrics.yaml -f typescript -o src/lib/glean/web && prettier --config ../../_dev/.prettierrc --write src/lib/glean/web/*.ts",
"glean-lint": "npx glean glinter ../../libs/shared/metrics/glean/src/registry/fxa-ui-pings.yaml ../../libs/shared/metrics/glean/src/registry/fxa-ui-metrics.yaml",
@fxa-agent

fxa-agent Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

This review round pushed a new commit:

Because:

* The FxA Glean YAML already lives in libs/shared/metrics/glean
* Only fxa-settings uses the generated Glean web code

This commit:

* Removes the Glean YAML and pair-reasons.ts from fxa-shared
* Moves the generated web code into fxa-settings src/lib/glean/web
* Points the glean scripts of auth, content and settings at the registry
* Runs glean-lint in the fxa-settings lint script

Closes FXA-14711
@vbudhram
vbudhram merged commit 5e0b1e8 into main Oct 16, 2026
22 checks passed
@vbudhram
vbudhram deleted the fxa-14711 branch October 16, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants