feat(debug-files): add upload command (core)#1139
Merged
Merged
Conversation
Contributor
|
Contributor
Codecov Results 📊✅ Patch coverage is 84.81%. Project has 5101 uncovered lines. Files with missing lines (3)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 81.44% 81.47% +0.03%
==========================================
Files 393 396 +3
Lines 27254 27525 +271
Branches 17699 17863 +164
==========================================
+ Hits 22196 22424 +228
- Misses 5058 5101 +43
- Partials 1847 1862 +15Generated by Codecov Action |
9f0c2a9 to
1567eb4
Compare
Member
Author
Self-review findings (all addressed)A critical self-review was completed via subagent. No Critical issues found. The following were surfaced and fixed in the current push ( High (fixed)
Medium (fixed)
Low (acknowledged, not changed)
|
1567eb4 to
db88b53
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit db88b53. Configure here.
Port the legacy `sentry-cli debug-files upload` to the TypeScript CLI, scoped to the Tier A core path that covers the ~90% real-world case. - New `upload` command: recursively scans files/directories, parses each candidate via the bundled `@sentry/symbolic` WASM module, filters, and uploads matching files via the DIF chunk-upload + assemble protocol. - Filters: `--type`/`--id` (repeatable), `--require-all`, and `--no-debug`/`--no-unwind`/`--no-sources` (mirrors legacy feature filtering). - `--include-sources` attaches an in-memory source bundle per file. - `--no-upload` dry-run (no credentials); `--wait`/`--wait-for` block on server-side processing and exit non-zero on failures. - `src/lib/api/debug-files.ts`: `uploadDebugFiles` batches all files into one assemble request keyed by SHA-1 checksum, with no-wait (chunks held) and wait (terminal ok/error) completion modes. - `src/lib/dif/scan.ts`: pure, property-tested filter predicates plus the filesystem scan/parse pipeline. Deferred to follow-ups (noted in --help): ZIP scanning, `--symbol-maps`, `--il2cpp-mapping` line mappings, and `--derived-data`.
db88b53 to
71a0b36
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Ports the legacy
sentry-cli debug-files uploadto the TypeScript CLI, scoped to Tier A core — the path that covers the ~90% real-world case (ELF, dSYM/Mach-O, PE/PDB, WASM, Breakpad, Portable PDB). Reuses the existing DIF chunk-upload + assemble protocol (projects/{org}/{project}/files/difs/assemble/) already used byproguard upload/dart-symbol-map upload, and the@sentry/symbolicWASM parser already used bydebug-files check/bundle-sources.What's included
sentry debug-files upload <path>...— recursively scans files/directories, parses each candidate in-process, filters, and uploads matching files.filter_features):--type/--id(repeatable),--require-all,--no-debug/--no-unwind/--no-sources.--no-debugdrops both debug and symtab, matching legacy semantics.--include-sources— builds and attaches an in-memory source bundle per file with debug info.--no-uploaddry-run (no credentials needed, likeproguard upload).--wait/--wait-for <secs>— block on server-side processing; collecterrorstates and exit non-zero.--jsonoutput (auto-injected bybuildCommand).Design notes
debug_id(first object with debug info, falling back to the first). The server re-parses and indexes every slice itself;debug_idis advisory (omitted when nil/absent).ok/error). Unlike proguard/dart, anerrorentry is collected (not thrown) so the command can report all failures and set the exit code.src/lib/dif/scan.ts) separated from the scan/parse I/O.--idand--require-allmatch ignoring the PE/PDB age suffix via a shareddebugIdMatcheshelper.Deferred to follow-ups (noted in
--help)ZIP scanning (
--no-zips),--symbol-maps(BCSymbolMap resolution — needs Appledsymutil),--il2cpp-mappingline mappings,--derived-data. A full Tier A–D feasibility roadmap is captured in the plan.Testing
test/lib/dif/scan.property.test.ts— property tests forobjectPassesFilters,normalizeDebugId,debugIdMatches,buildDifFilters.test/lib/api/debug-files.test.ts— assemble body shape, missing-chunk upload, no-wait vs wait stop conditions, error collection, timeout.test/commands/debug-files/upload.test.ts— Breakpad text fixtures: dir scanning,--type/--idfilters,--no-upload,--require-allmiss, wait-mode error exit, validation.All new tests pass;
pnpm run lintandpnpm run typecheckare clean.