Skip to content

Consolidate minor release ruleset and fix strict mode branch detection - #10300

Open
Alexander Holstrup (aholstrup1) wants to merge 1 commit into
mainfrom
aholstrup1-verbose-dollop
Open

Consolidate minor release ruleset and fix strict mode branch detection#10300
Alexander Holstrup (aholstrup1) wants to merge 1 commit into
mainfrom
aholstrup1-verbose-dollop

Conversation

@aholstrup1

@aholstrup1 Alexander Holstrup (aholstrup1) commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What & why

Two related build-configuration changes for the strict mode / minor-release breaking-changes check:

  1. Consolidate the minor-release ruleset. build/projects.json had the ruleSetPathMinorRelease property spread across several different files with inconsistent paths and casing, and ruleSetPath likewise pointed at multiple different files. This unifies them: every ruleSetPathMinorRelease now points to a new shared src/rulesets/baseminorrelease.ruleset.json, and every ruleSetPath points to src/rulesets/base.ruleset.json. The new ruleset includes base.ruleset.json plus the minor-release breaking-change rules (AS0077, AS0078, AS0102). PreCompileApp.ps1 is updated to resolve the new file name for the strict mode check.

  2. Fix strict mode detection on release-branch CI/CD. On a push build against a release branch, Test-IsStrictModeEnabled resolved the branch via Get-CurrentBranch, which used git rev-parse --abbrev-ref HEAD. In GitHub Actions the checkout is a detached HEAD, so that returns the literal HEAD, which never matches ^releases/\d+\.\d+$. The result was strict mode being silently skipped on release branches (only PR builds worked, via GITHUB_BASE_REF). Get-CurrentBranch now returns GITHUB_REF_NAME when it is set, falling back to git only for local runs.

Centralizing the fix in Get-CurrentBranch also corrects the same latent detached-HEAD issue in the baseline-storage main branch check.

Linked work

Fixes #

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • Verified all 493 ruleSetPathMinorRelease and all 550 ruleSetPath entries in projects.json now resolve to a single path each, and that projects.json remains valid JSON.
  • Parse-checked the edited PowerShell modules.
  • Simulated branch resolution: push on releases/28.4 now resolves to releases/28.4 and matches the strict mode regex (previously HEAD, no match); PR into a release branch still works via GITHUB_BASE_REF; main and releases/NN.x correctly stay disabled (no numeric StrictMode tag).
  • No AL tests added; changes are build-script/config only.

Risk & compatibility

  • Behavior change: strict mode breaking-changes validation will now actually run on release-branch push builds where it was previously being skipped. This is the intended fix, but it may surface breaking-change analyzer errors that were not being reported before.
  • The old src/rulesets/minorrelease.ruleset.json is now unreferenced. It was left in place in this PR; it can be removed in a follow-up if desired.

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
@github-actions github-actions Bot added Build: scripts & configs Build scripts and configuration files Other GitHub request for other area than SCM, Finance or Integration Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction labels Aug 17, 2026
@github-actions

Copy link
Copy Markdown
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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build: scripts & configs Build scripts and configuration files Other GitHub request for other area than SCM, Finance or Integration Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant