Skip to content

fix: builds no longer fail when symbol upload or release creation is enabled but no Sentry auth token is available - #5705

Merged
ric-oliv merged 1 commit into
mainfrom
fix/msbuild-no-auth-token
Oct 12, 2026
Merged

ric-oliv merged 1 commit into
mainfrom
fix/msbuild-no-auth-token

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

PrepareSentryCLI runs sentry-cli info to decide whether the CLI is configured, and skips uploads and release creation if it isn't. Since sentry-cli 2.30.0 (#3203), info prints error: Auth token is required… when there's no token, or error: API request failed when the token is bad or the server can't be reached. The probe's Exec ignored the exit code but still parsed that line as an MSBuild error, so the build failed before the skip could happen. That broke every build with SentryUploadSymbols, SentryUploadSources or SentryCreateRelease enabled and no token: fork PRs, local Release builds, and docker build without the secret.

  • The probe sets IgnoreStandardErrorWarningFormat="true", so a failing info falls through to the existing skip logic.
  • The probe's stderr is logged at normal importance. A successful build no longer prints the CLI's error: … and "Please attach the full debug log" lines at the default verbosity.
  • The skip message and warning now say that uploads and release creation are skipped.

Closes #5704

Notes for review

  • An invalid or expired token, or an unreachable server, now gives the existing "Sentry API request failed" warning and a successful build, rather than a failed build. That was what the warning was there for, but anyone relying on the failure will notice. -warnaserror still fails the build.
  • The release-creation tests now pass the CLI stub to MSBuild through an environment variable rather than /p:SentryCLI. The targets can't clear a global property, so the skip path couldn't be tested the old way. The new cases fail without the fix.

🤖 Generated with Claude Code

PrepareSentryCLI probes with `sentry-cli info` and skips uploads and release creation when it
fails. Since sentry-cli 2.30.0 that command prints `error: ...` when it has no token (or the API
request fails), and MSBuild parsed that line as a build error despite IgnoreExitCode, so the
build failed before the skip could take effect.

Fixes #5704

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.22%. Comparing base (f5891ee) to head (fb3638b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5705   +/-   ##
=======================================
  Coverage   75.22%   75.22%           
=======================================
  Files         516      516           
  Lines       19022    19022           
  Branches     3698     3698           
=======================================
+ Hits        14309    14310    +1     
+ Misses       3858     3857    -1     
  Partials      855      855           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell
jamescrosswell marked this pull request as ready for review October 12, 2026 03:39
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 12, 2026
@ric-oliv
ric-oliv merged commit deada1c into main Oct 12, 2026
67 of 69 checks passed
@ric-oliv
ric-oliv deleted the fix/msbuild-no-auth-token branch October 12, 2026 08:55
This was referenced Oct 13, 2026
This was referenced Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSBuild integration fails the build when no Sentry auth token is available

2 participants