Skip to content

Add crashlytics:sourcemap:upload command behind experiment#10565

Merged
tonybaroneee merged 41 commits into
mainfrom
crashlytics2
Jun 2, 2026
Merged

Add crashlytics:sourcemap:upload command behind experiment#10565
tonybaroneee merged 41 commits into
mainfrom
crashlytics2

Conversation

@tonybaroneee
Copy link
Copy Markdown
Contributor

Description

The crashlytics:sourcemap:upload command is a new Firebase CLI command that enables developers of web applications to upload JavaScript source maps to Firebase Crashlytics. This is essential for de-obfuscating JavaScript stack traces collected from web apps, allowing customers to view readable crash reports within the Crashlytics dashboard. This functionality is part of the larger effort to add support for web apps within Crashlytics.

Scenarios Tested

Unit + manually tested.

Sample Commands

firebase crashlytics:sourcemap:upload
--project <projectId>
--app-id <appID>
	--bucket-location <bucketLocation>
--app-version <appVersion>
[directory]

andrewbrook and others added 20 commits April 30, 2026 14:00
* Implement partial source map upload command

* lint

* move test fixture data

* improve coverage

* refactor

* format

* fix non-determinism in test
* Use git commit hash as default app version

* App version fallback hierarchy
* Update source map upload command options

- Remove `telemetryServerUrl` option
- Change mapping file positional argument from required to optional (defaults to root dir)

* Fix mapping path fallback and add test
* Handle mismatched source map file names

* Add start of line match

* Rename variable

* Refactor for readbility
* fix unit tests

* make resilient to test failures
* update sourcemap:upload to align with API

* cleanup

* lint

* lint
* misc bug fixes

* cleanup

* Lint fixes

* Mock auth in spec

* bypass requireauth hook in unit tests

---------

Co-authored-by: Anthony Barone <tonybaroneee@gmail.com>
@tonybaroneee tonybaroneee requested a review from joehan May 27, 2026 17:57
@wiz-9635d3485b
Copy link
Copy Markdown

wiz-9635d3485b Bot commented May 27, 2026

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings 5 Medium
Software Management Finding Software Management Findings -
Total 5 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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 a new command crashlytics:sourcemap:upload to upload JavaScript source maps to Crashlytics for web apps, enabled under the crashlyticsWeb experiment flag. It includes the command implementation, utility functions for archiving files, and comprehensive unit tests. The code reviewer identified several critical issues, including a potential race condition and unhandled error crash in pipeAsync, a path resolution bug when using path.relative on already relative paths, a performance concern with reading entire JS files synchronously, a resource leak where temporary zip files are not deleted, and a missing retryDelay type definition in CommandOptions.

Comment thread src/archiveFile.ts
Comment thread src/commands/crashlytics-sourcemap-upload.ts Outdated
Comment thread src/commands/crashlytics-sourcemap-upload.ts Outdated
Comment thread src/commands/crashlytics-sourcemap-upload.ts Outdated
Comment thread src/commands/crashlytics-sourcemap-upload.ts Outdated
Comment thread src/commands/crashlytics-sourcemap-upload.ts
Comment thread src/commands/crashlytics-sourcemap-upload.ts Outdated
Comment thread src/commands/crashlytics-sourcemap-upload.ts Outdated
Comment thread src/commands/crashlytics-sourcemap-upload.ts Outdated
Comment thread src/commands/crashlytics-sourcemap-upload.ts Outdated
Comment thread package.json Outdated
@tonybaroneee tonybaroneee requested a review from joehan May 28, 2026 15:24
@tonybaroneee
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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:sourcemap:upload command, allowing users to upload JavaScript source maps for web applications to Crashlytics under the crashlyticsWeb experiment flag. The implementation includes utilities for discovering source map mappings, extracting sourceMappingURL from JS files, and uploading zipped assets to Google Cloud Storage, alongside a new MurmurHash3 hashing function. The review feedback highlights a resource leak from an unclosed file descriptor in archiveFile.ts, a path resolution bug in uploadMap when options.projectRoot is customized, a potential buffer decoding issue in getLinkedSourceMapPath, and a style guide violation regarding explicit boolean comparisons.

Comment thread src/archiveFile.ts Outdated
Comment thread src/crashlytics/sourcemap.ts Outdated
Comment thread src/crashlytics/sourcemap.ts Outdated
Comment thread src/crashlytics/sourcemap.ts Outdated
Copy link
Copy Markdown
Member

@joehan joehan left a comment

Choose a reason for hiding this comment

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

Mostly LGTM after a few final fixes!

Comment thread src/crashlytics/sourcemap.ts Outdated
Comment thread src/archiveFile.ts
Comment thread src/archiveFile.ts Outdated
Comment thread src/utils.ts
@tonybaroneee tonybaroneee requested a review from joehan June 2, 2026 13:48
@tonybaroneee tonybaroneee enabled auto-merge (squash) June 2, 2026 15:29
@tonybaroneee tonybaroneee disabled auto-merge June 2, 2026 15:29
@tonybaroneee tonybaroneee enabled auto-merge (squash) June 2, 2026 15:30
@tonybaroneee tonybaroneee merged commit 99195be into main Jun 2, 2026
56 checks passed
@tonybaroneee tonybaroneee deleted the crashlytics2 branch June 2, 2026 16:41
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