Fail early for exp and perf branches in main CI.#13288
Fail early for exp and perf branches in main CI.#13288AR-May wants to merge 5 commits intodotnet:mainfrom
Conversation
|
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? |
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.
| 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).
| 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>
|
Status update: no blockers, need some time to merge it in when nothing is broken happening in the MSBuild CI. |
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.