Consolidate minor release ruleset and fix strict mode branch detection - #10300
Open
Alexander Holstrup (aholstrup1) wants to merge 1 commit into
Open
Consolidate minor release ruleset and fix strict mode branch detection#10300Alexander Holstrup (aholstrup1) wants to merge 1 commit into
Alexander Holstrup (aholstrup1) wants to merge 1 commit into
Conversation
Point all ruleSetPathMinorRelease entries in projects.json to a new shared src/rulesets/baseminorrelease.ruleset.json (includes base.ruleset.json plus the minor-release breaking-change rules), and point all ruleSetPath entries to base.ruleset.json. Update the strict mode ruleset lookup in PreCompileApp.ps1 accordingly. Fix Get-CurrentBranch to return GITHUB_REF_NAME when set so strict mode is correctly detected on release-branch push builds, where the CI checkout is a detached HEAD and git rev-parse returns 'HEAD'. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 20d3bd9a-2fa7-49a3-b5d8-f269f9cb42c6
Alexander Holstrup (aholstrup1)
deployed
to
triage
August 17, 2026 11:57 — with
GitHub Actions
Active
Contributor
|
Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234' |
Alexander Holstrup (aholstrup1)
marked this pull request as ready for review
August 18, 2026 11:15
Alexander Holstrup (aholstrup1)
deployed
to
triage
August 18, 2026 11:15 — with
GitHub Actions
Active
Alexander Holstrup (aholstrup1)
requested review from
Maria Zhelezova (mazhelez) and
spetersenms
August 18, 2026 11:17
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.
What & why
Two related build-configuration changes for the strict mode / minor-release breaking-changes check:
Consolidate the minor-release ruleset.
build/projects.jsonhad theruleSetPathMinorReleaseproperty spread across several different files with inconsistent paths and casing, andruleSetPathlikewise pointed at multiple different files. This unifies them: everyruleSetPathMinorReleasenow points to a new sharedsrc/rulesets/baseminorrelease.ruleset.json, and everyruleSetPathpoints tosrc/rulesets/base.ruleset.json. The new ruleset includesbase.ruleset.jsonplus the minor-release breaking-change rules (AS0077, AS0078, AS0102).PreCompileApp.ps1is updated to resolve the new file name for the strict mode check.Fix strict mode detection on release-branch CI/CD. On a push build against a release branch,
Test-IsStrictModeEnabledresolved the branch viaGet-CurrentBranch, which usedgit rev-parse --abbrev-ref HEAD. In GitHub Actions the checkout is a detached HEAD, so that returns the literalHEAD, which never matches^releases/\d+\.\d+$. The result was strict mode being silently skipped on release branches (only PR builds worked, viaGITHUB_BASE_REF).Get-CurrentBranchnow returnsGITHUB_REF_NAMEwhen it is set, falling back to git only for local runs.Centralizing the fix in
Get-CurrentBranchalso corrects the same latent detached-HEAD issue in the baseline-storagemainbranch check.Linked work
Fixes #
How I validated this
What I tested and the outcome
ruleSetPathMinorReleaseand all 550ruleSetPathentries inprojects.jsonnow resolve to a single path each, and thatprojects.jsonremains valid JSON.releases/28.4now resolves toreleases/28.4and matches the strict mode regex (previouslyHEAD, no match); PR into a release branch still works viaGITHUB_BASE_REF;mainandreleases/NN.xcorrectly stay disabled (no numeric StrictMode tag).Risk & compatibility
src/rulesets/minorrelease.ruleset.jsonis now unreferenced. It was left in place in this PR; it can be removed in a follow-up if desired.