Skip to content

fix(payments-api): stripe webhooks not recording glean#20421

Open
StaberindeZA wants to merge 1 commit intomainfrom
pay-3321-stripe-webhook-fix
Open

fix(payments-api): stripe webhooks not recording glean#20421
StaberindeZA wants to merge 1 commit intomainfrom
pay-3321-stripe-webhook-fix

Conversation

@StaberindeZA
Copy link
Copy Markdown
Contributor

Because

  • The Stripe webhook handler is not recording glean events.

This pull request

  • Removes mock glean provider from payments-api app module.

Issue that this pull request solves

Closes: #PAY-3321

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)

  • Accept stripe webhook events locally using the Stripe CLI
  • Create a customer with a subscription
  • Delete the subscription and ensure the webhook is received locally and that the glean event is recorded in stdout

Screenshots (Optional)

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

Other information (Optional)

Any other information that is important to this pull request.

Because:

- The Stripe webhook handler is not recording glean events.

This commit:

- Removes mock glean provider from payments-api app module.

Closes #PAY-3321
@StaberindeZA StaberindeZA requested a review from a team as a code owner April 21, 2026 20:03
Copilot AI review requested due to automatic review settings April 21, 2026 20:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes missing Stripe webhook Glean recording by ensuring the payments-api app uses the real Glean provider instead of a mock.

Changes:

  • Removes the mock MockPaymentsGleanFactory from the NestJS AppModule providers so real Glean events can be recorded.
  • Adjusts Nx target configuration for payments-api (notably serve/start dependency behavior).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/payments/api/src/app/app.module.ts Removes the mock Glean DI provider so Stripe webhook code can emit real Glean metrics.
apps/payments/api/project.json Updates Nx target dependency behavior for serve and overrides start dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +72 to +73
"command": "pm2 start apps/payments/api/pm2.config.js && yarn check:url localhost:3037/__heartbeat__",
"dependsOn": []
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

dependsOn: [] on the start target overrides the workspace default start dependencies (see nx.json start target defaults) and will skip running build / gen-keys before starting PM2. Unless those steps are guaranteed to run elsewhere in your deployment/local workflow, this can result in starting stale artifacts or missing generated keys. Consider removing this override to inherit defaults, or explicitly listing the required prerequisites for payments-api:start.

Suggested change
"command": "pm2 start apps/payments/api/pm2.config.js && yarn check:url localhost:3037/__heartbeat__",
"dependsOn": []
"command": "pm2 start apps/payments/api/pm2.config.js && yarn check:url localhost:3037/__heartbeat__"

Copilot uses AI. Check for mistakes.
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