Skip to content

fix(admin-panel): update RP post-create steps for the fxa-legacy event broker - #21019

Open
vbudhram wants to merge 1 commit into
mainfrom
fxa-14345
Open

fix(admin-panel): update RP post-create steps for the fxa-legacy event broker#21019
vbudhram wants to merge 1 commit into
mainfrom
fxa-14345

Conversation

@vbudhram

Copy link
Copy Markdown
Contributor

Because

  • The event broker moved from GCPv1 (cloudops-infra) into MozCloud as the fxa-legacy tenant. Nobody updated the post-create steps on the admin panel.
  • Step 1 told the operator to run gcloud pubsub topics create by hand. That fails with a permission error now, and Terraform creates the topic anyway.
  • Step 2 linked a dead cloudops-infra file. Step 3 pointed at the OAUTH_CLIENT_IDS map for legacy Amplitude events, which is deprecated.
  • All three env-conditional URLs matched the prod host with ===, so any prod host other than fxa-admin-panel.prod.mozaws.net silently got the nonprod links.

This pull request

  • Drops the manual gcloud pubsub topics create step and the OAUTH_CLIENT_IDS step from PageRelyingParties/index.tsx.
  • Points the IaC step at eventbroker_endpoint_subscription_config in webservices-infra fxa-legacy/tf/{stage,prod}/locals.tf, and shows the entry shape. One entry gets you the topic, the push subscription, and the Firestore webhook document.
  • Renumbers the client secret handoff. The panel now shows two steps instead of four.
  • Adds getEventBrokerTfPath() next to getWafTfPath() in lib/utils.ts, using the same startsWith host check. That is the part that fixes the prod fall-through.
  • Covers two prod hosts and one stage host for the new helper in utils.spec.ts, so the tests fail if the exact host match ever comes back. Drops the index.test.tsx assertion for the gcloud command that no longer exists.

Issue that this pull request solves

Closes: https://mozilla-hub.atlassian.net/browse/FXA-14345

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 post-create block in PageRelyingParties/index.tsx, and the new helper in lib/utils.ts.
  • Suggested review order: lib/utils.ts, then the component, then the two test files.
  • Risky or complex parts: nothing tricky in the code. The risk is the copy. Please check the locals.tf path and the entry shape against what fxa-legacy actually expects. A wrong path sends operators to the wrong repo.

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

The panel wording follows the "Register Your Webhook" section of the public RP tutorial instead of new phrasing.

Both attributes in the map entry are optional. resource_server defaults to false, and you leave endpoint out for a topic with no webhook.

One caveat on local test results: six tests in PageRelyingParties/index.test.tsx fail in my sandbox both before and after this change. The local react-router is v6 and RelyingPartyRow imports NavLink from it, which v6 does not export. That is an environment problem on my side, not something this PR touches. CI runs the full suite.

@vbudhram
vbudhram requested a review from a team as a code owner August 12, 2026 20:59
@vbudhram vbudhram added the auto label Aug 12, 2026
@vbudhram

Copy link
Copy Markdown
Contributor Author

Blocked on merge order.

15 checks pass. The one failure is Pair2/Supplicant/TimeoutAndCancel, broken on main: the timeout variant's expected text omits the <b> markup its own Fluent message carries. This PR touches only fxa-admin-panel and cannot reach it.

Fix is already in #21016. This is the third PR blocked by the same test, so merging #21016 unblocks all of them.

dependant.
(webservices-infra). One entry provisions the topic, the push
subscription, and the Firestore webhook document.
<pre className="p-2">{`"${rpId}" = {

@vpomerleau vpomerleau Aug 12, 2026

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.

issue (blocking): Missing # pragma: allowlist secret — without it detect-secrets flags the client id as a HexHighEntropyString and the operator's first commit fails pre-commit.

Suggested change
<pre className="p-2">{`"${rpId}" = {
<pre className="p-2">{`"${rpId}" = { # pragma: allowlist secret

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