Capture gradle stderr and stacktrace in SignalR Java client builds#67009
Open
lewing wants to merge 1 commit into
Open
Capture gradle stderr and stacktrace in SignalR Java client builds#67009lewing wants to merge 1 commit into
lewing wants to merge 1 commit into
Conversation
When the SignalR Java client gradle build fails on CI, the only signal
that reaches the binlog and AzDO timeline today is MSB3073 reporting
the gradle exit code:
error MSB3073: The command "../gradlew -Dorg.gradle.daemon=false
compileJava" exited with code 1.
Gradle's actual diagnostic output ("* What went wrong", the javac
"error:" lines, "Caused by" stack frames, etc.) is written to stderr
and is currently logged at default importance, so it does not appear in
the captured logs. That makes every compileJava flake undebuggable
without a re-run and leaves them unmatchable to Known Build Errors.
Two small changes fix this:
* eng/targets/Java.Common.props: append `--stacktrace --console=plain`
to GradleOptions on CI. `--stacktrace` makes gradle print the full
exception on failure; `--console=plain` keeps the output line-
oriented (no ANSI escapes, no overwritten progress lines).
* eng/targets/Java.Common.targets: set `StandardErrorImportance="High"`
on the two `Exec` invocations of `gradlew` (compileJava and
publishToMavenLocal) so stderr flows through MSBuild at high
importance and shows up in the binlog/console.
Default behavior is preserved for local non-CI builds (the props
changes are gated on $(ContinuousIntegrationBuild) == true) and the
exit code still drives task failure exactly as before. javac's
canonical `path:line: error:` lines remain eligible for MSBuild's
built-in error/warning classification because IgnoreStandardErrorWarningFormat is left at its default.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Improves CI diagnostics for SignalR’s Java client Gradle builds by ensuring Gradle failure details (notably stderr output and exception stack traces) are visible in MSBuild-captured logs (binlog and CI console), making intermittent compileJava failures debuggable from archived artifacts.
Changes:
- Elevate Gradle stderr logging to high importance for the Java build and pack (
publishToMavenLocal) steps so it’s captured reliably in CI logs. - On CI only, append
--stacktrace --console=plainto Gradle invocation options to produce actionable, line-oriented failure output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eng/targets/Java.Common.targets | Logs Gradle stderr at high importance for build/pack Exec steps so CI captures diagnostic output. |
| eng/targets/Java.Common.props | Adds CI-only Gradle flags to emit stack traces and plain console output for better failure diagnostics. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the SignalR Java client gradle build fails on CI (e.g.
signalr.client.java.core.javaprojcompileJavatask), the only signal that reaches the binlog and AzDO timeline is MSB3073 reporting the gradle exit code:Gradle's actual diagnostic output (
* What went wrong, thejavac error:lines,Caused bystack frames, etc.) is written to stderr but is logged at default importance, so it doesn't appear in the captured logs. The full gradle output we get in the binlog today for a failed run is literally:That makes every
compileJavaflake undebuggable without a re-run and leaves the failure signature too generic to file as a Known Build Error (since a regex onMSB3073 ... gradlew compileJavawould silently match real Java-client regressions too).Concrete instance found while triaging cross-PR CI noise: PR #66919 build 1448390 hit this on the
Test: Windows Server x64leg with no visible cause despite a complete binlog being archived.Fix
Two small, low-risk changes:
eng/targets/Java.Common.props: append--stacktrace --console=plaintoGradleOptionswhen$(ContinuousIntegrationBuild) == true.--stacktracemakes gradle print the full exception on failure.--console=plainkeeps output line-oriented (no ANSI escapes, no overwritten progress lines, which is what we want in archived CI logs).eng/targets/Java.Common.targets: setStandardErrorImportance="High"on the twoExecinvocations ofgradlew(thecompileJavabuild step and thepublishToMavenLocalpack step) so stderr flows through MSBuild at high importance and is captured in the binlog/console.Behavior preserved
$(ContinuousIntegrationBuild) == true.javac's canonicalpath:line: error:lines remain eligible for MSBuild's built-in error/warning classification becauseIgnoreStandardErrorWarningFormatis left at its default (false).Why now
Diagnosed during a sweep of recent
aspnetcore-ciPR-build failures. Of ~18 failed builds sampled, only one (#66919, 1448390) hit this specific gradle failure, but the diagnostic gap means future occurrences (and any related flake we should be quarantining or known-issue-tagging) cannot be triaged from the archived logs alone. Adding the stderr capture is a one-time "never lose the trail again" investment that costs nothing on success.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com