feat(code-mappings): Wire up API integration for code-mappings upload#3209
Merged
feat(code-mappings): Wire up API integration for code-mappings upload#3209
Conversation
Contributor
|
684caab to
912da39
Compare
f5ab182 to
37fbb57
Compare
This was referenced Mar 12, 2026
37fbb57 to
5720ec2
Compare
912da39 to
95e8814
Compare
5720ec2 to
bbc4d47
Compare
szokeasaurusrex
approved these changes
Mar 18, 2026
Member
szokeasaurusrex
left a comment
There was a problem hiding this comment.
lgtm, added some minor optional improvements
e405066 to
8f9babe
Compare
3d14593 to
e288070
Compare
romtsn
added a commit
that referenced
this pull request
Mar 20, 2026
_#skip-changelog_ Add the `sentry-cli code-mappings upload` subcommand group and the `upload` subcommand with file parsing and validation. This is the first in a stack of 4 PRs to support bulk uploading code mappings from a JSON file — useful for Java/Android multi-module projects that need dozens of mappings. This PR adds: - Command scaffold following the `repos`/`deploys` pattern - JSON file reading and validation (empty arrays, empty stackRoot/sourceRoot) - CLI args: positional `PATH`, `--repo`, `--default-branch` - Help and no-subcommand trycmd integration tests Stack: **#3207** → #3208 → #3209 → #3210 Backend PRs: getsentry/sentry#109783, getsentry/sentry#109785, getsentry/sentry#109786 Closes getsentry/sentry-android-gradle-plugin#1076 Closes getsentry/sentry-android-gradle-plugin#1077 --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
70ddd86 to
6dae115
Compare
romtsn
added a commit
that referenced
this pull request
Mar 24, 2026
…3208) *#skip-changelog* When `--repo` or `--default-branch` are not provided, infer them from the<br>local git repository. Uses the configured VCS remote (SENTRY_VCS_REMOTE / ini)<br>first, then falls back to best-effort remote detection (upstream > origin > first). Also extracts `find_best_remote()` as a shared utility in `src/utils/vcs.rs`,<br>replacing the inline logic that was duplicated in `git_repo_base_repo_name_preserve_case`. Stack: #3207 → [#3208](<#3208>) → [#3209](<#3209>) → [#3210](<#3210>) Backend PRs: [getsentry/sentry#109783](<getsentry/sentry#109783>), [getsentry/sentry#109785](<getsentry/sentry#109785>), [getsentry/sentry#109786](<getsentry/sentry#109786>) Closes [GRADLE-79](https://linear.app/getsentry/issue/GRADLE-79/add-git-inference-for-repo-name-and-default-branch) --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
Add bulk_upload_code_mappings() API method and BulkCodeMappingsRequest/ Response data types. Wire up the upload command to authenticate, call the bulk endpoint, and display results in a table with summary counts. Exit with code 1 if any mappings fail.
The bulk code-mappings endpoint is scoped to an organization, so a 404 should report "organization not found" rather than generic "resource not found", consistent with other org-scoped endpoints. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Simplify the status match per review feedback and extract the table building logic into a print_results_table function. Co-Authored-By: Claude Opus 4.6 <[email protected]>
a008901 to
42740cf
Compare
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.
…se borrowed types - Move print_results_table before #[cfg(test)] to fix "items after test module" lint error - Change BulkCodeMappingsRequest to use borrowed types (&str, &[T]) instead of owned types to avoid unnecessary cloning Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
romtsn
added a commit
that referenced
this pull request
Mar 24, 2026
_#skip-changelog_ Split large mapping files into batches of 300 (the backend limit) per request. Each batch is sent sequentially with progress reporting, and results are merged into a single summary. Also changes the output table to only show error rows — for large uploads (hundreds of mappings), printing every row would flood the terminal. Successful mappings are reflected in the summary counts instead. Stack: #3207 → #3208 → #3209 → **#3210** Backend PRs: getsentry/sentry#109783, getsentry/sentry#109785, getsentry/sentry#109786 --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
17 tasks
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.

#skip-changelog
Connect the
code-mappings uploadcommand to the bulk code mappings APIendpoint (
POST /api/0/organizations/{org}/code-mappings/bulk/).Adds:
bulk_upload_code_mappings()method onAuthenticatedApisrc/api/data_types/code_mappings.rsStack: #3207 → #3208 → #3209 → #3210
Backend PRs: getsentry/sentry#109783, getsentry/sentry#109785, getsentry/sentry#109786
Closes getsentry/sentry-android-gradle-plugin#1079