Skip to content

Conversation

@andreiborza
Copy link
Member

@andreiborza andreiborza commented Mar 19, 2025

Please see 511c3f3 for the relevant changes.


I also reworked how projects are passed to the CLI. Previously the CLI was invoked once per project, but I saw that sentry-cli does actually support passing multiple projects so I reworked that.

Here's a screenshot from the report email showing the two projects I specified in a private repo.

Screenshot 2025-03-19 at 16 55 49@2x


Closes: #137

@andreiborza andreiborza requested review from Lms24, chargome and szokeasaurusrex and removed request for Lms24 and chargome March 19, 2025 07:08
@andreiborza andreiborza changed the title fix: Only passes urlPrefix to sentry-cli if it's not empty fix: Only passes urlPrefix to sentry-cli if it's not empty Mar 19, 2025
@andreiborza andreiborza force-pushed the ab/avoid-sending-empty-urlPrefix branch from 48ae124 to da1a031 Compare March 19, 2025 07:12
@andreiborza andreiborza requested review from Lms24 and chargome March 19, 2025 08:00
@andreiborza andreiborza changed the title fix: Only passes urlPrefix to sentry-cli if it's not empty fix: Only pass urlPrefix to sentry-cli if it's not empty Mar 19, 2025
INPUT_DISABLE_TELEMETRY: ${{ inputs.disable_telemetry }}
INPUT_DISABLE_SAFE_DIRECTORY: ${{ inputs.disable_safe_directory }}
uses: docker://ghcr.io/getsentry/action-release-image:master
uses: docker://ghcr.io/getsentry/action-release-image:ab-avoid-sending-empty-urlPrefix
Copy link
Member

Choose a reason for hiding this comment

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

l: I guess this will be reverted before merging?

Copy link
Member

Choose a reason for hiding this comment

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

+1, seems like this should not get merged

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a github action that will revert it on master after merging.

Copy link
Member

Choose a reason for hiding this comment

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

ah okay, makes sense. Thank you for clarifying!

src/main.ts Outdated
return getCLI().uploadSourceMaps(release, sourceMapOptions);
})
);
const sourceMapsOptions: SentryCliUploadSourceMapsOptions & {
Copy link
Member

Choose a reason for hiding this comment

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

that's a nice change! I guess this improves upload speeds a bit in multi-project scenarios (?)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd guess it does, not sure by how much tho but there are over 200 orgs that use multi-project scenarios so hopefully they'll see some kind of impact.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, turns out this does not work. It only uploads source maps for the first project supplied :(

I changed it back.

Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

sentry-cli sourcemaps upload indeed only supports uploading one project at a time. I think it is possible to pass multiple projects but all except the first one are ignored. I realize this is a bad user experience (it was already this way before I took over maintaining Sentry CLI), and I would like to add support for uploading multiple projects at once, but for now, the action needs to only pass one project at a time.

INPUT_DISABLE_TELEMETRY: ${{ inputs.disable_telemetry }}
INPUT_DISABLE_SAFE_DIRECTORY: ${{ inputs.disable_safe_directory }}
uses: docker://ghcr.io/getsentry/action-release-image:master
uses: docker://ghcr.io/getsentry/action-release-image:ab-avoid-sending-empty-urlPrefix
Copy link
Member

Choose a reason for hiding this comment

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

+1, seems like this should not get merged

src/main.ts Outdated
return getCLI().uploadSourceMaps(release, sourceMapOptions);
})
);
const sourceMapsOptions: SentryCliUploadSourceMapsOptions & {
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering since I don't know much about typescript: what does this & do here?

Copy link
Member Author

Choose a reason for hiding this comment

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

It widens the type to also include projects as a key. SentryCliUploadSourceMapsOptions does not have a projects key, I assumed that's because it's not really an upload option but rather an option to sentry-cli itself so I just widen here.

core.debug(`Adding sourcemaps`);
await Promise.all(
projects.map(async project => {
// upload source maps can only do one project at a time
Copy link
Member

Choose a reason for hiding this comment

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

This is still accurate

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, will revert.

I had a look at both projects and saw that both had 4 artifacts uploaded, but upon clicking the artifacts link only one of them actually had source maps uploaded.

Project that has the uploads: https://sentry-sdks.sentry.io/explore/releases/3da6213c7f9ebf252ae055dea015b9cae688f1c9/?notification_uuid=6b722c0d-04be-4cf1-bd24-9fbd19ef7c13&project=4508602366230528

Project that shows it has 4 artifacts but when clicking on them no artifacts are to be found: https://sentry-sdks.sentry.io/explore/releases/3da6213c7f9ebf252ae055dea015b9cae688f1c9/?notification_uuid=6b722c0d-04be-4cf1-bd24-9fbd19ef7c13&project=4505545558327296

Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

@andreiborza Could you please remove da1a031 from this PR? Now that there are multiple relevant commits, it's quite difficult to review this PR with da1a031 included here

@andreiborza
Copy link
Member Author

andreiborza commented Mar 20, 2025

@szokeasaurusrex removed and reapplied. Relevant code to review is in 140c6f0 reformatting in 1f07990.

@andreiborza andreiborza force-pushed the ab/avoid-sending-empty-urlPrefix branch 2 times, most recently from 6b547a6 to 6ec3868 Compare March 20, 2025 01:27
Also lets sentry-cli handle uploading source maps for multiple projects.
@andreiborza andreiborza force-pushed the ab/avoid-sending-empty-urlPrefix branch from 6ec3868 to 1f07990 Compare March 20, 2025 01:35
Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

Looks good from CLI perspective, but since I am not super experienced in JS/TS please have a second approval before merging, from @Lms24 or someone else with JS/TS experience.

@andreiborza andreiborza merged commit a154094 into master Mar 21, 2025
19 checks passed
@andreiborza andreiborza deleted the ab/avoid-sending-empty-urlPrefix branch March 21, 2025 02:35
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.

Add ~/ as default url_prefix

4 participants