Skip to content

fix(crashlytics): use v1alpha profilingManagerConfig endpoint for heap dump commands - #11457

Merged
jrothfeder merged 5 commits into
mainfrom
fix/crashlytics-heapdumps-v1alpha
Nov 6, 2026
Merged

jrothfeder merged 5 commits into
mainfrom
fix/crashlytics-heapdumps-v1alpha

Conversation

@jrothfeder

Copy link
Copy Markdown
Contributor

Update getProfilingManagerConfig and updateProfilingManagerConfig to use the shared CRASHLYTICS_API_CLIENT (v1alpha) and the singleton resource endpoint /v1alpha/projects/{projectNumber}/apps/{appId}/profilingManagerConfig:

  • Switch getProfilingManagerConfig to GET /v1alpha/projects/{projectNumber}/apps/{appId}/profilingManagerConfig and remove getCrashlyticsV1Client().
  • Switch updateProfilingManagerConfig to PATCH /v1alpha/projects/{projectNumber}/apps/{appId}/profilingManagerConfig with updateMask.
  • Translate gcsBucket between bare bucket IDs used by the CLI and canonical projects/_/buckets/{bucket} resource names expected by the API.
  • Simplify disableHeapDumpCollection to send a partial PATCH (updateMask=heapDumpCollectionEnabled) instead of a GET + POST pair so the existing gcsBucket is preserved atomically.
  • Update profilingManager.spec.ts unit tests to cover the v1alpha resource paths, bucket resource-name formatting, and partial updateMask updates.

…p dump commands

Update `getProfilingManagerConfig` and `updateProfilingManagerConfig` to use the
shared `CRASHLYTICS_API_CLIENT` (`v1alpha`) and the singleton resource endpoint
`/v1alpha/projects/{projectNumber}/apps/{appId}/profilingManagerConfig`:

- Switch `getProfilingManagerConfig` to `GET /v1alpha/projects/{projectNumber}/apps/{appId}/profilingManagerConfig` and remove `getCrashlyticsV1Client()`.
- Switch `updateProfilingManagerConfig` to `PATCH /v1alpha/projects/{projectNumber}/apps/{appId}/profilingManagerConfig` with `updateMask`.
- Translate `gcsBucket` between bare bucket IDs used by the CLI and canonical `projects/_/buckets/{bucket}` resource names expected by the API.
- Simplify `disableHeapDumpCollection` to send a partial `PATCH` (`updateMask=heapDumpCollectionEnabled`) instead of a `GET` + `POST` pair so the existing `gcsBucket` is preserved atomically.
- Update `profilingManager.spec.ts` unit tests to cover the `v1alpha` resource paths, bucket resource-name formatting, and partial `updateMask` updates.

@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 refactors the Crashlytics profiling manager to use the updated profilingManagerConfig API endpoint. Key changes include switching from POST to PATCH requests for updating configurations, implementing partial updates using updateMask query parameters, and introducing helper functions to convert between GCS bucket names and their resource path representations. Additionally, disableHeapDumpCollection has been simplified to perform a partial update without needing to fetch the current configuration first. Unit tests have been updated accordingly to reflect these API and endpoint changes. There are no review comments, and I have no additional feedback to provide.

@jrothfeder
jrothfeder requested a review from kaibolay November 5, 2026 15:11

@kaibolay kaibolay 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.

As far as I can tell, the backend changes to production are currently rolling out. But even now you should be able to test this with preprod or staging.

Comment thread src/crashlytics/profilingManager.ts Resolved
Comment thread src/crashlytics/profilingManager.ts Resolved
Comment thread src/crashlytics/profilingManager.ts Resolved
Comment thread src/crashlytics/profilingManager.ts Resolved
- Rename gcsBucket to bucket on ProfilingManagerConfig and in the updateMask field paths to match the v1alpha API schema (AIP-122).
- Return response.body directly from getProfilingManagerConfig.
- Simplify updateProfilingManagerConfig to accept an explicit updateMask parameter and return Promise<void>.
- Update crashlytics:heapdumps:status and unit tests to use bucket.

@kaibolay kaibolay 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.

Just make sure it works before merging

@jrothfeder
jrothfeder enabled auto-merge (squash) November 6, 2026 19:25
@jrothfeder
jrothfeder merged commit 851baf5 into main Nov 6, 2026
51 checks passed
@jrothfeder
jrothfeder deleted the fix/crashlytics-heapdumps-v1alpha branch November 6, 2026 19:31
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.

4 participants