Skip to content
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

Creating a release through Sentry in MSBuild results in incorrect release name #4005

Open
huynhsontung opened this issue Feb 27, 2025 · 5 comments · May be fixed by #4015
Open

Creating a release through Sentry in MSBuild results in incorrect release name #4005

huynhsontung opened this issue Feb 27, 2025 · 5 comments · May be fixed by #4015

Comments

@huynhsontung
Copy link

Package

Sentry

.NET Flavor

Other

.NET Version

UWP

OS

Windows

SDK Version

5.1.1

Self-Hosted Sentry Version

25.1.0

Steps to Reproduce

Build an application with MSBuild with [email protected] and -p:SentryCreateRelease=true. I build and release my app in GitHub Actions. The full step can be found here: https://github.com/huynhsontung/Screenbox/blob/3b1d40519a1215d63cc97d3fa7ac0b8ea8ca449a/.github/workflows/main.yml#L75

Expected Result

For the package name and version to not have extra quotes. In my case package should be screenbox and version should be 0.15.0

Actual Result

The new version has a single quote ' suffix, and the package name has a single quote ' prefix. Package is 'screenbox and version is 0.15.0'.

Image

@huynhsontung
Copy link
Author

huynhsontung commented Feb 27, 2025

I suspect this is because of the single quote in the Exec task.

Command="$(SentryCLIBaseCommand) releases new '$(_SentryRelease)' $(SentryReleaseOptions)"

From the msbuild docs, exec relies on Command Prompt to invoke the command. Command prompt doesn't remove quotes from variables by default. Maybe it's related?

@bruno-garcia
Copy link
Member

Thanks for raising this. Seems like you're right.

Is this something you could put up a PR to help fix?

@huynhsontung
Copy link
Author

huynhsontung commented Feb 28, 2025

Absolutely! After looking at how Command Prompt deals with quotes, I think the easiest solution is to just remove the quotes in question. A release name shouldn't have spaces or special characters anyway. Do you have any concerns with this approach?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 28, 2025
@bruno-garcia
Copy link
Member

bruno-garcia commented Feb 28, 2025

thanks! no concerns. I mean it's a good point that we should check if all valid characters defined in release (https://docs.sentry.io/cli/releases/ ) will work in linux mac and windows when running the cli via msbuild. But we have CI already set up in all of these OSs so should be OK.

We had tests for symbol upload I think so we could check if the right release string is sent, in our "fake server".
@vaind do we have that stuff set up on this repo? any pointers if so?

@vaind
Copy link
Collaborator

vaind commented Feb 28, 2025

We do have a set of Pester-based integration tests: https://github.com/getsentry/sentry-dotnet/tree/main/integration-test

They import a common sentry-CLI integration-test module from https://github.com/getsentry/github-workflows/tree/main/sentry-cli/integration-test but the server there currently doesn't do anything for releases: https://github.com/getsentry/github-workflows/blob/main/sentry-cli/integration-test/sentry-server.py#L79 because it was originally aimed at verifying we upload debug symbols correctly, nothing else. It's possible to extend tests to verify this too - whether it's worth it in this case (i.e. the chance of this regressing is high enough), I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants