- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 234
feat(sourcemaps): Multi-project sourcemaps upload #2497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces multi‐project support for sourcemaps uploads by allowing repeated use of the –project flag on the CLI. Key changes include updating the UploadContext to use a projects slice, modifying API calls to accept multiple projects, and adjusting legacy upload and command modules to work with this new interface.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
| File | Description | 
|---|---|
| src/utils/sourcemaps.rs | Updated deduplication logic to extract a single project when applicable and ensure release is provided. | 
| src/utils/file_upload.rs | Replaced the single "project" with "projects" and updated legacy upload error handling. | 
| src/api/mod.rs | Updated API signatures and doc comments to accept slices for projects. | 
| src/commands/* | Adjusted command execution code to retrieve and pass multi‐project configuration. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for some nits. Have you tested it?
e7dfc50    to
    2669216      
    Compare
  
    8700f95    to
    5b8e333      
    Compare
  
    2669216    to
    813fa81      
    Compare
  
    5b8e333    to
    2158289      
    Compare
  
    | Hey @loewenheim, I have tested this. As an example, see the following artifact bundle, which I uploaded with  | 
2158289    to
    6c01bae      
    Compare
  
    1bb1afc    to
    f540dc1      
    Compare
  
    6c01bae    to
    2c4b144      
    Compare
  
    It is now possible to upload sourcemaps to multiple projects at once, by passing the `-p`/`--project` flag multiple times to the `sentry-cli sourcemaps upload` command. Previously, it was possible to specify multiple projects via this flag, but all but the first project were ignored. Multi-project sourcemaps uploads only work for Sentry servers which support chunked uploads – since this feature was added quite some time ago, we expect most self-hosted Sentry instances will support this. Older versions of Sentry continue to only support single-project uploads, but now, instead of silently ignoring all but the first project, an error is returned. Closes #2408
2c4b144    to
    dbf29b1      
    Compare
  
    | let project = match projects { | ||
| [] => None, | ||
| [project] => Some(project.as_str()), | ||
| [_, _, ..] => Err(LegacyUploadContextError::ProjectMultiple)?, | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern could also be _ but actually makes sense this way, because it clarifies that the list has at least two elements.
It is now possible to upload sourcemaps to multiple projects at once, by passing the
-p/--projectflag multiple times to thesentry-cli sourcemaps uploadcommand. Previously, it was possible to specify multiple projects via this flag, but all but the first project were ignored.Multi-project sourcemaps uploads only work for Sentry servers which support chunked uploads – since this feature was added quite some time ago, we expect most self-hosted Sentry instances will support this. Older versions of Sentry continue to only support single-project uploads, but now, instead of silently ignoring all but the first project, an error is returned.
Closes #2408