Bug 646360: Validate introduced object IDs against allowed ranges in the PR gate - #10363
Open
Chethan Thopaiah (ChethanT) wants to merge 3 commits into
Open
Bug 646360: Validate introduced object IDs against allowed ranges in the PR gate#10363Chethan Thopaiah (ChethanT) wants to merge 3 commits into
Chethan Thopaiah (ChethanT) wants to merge 3 commits into
Conversation
…the PR gate Adds a pull-request/merge-group gate check that fails when a first-party app introduces AL objects whose numeric IDs fall outside the allowed ranges (1..49999, 99000750..99001048). This prevents object ID ranges reserved for partners/ISVs from being consumed by first-party apps (the Subcontracting vs. LS Retail overlap incident). Only object signatures newly introduced relative to the PR base commit are validated, so existing objects are grandfathered even when out of range; test objects are validated separately and are excluded. All offending introduced objects (type, ID, name, path) are aggregated and reported before the build fails. Base SHA is resolved robustly for both pull_request and merge_group events, with an origin/GITHUB_BASE_REF fallback. Extension, enum and permission-set objects are included via a parameterized object-type pattern used only by the new check, so the existing duplicate/test/app-ID/manifest checks are unchanged. Adds AppObjectValidation.Test.ps1 with 38 regression tests covering range boundaries, in/out-of-range objects, unchanged/edited existing objects, renumber, rename/move, deletion, multiple aggregated failures, object-type coverage, and base-SHA resolution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Adds a pull-request / merge-group gate check (in the existing
TestObjectIdsAndManifestsaction andAppObjectValidation.psm1) that fails the build when a first-party app introduces AL objects whose numeric object IDs fall outside the allowed ranges1..49999and99000750..99001048.Root cause
The gate validated test-object ranges, duplicate object IDs, app IDs and manifests, but never validated that production object IDs stay within first-party ranges. This let the Subcontracting app be numbered into a range already assigned to and used by LS Retail; the overlap was only found later (customer case), costing ~1 week of rework.
Fix
Test-IntroducedObjectIDsAreInAllowedRangevalidates object IDs read directly from AL object declarations (notapp.json).(object type, object id)newly introduced relative to the PR base commit are checked. Existing objects are grandfathered even if out of range; test objects are excluded (validated separately). New file → checked; renumber → new signature checked; edit with same type/ID → ignored; rename/move with unchanged signature → ignored; deletion → ignored.pull_request(event.pull_request.base.sha) andmerge_group(event.merge_group.base_sha) events, with anorigin/GITHUB_BASE_REFfallback; the check is skipped gracefully outside a PR context.Test
Adds
build/scripts/tests/AppObjectValidation.Test.ps1— 38 regression tests covering range boundaries, in/out-of-range objects, unchanged & edited existing objects, renumber, rename/move, deletion, multiple aggregated failures, extension/enum/permission-set coverage, andpull_request/merge_groupbase-SHA resolution (incl. a git-backed integration test). All 38 pass; PSScriptAnalyzer clean with the repo's excluded rules.AB#646360
🤖 Generated with GitHub Copilot