Skip to content

Cannot finalize releases with MSBuild integration #4108

Open
@martincostello

Description

@martincostello

Package

Sentry

.NET Flavor

.NET

.NET Version

9.0.203

OS

Any (not platform specific)

OS Version

No response

Development Environment

Visual Studio v17.x

SDK Version

5.5.1

Self-Hosted Sentry Version

No response

Workload Versions

N/A

UseSentry or SentrySdk.Init call

N/A

Steps to Reproduce

Set the following properties in a .csproj file, along with the appropriate Sentry CLI token and then build a project:

<PropertyGroup>
  <SentryCreateRelease>true</SentryCreateRelease>
  <SentryOrg>your-org</SentryOrg>
  <SentryProject>your-project</SentryProject>
  <SentryReleaseOptions>--finalize</SentryReleaseOptions>
  <SentrySetCommits>true</SentrySetCommits>
  <SentryUploadSymbols>true</SentryUploadSymbols>
</PropertyGroup>

It appears that there isn't a way to pass an option through to releases new without that option also being passed through to releases set-commits:

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

Command="$(SentryCLIBaseCommand) releases set-commits $(SentrySetCommitOptions) $(_SentryRelease) $(SentryReleaseOptions)"

I guess the invocation needs its own additional MSBuild property like set-commits has SentrySetCommitOptions?

Expected Result

The build succeeds and the release is finalized.

Actual Result

The release is created and finalized, but the build fails when setting the commits:

Preparing upload to Sentry for project 'your-project' (Release/net9.0): collecting debug symbols from /home/runner/work/your-project/your-project/artifacts/bin/your-project/release_linux-x64/
  > Found 12 debug information files (12 with embedded sources)
  > Prepared debug information files for upload
  > Uploaded 1 missing debug information file
  > File upload complete:
  
    UPLOADED ab76929d-9ffa-49a3-af46-52203aed3219-9644ee01 (your-project.pdb;  debug companion)
  Getting Sentry Release...
  Sentry Release: [email protected]
  Creating Sentry Release: [email protected]
  Created release [email protected]
  Setting Sentry commits
EXEC : error : unexpected argument '--finalize' found [/home/runner/work/your-project/your-project/src/your-project/your-project.csproj]
  
    tip: to pass '--finalize' as a value, use '-- --finalize'
  
  Usage: sentry-cli-Linux-x86_64 releases set-commits --auto <VERSION>
  
  For more information, try '--help'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingGood First IssueGood for newcomers

    Type

    No type

    Projects

    Status

    No status

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions