Repository navigation
Add disablePipelineSetResult switch to build/tools scripts - #17122
Merged
ViktorHofer merged 3 commits intoJul 15, 2026
Merged
Conversation
Adds an opt-in switch to disable masking the actual exit code via Write-PipelineSetResult when a build fails in Azure Pipelines, allowing the real msbuild exit code to propagate. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in disablePipelineSetResult switch to the common build entrypoints to allow Azure Pipelines runs to propagate the real MSBuild exit code (instead of marking the task failed via Write-PipelineSetResult and exiting 0 to reduce duplicate log noise).
Changes:
- Add
--disablePipelineSetResult/-disablePipelineSetResultoption toeng/common/build.shandeng/common/build.ps1usage and argument parsing. - Introduce
disable_pipeline_set_result/$disablePipelineSetResultineng/common/tools.shandeng/common/tools.ps1. - Gate the MSBuild failure path’s
Write-PipelineSetResult+ exit-code masking on the new flag.
Show a summary per file
| File | Description |
|---|---|
| eng/common/tools.sh | Adds disable_pipeline_set_result and uses it to gate Azure Pipelines set-result behavior in MSBuild. |
| eng/common/tools.ps1 | Adds $disablePipelineSetResult and uses it to gate Azure Pipelines set-result behavior in MSBuild. |
| eng/common/build.sh | Adds CLI switch + usage text and sets disable_pipeline_set_result for common tools. |
| eng/common/build.ps1 | Adds CLI switch + usage text so tools can honor $disablePipelineSetResult. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 3
Address PR feedback: apply the switch consistently to both the MSBuild and DotNet failure paths. Co-authored-by: Copilot <[email protected]>
Member
Author
|
Thanks for the review. Addressed the main point in 7cd5497: the switch now gates both the MSBuild and DotNet failure paths consistently. Left \\ unquoted to stay consistent with the surrounding existing conditions (it's safe inside [[ ]]). |
Co-authored-by: Copilot <[email protected]>
AlesProkop
approved these changes
Jul 15, 2026
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.
Adds a new opt-in
-disablePipelineSetResult/--disablePipelineSetResultswitch to thebuildandtoolsscripts (both PowerShell and shell variants).When a build fails in Azure Pipelines, the
MSBuildhelper currently callsWrite-PipelineSetResult -Result Failedand then exits with code 0 to avoid double-logging noise. This masks the real msbuild exit code. This switch lets callers opt out of that masking so the actual exit code propagates.build.ps1/build.sh: add switch + usage texttools.ps1/tools.sh: add the variable (defaulting to false) and gate theMSBuildWrite-PipelineSetResultcall on itBehavior is unchanged unless the new switch is explicitly passed.