Skip to content

Add disablePipelineSetResult switch to build/tools scripts - #17122

Merged
ViktorHofer merged 3 commits into
dotnet:mainfrom
ViktorHofer:disable-pipeline-set-result
Jul 15, 2026
Merged

ViktorHofer merged 3 commits into
dotnet:mainfrom
ViktorHofer:disable-pipeline-set-result

Conversation

@ViktorHofer

Copy link
Copy Markdown
Member

Adds a new opt-in -disablePipelineSetResult / --disablePipelineSetResult switch to the build and tools scripts (both PowerShell and shell variants).

When a build fails in Azure Pipelines, the MSBuild helper currently calls Write-PipelineSetResult -Result Failed and 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 text
  • tools.ps1 / tools.sh: add the variable (defaulting to false) and gate the MSBuild Write-PipelineSetResult call on it

Behavior is unchanged unless the new switch is explicitly passed.

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]>
Copilot AI review requested due to automatic review settings July 15, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / -disablePipelineSetResult option to eng/common/build.sh and eng/common/build.ps1 usage and argument parsing.
  • Introduce disable_pipeline_set_result / $disablePipelineSetResult in eng/common/tools.sh and eng/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

Comment thread eng/common/tools.sh Resolved
Comment thread eng/common/tools.sh Resolved
Comment thread eng/common/tools.ps1 Resolved
Address PR feedback: apply the switch consistently to both the MSBuild and DotNet failure paths.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 15, 2026 13:58
@ViktorHofer

Copy link
Copy Markdown
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 [[ ]]).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 2

Comment thread eng/common/tools.sh Resolved
Comment thread eng/common/tools.ps1 Resolved
Copilot AI review requested due to automatic review settings July 15, 2026 14:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new

@ViktorHofer
ViktorHofer requested a review from AlesProkop July 15, 2026 14:21
@ViktorHofer
ViktorHofer enabled auto-merge (squash) July 15, 2026 14:37
@ViktorHofer
ViktorHofer merged commit 6560da5 into dotnet:main Jul 15, 2026
9 of 10 checks passed
@ViktorHofer
ViktorHofer deleted the disable-pipeline-set-result branch July 15, 2026 15:37
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants