Skip to content

Fail early for exp and perf branches in main CI.#13288

Open
AR-May wants to merge 5 commits intodotnet:mainfrom
AR-May:stop-execution-of-unsupported-branches-early
Open

Fail early for exp and perf branches in main CI.#13288
AR-May wants to merge 5 commits intodotnet:mainfrom
AR-May:stop-execution-of-unsupported-branches-early

Conversation

@AR-May
Copy link
Member

@AR-May AR-May commented Feb 24, 2026

Context

If anyone runs exp/ or perf/ branch in main CI and not in the dedicated pipeline, the run will fail and it might generate a lot of issues in azdo. We can fail early to prevent it.

Changes Made

Added a validation stage that fails the pipeline when running on exp/ or perf/ branches. The build stage depends on this validation stage.
This stage is conditional and will only run (and be visible) for branches where the failure is required; it is completely skipped for all other branches.

Testing

Manually triggered a run on the exp branch with this change: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13383999&view=results

Notes

The run takes approximately 3 minutes to fail due to auto-injected steps from the pipeline template. I’m not aware of a good way to avoid this.
Since the validation stage only runs on branches that are meant to fail, there is no performance impact on normal runs, while still providing a significant improvement for exp and perf branches.

@AR-May AR-May marked this pull request as ready for review February 24, 2026 15:37
@AR-May AR-May requested a review from a team as a code owner February 24, 2026 15:37
Copilot AI review requested due to automatic review settings February 24, 2026 15:37
@JanProvaznik
Copy link
Member

arguably this is not specific to exp/ perf/ branches but anything that runs with bad config (could be that I overrode to test sign), why not the reverse - "if not on main or vs* then fail?

Copy link
Contributor

Copilot AI left a comment

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 early-fail validation stage to the main Azure DevOps pipeline to prevent running exp/ and perf/ branches in the wrong CI pipeline, reducing wasted CI time and avoiding downstream AzDO noise.

Changes:

  • Introduces a conditional branch_validation stage that fails the pipeline for refs/heads/exp/* and refs/heads/perf/*.
  • Updates the build stage dependencies so it waits on the validation stage when applicable.

.vsts-dotnet.yml Outdated
steps:
- powershell: |
$branch = "$(Build.SourceBranch)"
Write-Host "##vso[task.logissue type=error]Experimental and performance branches are not supported in this pipeline, use dedicated pipeline for experimental or performance branches."
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The error message says to "use dedicated pipeline" but doesn't identify which one. To make this actionable, include the specific pipeline name and/or the YAML definition that handles these branches (e.g. the exp/perf pipeline).

Suggested change
Write-Host "##vso[task.logissue type=error]Experimental and performance branches are not supported in this pipeline, use dedicated pipeline for experimental or performance branches."
Write-Host "##vso[task.logissue type=error]Experimental and performance branches are not supported in this pipeline. Use the dedicated exp/perf pipeline (azure-pipelines-exp-perf.yml) for experimental or performance branches."

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

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.

4 participants