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

Fix Sentry CLI arguments when using custom URL or auth token parameters #2259

Merged
merged 2 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- Normalize StackFrame in-app resolution for modules & function prefixes ([#2234](https://github.com/getsentry/sentry-dotnet/pull/2234))
- Calling `AddAspNet` more than once should not block all errors from being sent ([#2253](https://github.com/getsentry/sentry-dotnet/pull/2253))
- Fix Sentry CLI arguments when using custom URL or auth token parameters ([#2259](https://github.com/getsentry/sentry-dotnet/pull/2259))

### Dependencies

Expand Down
19 changes: 12 additions & 7 deletions src/Sentry/buildTransitive/Sentry.targets
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
The defaults can be set either via config file, or environment variables, per: https://docs.sentry.io/product/cli/configuration/
-->
<PropertyGroup>
<SentryCLIOptions Condition="'$(SentryApiKey)' != ''">$(SentryCLIOptions) --api-key $(SentryApiKey)</SentryCLIOptions>
<SentryCLIOptions Condition="'$(SentryAuthToken)' != ''">$(SentryCLIOptions) --auth-token $(SentryAuthToken)</SentryCLIOptions>
<SentryCLIOptions Condition="'$(SentryUrl)' != ''">$(SentryCLIOptions) --url $(SentryUrl)</SentryCLIOptions>
<SentryCLIBaseOptions Condition="'$(SentryApiKey)' != ''">$(SentryCLIBaseOptions) --api-key $(SentryApiKey)</SentryCLIBaseOptions>
<SentryCLIBaseOptions Condition="'$(SentryAuthToken)' != ''">$(SentryCLIBaseOptions) --auth-token $(SentryAuthToken)</SentryCLIBaseOptions>
<SentryCLIBaseOptions Condition="'$(SentryUrl)' != ''">$(SentryCLIBaseOptions) --url $(SentryUrl)</SentryCLIBaseOptions>
<SentryCLIOptions Condition="'$(SentryOrg)' != ''">$(SentryCLIOptions) --org $(SentryOrg)</SentryCLIOptions>
<SentryCLIOptions Condition="'$(SentryProject)' != ''">$(SentryCLIOptions) --project $(SentryProject)</SentryCLIOptions>
</PropertyGroup>
Expand Down Expand Up @@ -86,7 +86,12 @@
</PropertyGroup>

<PropertyGroup Condition="'$(SentryCLI)' != ''">
<_SentryCLICommand>&quot;$(SentryCLI)&quot; info</_SentryCLICommand>
<_SentryCLIBaseCommand>&quot;$(SentryCLI)&quot;</_SentryCLIBaseCommand>
<_SentryCLIBaseCommand Condition="'$(SentryCLIBaseOptions)' != ''">$(_SentryCLIBaseCommand) $(SentryCLIBaseOptions)</_SentryCLIBaseCommand>
</PropertyGroup>

<PropertyGroup Condition="'$(SentryCLI)' != ''">
<_SentryCLICommand>$(_SentryCLIBaseCommand) info</_SentryCLICommand>
<_SentryCLICommand Condition="'$(SentryOrg)' != '' And '$(SentryProject)' != ''">$(_SentryCLICommand) --no-defaults</_SentryCLICommand>
</PropertyGroup>
<Exec Condition="'$(SentryCLI)' != ''" Command="$(_SentryCLICommand)" IgnoreExitCode="true" ConsoleToMsBuild="true" StandardOutputImportance="Low">
Expand Down Expand Up @@ -123,7 +128,7 @@
Text="Preparing to upload debug symbols and sources to Sentry for $(MSBuildProjectName) ($(Configuration)/$(TargetFramework))" />

<PropertyGroup>
<_SentryCLICommand>&quot;$(SentryCLI)&quot; dif upload</_SentryCLICommand>
<_SentryCLICommand>$(_SentryCLIBaseCommand) dif upload</_SentryCLICommand>
<_SentryCLICommand Condition="'$(SentryCLIOptions.Trim())' != ''">$(_SentryCLICommand) $(SentryCLIOptions.Trim())</_SentryCLICommand>
<_SentryCLICommand Condition="'$(SentryUploadSources)' == 'true'">$(_SentryCLICommand) --include-sources</_SentryCLICommand>
<_SentryCLICommand>$(_SentryCLICommand) $(IntermediateOutputPath)</_SentryCLICommand>
Expand Down Expand Up @@ -157,12 +162,12 @@
</PropertyGroup>

<PropertyGroup>
<_SentryCLICommand>&quot;$(SentryCLI)&quot; dif bundle-sources $(_SentryDebugInfoFile)</_SentryCLICommand>
<_SentryCLICommand>$(_SentryCLIBaseCommand) dif bundle-sources $(_SentryDebugInfoFile)</_SentryCLICommand>
</PropertyGroup>
<Exec Command="$(_SentryCLICommand)" IgnoreExitCode="true" ContinueOnError="WarnAndContinue" />

<PropertyGroup>
<_SentryCLICommand>&quot;$(SentryCLI)&quot; dif upload</_SentryCLICommand>
<_SentryCLICommand>$(_SentryCLIBaseCommand) dif upload</_SentryCLICommand>
<_SentryCLICommand Condition="'$(SentryCLIOptions.Trim())' != ''">$(_SentryCLICommand) $(SentryCLIOptions.Trim())</_SentryCLICommand>
<_SentryCLICommand>$(_SentryCLICommand) $(_SentrySourceBundle)</_SentryCLICommand>
</PropertyGroup>
Expand Down