Skip to content

feat(symbols): add symbols upload command for React Native + Android symbols#745

Open
abelonogov-ld wants to merge 2 commits into
mainfrom
andrey/symbols-upload-rn
Open

feat(symbols): add symbols upload command for React Native + Android symbols#745
abelonogov-ld wants to merge 2 commits into
mainfrom
andrey/symbols-upload-rn

Conversation

@abelonogov-ld

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new ldcli symbols upload command for uploading symbolication artifacts over the dedicated symbol-upload path (large files, multi-segment keys), separate from sourcemaps upload.
  • Supports --type react-native (composed source maps + bundles) and --type android (R8/ProGuard mapping.txt).
  • Keys uploads by a deterministic symbols id (launchdarkly.symbols_id.htlhash) via --symbols-id or an auto-read *.symbolsid sidecar, falling back to --app-version when absent. Storage layout: _sym/{js,android}/id/<symbols-id>/….

Test plan

  • go test ./cmd/symbols/...
  • ldcli symbols upload --type react-native --path ./build --project <key> against a local backend
  • ldcli symbols upload --type android --path ./app/build/symbols/<variant> --project <key>

Made with Cursor

abelonogov-ld and others added 2 commits July 13, 2026 17:41
Align the identifier naming with the `symbols upload` command and the
`_sym/.../id/` storage layout: `--build-id` -> `--symbols-id`, the
`*.buildid` sidecar -> `*.symbolsid`, and the internal prefixes/helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 5 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 575591b. Configure here.

Comment thread cmd/sourcemaps/upload.go
}

if !d.IsDir() && isSourceMapUploadFile(filePath) {
if !d.IsDir() && (strings.HasSuffix(filePath, ".js.map") || strings.HasSuffix(filePath, ".js")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcemaps skip RN silently

High Severity

sourcemaps upload now only collects *.js and *.js.map, so React Native *.jsbundle / *.bundle artifacts in the same tree are ignored while the command still succeeds after uploading web files only.

Fix in Cursor Fix in Web

Triggered by learned rule: Breaking CLI default changes require transitional stderr warnings

Reviewed by Cursor Bugbot for commit 575591b. Configure here.

Comment thread cmd/symbols/upload.go
// the version+basePath scheme. The key becomes <prefix>/<symbolsID>/<basename>
// so it matches the key the backend derives from the reported symbols id.
if symbolsID != "" {
return fmt.Sprintf("%s/%s/%s", symbolsIDPrefix, symbolsID, filepath.Base(fileName))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Android mapping keys collide

High Severity

With --symbols-id (or a sidecar), every discovered mapping.txt is keyed as _sym/android/id/&lt;id&gt;/mapping.txt, so multiple mappings under one --path overwrite the same object regardless of relative directory.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 575591b. Configure here.

Comment thread cmd/symbols/upload.go
}
return nil
})
return found

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

First sidecar id reused

High Severity

When --symbols-id is omitted, readSymbolsIDSidecar stops at the first non-empty *.symbolsid under --path and that single id is applied to every uploaded artifact in the batch.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 575591b. Configure here.

Comment thread cmd/symbols/upload.go
Path: path,
Name: filepath.Base(path),
})
return files, nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Single file type unchecked

Medium Severity

If --path points at a single file, getAllSymbolFiles adds it without calling isSymbolUploadFile, so unrelated files can be uploaded under symbol keys for the chosen --type.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 575591b. Configure here.

Comment thread cmd/symbols/upload.go
for i, file := range files {
if err := uploadFile(file.Path, uploadUrls[i], file.Name); err != nil {
return fmt.Errorf("failed to upload file %s: %w", file.Path, err)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Upload URL count unchecked

Medium Severity

The upload loop indexes uploadUrls[i] for each file, but getSymbolUploadUrls only rejects a completely empty URL list, not a short list relative to len(files).

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 575591b. Configure here.

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.

1 participant