Skip to content

feat(crashlytics): add optional email alerting step to web onboarding - #11182

Open
tonybaroneee wants to merge 1 commit into
mainfrom
feat/crashlytics-web-onboarding-alerts
Open

tonybaroneee wants to merge 1 commit into
mainfrom
feat/crashlytics-web-onboarding-alerts

Conversation

@tonybaroneee

@tonybaroneee tonybaroneee commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds an optional interactive step to firebase crashlytics:onboard:web (gated behind the crashlyticsWebAlerts experiment) that allows users to configure Crashlytics email alerts for their Web app during onboarding:

  • Alert Policy & Notification Channel Helpers (src/crashlytics/alerts.ts, src/gcp/cloudmonitoring.ts):
    • Calls the Crashlytics projects.apps.generateAlertPolicy API to provision Cloud Monitoring alert policies for selected alert types (ALERT_TYPE_NEW_ISSUE, ALERT_TYPE_REGRESSED_ISSUE).
    • Queries or creates a Firebase-labeled Cloud Monitoring email notification channel (is_firebase_channel=true) for the authenticated user's email and attaches it to the generated alert policies.
  • Interactive Onboarding Step (src/crashlytics/onboarding.ts):
    • When the crashlyticsWebAlerts experiment is enabled and the CLI is running interactively, prompts the user to select which email alerts to enable (New issues and/or Regressed issues, both checked by default).
    • Gracefully logs a warning without failing the overall onboarding flow if alert configuration encounters an error or if the user's email cannot be determined.

Example Output

$ firebase crashlytics:onboard:web 1:1234567890:web:abcdef1234567890 --project my-project

i  crashlytics: Enabling required telemetry APIs...
✔  crashlytics: Telemetry APIs enabled.
i  crashlytics: Ensuring Crashlytics Telemetry API is permitted in API key restrictions...
✔  crashlytics: API key restrictions updated for Crashlytics Telemetry.
i  crashlytics: Setting up Cloud Logging bucket 'firebase-telemetry'...
✔  crashlytics: Cloud Logging bucket configured.
i  crashlytics: Setting up Cloud Logging routing sink 'firebase-telemetry-routing'...
✔  crashlytics: Cloud Logging routing sink configured.
i  crashlytics: Configuring Crashlytics telemetry for web app...
✔  crashlytics: Crashlytics telemetry configured successfully.
? Which email alerts would you like to enable? (Optional)
 ◉ New issues (Notify when a new issue is detected)
 ◉ Regressed issues (Notify when a closed issue reoccurs)
i  crashlytics: Setting up Crashlytics email alerts for user@example.com...
✔  crashlytics: Crashlytics email alerts configured successfully.

Scenarios Tested

  • Unit tests:
    • src/crashlytics/alerts.spec.ts: Generating alert policies, reusing existing vs. creating new Firebase email notification channels, deduplicating channels on policies, and enabling multiple alert types in parallel.
    • src/crashlytics/onboarding.spec.ts: Interactive alert selection, deselecting all alerts, skipping when crashlyticsWebAlerts is disabled or in --non-interactive mode, resolving email from options.user.email vs. requireAuth, and graceful warning fallback on API errors.
    • src/gcp/cloudmonitoring.spec.ts: Listing/creating notification channels and getting/updating alert policies via Cloud Monitoring v3 API.
  • Manual E2E testing:
    • Enabled the crashlyticsWebAlerts experiment (firebase experiments:enable crashlyticsWebAlerts) and ran firebase crashlytics:onboard:web against a test Firebase project to verify notification channel creation and alert policy attachment in Cloud Monitoring.

gemini-code-assist[bot]

This comment was marked as resolved.

@tonybaroneee
tonybaroneee force-pushed the feat/crashlytics-web-onboarding-alerts branch from 2d65e67 to 9e16548 Compare September 28, 2026 21:09
gemini-code-assist[bot]

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as resolved.

@tonybaroneee
tonybaroneee force-pushed the feat/crashlytics-web-onboarding-alerts branch from 1a6d1c0 to e8dddc9 Compare September 29, 2026 00:21
gemini-code-assist[bot]

This comment was marked as resolved.

gemini-code-assist[bot]

This comment was marked as resolved.

@tonybaroneee
tonybaroneee force-pushed the feat/crashlytics-web-onboarding-alerts branch from 79a84e6 to 9c6d7c9 Compare September 29, 2026 00:45
@tonybaroneee
tonybaroneee enabled auto-merge (squash) September 29, 2026 13:50

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