Skip to content

Support uploading sourcemaps to multiple projects #2408

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

Closed
szokeasaurusrex opened this issue Mar 3, 2025 · 0 comments
Closed

Support uploading sourcemaps to multiple projects #2408

szokeasaurusrex opened this issue Mar 3, 2025 · 0 comments
Assignees
Labels
CLI Product area Feature Issue type

Comments

@szokeasaurusrex
Copy link
Member

Currently, it is only possible to upload sourcemaps to a single project at a time. However, the Sentry HTTP API which we use to upload sourcemaps supports associating the uploaded sourcemaps with multiple projects, and so, we would like to enable this functionality in Sentry CLI.

Solution brainstorm

It is already possible to provide multiple projects to a Sentry CLI command by passing the -p or --project argument multiple times, like so:

sentry-cli sourcemaps upload -p proj1 -p proj2 ...

However, the sentry-cli sourcemaps upload command only takes the first project provided (see Config::get_org_and_project and Config::get_project methods), the rest of the projects passed are ignored.

Instead, let's use Config::get_projects (note: plural) to get all of the projects passed. Then, modify the UploadContext struct to store multiple projects, instead of just a single project, and pass all of these projects in the HTTP request we make to Sentry.

@a-hariti a-hariti self-assigned this Mar 5, 2025
@linear linear bot added Feature Issue type SDKs (New) labels Apr 7, 2025
@stephanie-anderson stephanie-anderson added the CLI Product area label Apr 25, 2025
szokeasaurusrex added a commit that referenced this issue May 7, 2025
Legacy (i.e. non-chunked) are distinct from chunked uploads, so it makes sense to have a separate struct to enforce these differences via the type system.

Specifically, legacy uploads must be associated with a release, whereas this is not required for many chunk uploads. Legacy uploads must also be associated with at most one project, whereas chunked uploads can have multiple projects (support for which we will add in the CLI with #2408)
szokeasaurusrex added a commit that referenced this issue May 7, 2025
Legacy (i.e. non-chunked) are distinct from chunked uploads, so it makes sense to have a separate struct to enforce these differences via the type system.

Specifically, legacy uploads must be associated with a release, whereas this is not required for many chunk uploads. Legacy uploads must also be associated with at most one project, whereas chunked uploads can have multiple projects (support for which we will add in the CLI with #2408)
szokeasaurusrex added a commit that referenced this issue May 7, 2025
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
szokeasaurusrex added a commit that referenced this issue May 8, 2025
Legacy (i.e. non-chunked) are distinct from chunked uploads, so it makes sense to have a separate struct to enforce these differences via the type system.

Specifically, legacy uploads must be associated with a release, whereas this is not required for many chunk uploads. Legacy uploads must also be associated with at most one project, whereas chunked uploads can have multiple projects (support for which we will add in the CLI with #2408)
szokeasaurusrex added a commit that referenced this issue May 8, 2025
Legacy (i.e. non-chunked) are distinct from chunked uploads, so it makes sense to have a separate struct to enforce these differences via the type system.

Specifically, legacy uploads must be associated with a release, whereas this is not required for many chunk uploads. Legacy uploads must also be associated with at most one project, whereas chunked uploads can have multiple projects (support for which we will add in the CLI with #2408)
szokeasaurusrex added a commit that referenced this issue May 8, 2025
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
szokeasaurusrex added a commit that referenced this issue May 8, 2025
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
szokeasaurusrex added a commit that referenced this issue May 8, 2025
Legacy (i.e. non-chunked) are distinct from chunked uploads, so it makes sense to have a separate struct to enforce these differences via the type system.

Specifically, legacy uploads must be associated with a release, whereas this is not required for many chunk uploads. Legacy uploads must also be associated with at most one project, whereas chunked uploads can have multiple projects (support for which we will add in the CLI with #2408)
szokeasaurusrex added a commit that referenced this issue May 8, 2025
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
szokeasaurusrex added a commit that referenced this issue May 8, 2025
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
szokeasaurusrex added a commit that referenced this issue May 8, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Product area Feature Issue type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants