Skip to content

feat(crashlytics): add crashlytics:onboard:web command - #10861

Open
bryanatkinson wants to merge 9 commits into
mainfrom
crashlytics-web-onboarding
Open

feat(crashlytics): add crashlytics:onboard:web command#10861
bryanatkinson wants to merge 9 commits into
mainfrom
crashlytics-web-onboarding

Conversation

@bryanatkinson

Copy link
Copy Markdown
Contributor

Description

Adds support for onboarding Firebase Web Apps to Crashlytics via the crashlytics:onboard command.

  • Verifies that the project is on the Blaze plan (has a linked billing account) before proceeding, supporting interactive billing selection and non-interactive error guidance. Moved this functionality out of the extensions module into the GCP module so it can be shared.
  • Enables required Google Cloud APIs (firebasetelemetry.googleapis.com and firebasetelemetryadmin.googleapis.com).
  • Creates and configures Cloud Logging bucket firebase-telemetry with observability analytics enabled, with automatic fallback to patch existing buckets.
  • Sets up Cloud Logging sink firebase-telemetry-routing to route firebasetelemetry.googleapis.com/App resources to the dedicated telemetry bucket.
  • Creates a Telemetry Config via the Telemetry Admin API with sampling rate 1 and automatic telemetry enablement.

Scenarios Tested

  • Tested interactive and non-interactive Blaze plan verification on an unbilled project (bryan-crash-cli-onboarding).
  • Tested live onboarding execution end-to-end against web apps 1:894118895927:web:dad71d14e9abaa7d543ab2 in project crash-test-app-87b7a and 1:298871010406:web:f0b7551fb086db3dafe9a7 in project bryan-crash-cli-onboarding.
  • Ran unit test suites for Cloud Logging utilities and Crashlytics onboarding workflow (npx mocha src/gcp/cloudlogging.spec.ts src/crashlytics/onboarding.spec.ts).

Sample Commands

firebase crashlytics:onboard --project <project-id>
firebase crashlytics:onboard 1:123:web:456 --project <project-id>

### Description
Adds support for onboarding Firebase Web Apps to Crashlytics via the `crashlytics:onboard` command.
- Verifies that the project is on the Blaze plan (has a linked billing account) before proceeding, supporting interactive billing selection and non-interactive error guidance.
- Enables required Google Cloud APIs (`firebasetelemetry.googleapis.com` and `firebasetelemetryadmin.googleapis.com`).
- Creates and configures Cloud Logging bucket `firebase-telemetry` with observability analytics enabled, with automatic fallback to patch existing buckets.
- Sets up Cloud Logging sink `firebase-telemetry-routing` to route `firebasetelemetry.googleapis.com/App` resources to the dedicated telemetry bucket.
- Creates a Telemetry Config via the Telemetry Admin API with sampling rate 1 and automatic telemetry enablement.

### Scenarios Tested
- Tested interactive and non-interactive Blaze plan verification on an unbilled project (`bryan-crash-cli-onboarding`).
- Tested live onboarding execution end-to-end against web apps `1:894118895927:web:dad71d14e9abaa7d543ab2` in project `crash-test-app-87b7a` and `1:298871010406:web:f0b7551fb086db3dafe9a7` in project `bryan-crash-cli-onboarding`.
- Ran unit test suites for Cloud Logging utilities and Crashlytics onboarding workflow (`npx mocha src/gcp/cloudlogging.spec.ts src/crashlytics/onboarding.spec.ts`).

### Sample Commands
```bash
firebase crashlytics:onboard --project <project-id>
firebase crashlytics:onboard 1:123:web:456 --project <project-id>
```

TAG=agy
CONV=0cf98957-1b4e-437c-8a79-5ff873b6c315

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces the crashlytics:onboard CLI command to support Crashlytics web onboarding, along with the underlying telemetry configuration and Cloud Logging setup. It also refactors the billing enablement logic to be reusable across different features. Feedback on the changes suggests adding an updateMask to the telemetry config PATCH request (and updating tests accordingly), running the independent API enablement calls in parallel to improve performance, and simplifying the feature name to 'Crashlytics' for cleaner CLI output.

Comment thread src/crashlytics/firebasetelemetry.ts
Comment thread src/crashlytics/firebasetelemetry.spec.ts
Comment thread src/crashlytics/onboarding.ts Outdated
Comment thread src/crashlytics/onboarding.ts Outdated
Comment thread src/crashlytics/onboarding.spec.ts Outdated
Comment thread src/deploy/extensions/validate.ts
Comment thread src/crashlytics/onboarding.spec.ts Outdated
Comment thread CHANGELOG.md Outdated
Comment thread src/commands/crashlytics-onboard-web.ts
Comment thread src/crashlytics/onboarding.ts Outdated
Comment thread src/crashlytics/firebasetelemetry.ts
- Move firebasetelemetry client utility from src/gcp/ to src/crashlytics/
- Add updateMask parameter to TelemetryConfig PATCH requests
- Parallelize firebasetelemetry and firebasetelemetryadmin API enablement
- Simplify billing prompt feature name to 'Crashlytics'
- Clarify crashlytics:onboard command description for web apps
- Revert unrelated changes to src/deploy/extensions/validate.ts

TAG=agy
CONV=0cf98957-1b4e-437c-8a79-5ff873b6c315
@bryanatkinson
bryanatkinson force-pushed the crashlytics-web-onboarding branch from a1a55d6 to 9d8f182 Compare July 29, 2026 19:37
- Rename command to crashlytics:onboard:web
- Update command file to src/commands/crashlytics-onboard-web.ts
- Update registration in src/commands/index.ts
- Update CHANGELOG.md entry

TAG=agy
CONV=0cf98957-1b4e-437c-8a79-5ff873b6c315
@tonybaroneee
tonybaroneee requested a review from joehan July 30, 2026 03:31
@tonybaroneee
tonybaroneee marked this pull request as ready for review July 30, 2026 03:34
@tonybaroneee tonybaroneee changed the title feat: add crashlytics web onboarding support feat(crashlytics): add support for web onboarding Jul 30, 2026
@tonybaroneee tonybaroneee changed the title feat(crashlytics): add support for web onboarding feat(crashlytics): add support for web app onboarding Jul 30, 2026
@tonybaroneee tonybaroneee changed the title feat(crashlytics): add support for web app onboarding feat(crashlytics): add crashlytics:onboard:web command Jul 30, 2026
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.

3 participants