Repository navigation
Pipeline: fix loc/notice PR base branch for non-master runs - #40510
Merged
Ben Hillis (benhillis) merged 1 commit intoMay 12, 2026
Merged
Conversation
Both wsl-build-nightly-localization.yml and wsl-build-notice.yml derived
the PR target branch from Build.SourceBranchName, which Azure DevOps
documents as the leaf segment after the last '/' in the source ref. For
refs/heads/master that happens to round-trip ('master'), so scheduled
runs work; but a manual queue against any branch with slashes (e.g.
user/benhill/loc-pipeline-debug) sends only the leaf
('loc-pipeline-debug') as the PR base, which GitHub rejects with 422
Validation Failed: base invalid.
This is the same bug PR #14492 introduced when it parameterized the
target branch -- the truncation case was never exercised because the
real schedule only runs on master.
Use Build.SourceBranch and strip the 'refs/heads/' prefix at runtime so
the full branch name is preserved. master nightlies are unaffected
('refs/heads/master' -> 'master').
Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the targetBranch value used by the nightly localization and notice pipelines when manually queued against branches that contain /, ensuring the GitHub PR “base” branch is valid and matches the full branch name.
Changes:
- Switch
targetBranchderivation fromBuild.SourceBranchName(leaf-only) toBuild.SourceBranchwithrefs/heads/stripped. - Add an inline comment in the localization pipeline explaining the truncation issue and why the new logic is required.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.pipelines/wsl-build-notice.yml |
Computes targetBranch from the full source ref to preserve slash-containing branch names for PR creation. |
.pipelines/wsl-build-nightly-localization.yml |
Same targetBranch fix as notice pipeline, plus added documentation explaining the 422 base-branch failure mode. |
Blue (OneBlue)
approved these changes
May 12, 2026
Ben Hillis (benhillis)
enabled auto-merge (squash)
May 12, 2026 20:15
Ben Hillis (benhillis)
deleted the
user/benhill/fix-loc-pipeline-target-branch
branch
May 12, 2026 21:26
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.
The nightly localization and notice pipelines derived the PR target branch from
Build.SourceBranchName, which Azure DevOps documents as the leaf segment after the last/in the source ref. Forrefs/heads/masterthat round-trips (master), so scheduled runs work — but a manual queue against any branch with slashes (e.g.user/benhill/loc-pipeline-debug) sends only the leaf as the PR base, which GitHub rejects with:This was surfaced by manually queueing
wsl-build-nightly-localizationagainstuser/benhill/loc-pipeline-debugwith diagnostic instrumentation increate-change.py(separate branch). The pipeline POSTed"base": "loc-pipeline-debug"instead of"base": "user/benhill/loc-pipeline-debug".Same bug exists in
wsl-build-notice.yml(the line was copy-pasted in #14492 when the target branch was first parameterized) — the truncation case had simply never been exercised because the schedule only runs on master.Fix: derive
targetBranchfromBuild.SourceBranchand strip therefs/heads/prefix at runtime so the full branch name is preserved. master nightlies are unaffected (refs/heads/master->master).