Fail early for exp and perf branches in main CI.#13288
Open
AR-May wants to merge 5 commits intodotnet:mainfrom
Open
Fail early for exp and perf branches in main CI.#13288AR-May wants to merge 5 commits intodotnet:mainfrom
AR-May wants to merge 5 commits intodotnet:mainfrom
Conversation
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? |
Contributor
There was a problem hiding this comment.
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_validationstage that fails the pipeline forrefs/heads/exp/*andrefs/heads/perf/*. - Updates the
buildstage 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." |
There was a problem hiding this comment.
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." |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
JanProvaznik
approved these changes
Mar 2, 2026
rainersigwald
approved these changes
Mar 5, 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.
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.