Description
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.