Repository navigation
Use BCPlatform version from Packages.json in NewDevEnv - #9032
Maria Zhelezova (mazhelez) wants to merge 10 commits into
Conversation
NewDevEnv created the dev container and compiler folder by calling New-BcContainer / New-BcCompilerFolder directly, bypassing the AL-Go override scripts that inject the platformArtifactUrl from the BCPlatform version pinned in build/Packages.json. As a result NewDevEnv ignored the configured platform version. Add a reusable Get-BCPlatformArtifactUrl helper to PlatformHelper.psm1 and use it in NewDevEnv.psm1 so both the container and compiler folder honor the pinned BCPlatform version. Refactor the NewBcContainer.ps1 and PreNewBcCompilerFolder.ps1 override scripts to use the shared helper, and add tests for it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
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' |
Copilot PR ReviewIteration 1 · Outcome: not-applicable
Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 No findings were posted for this iteration. Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
Merge the two fullBuildPatterns arrays into one. Having duplicate JSON keys caused PowerShell's ConvertFrom-Json to use only the last value (["src/Layers/*"]), losing the build/*, src/rulesets/*, and workflow patterns. This broke 6 BuildOptimization PS tests in CI.
|
Please fix this alert: |
Fixed by declaring |
|
Copilot resolve the merge conflicts in this pull request |
…v-bcplatform-version # Conflicts: # .github/AL-Go-Settings.json
Merge conflicts resolved in |
Remove the standalone Get-PlatformVersionUrl helper since it had no independent production caller and the extra indirection was confusing. Its validation and URL formatting now live directly in Get-BCPlatformArtifactUrl. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a438d803-37a3-4dd1-9478-d45bf6c35b7f
|
There was a problem hiding this comment.
🟡 Changes recommended
The persistent compiler cache can bypass the configured platform version and reuse an outdated compiler.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates NewDevEnv to honor the BCPlatform version pinned in Packages.json.
Changes:
- Adds a shared platform artifact URL helper.
- Applies the pinned platform to container/compiler creation.
- Adds Pester coverage for URL resolution.
File summaries
| File | Description |
|---|---|
build/scripts/PlatformHelper.psm1 |
Adds shared platform URL resolution. |
build/scripts/tests/PlatformHelper.Test.ps1 |
Tests platform URL behavior. |
build/scripts/NewBcContainer.ps1 |
Uses the shared helper. |
build/scripts/PreNewBcCompilerFolder.ps1 |
Uses the shared helper. |
build/scripts/DevEnv/NewDevEnv.psm1 |
Applies the pinned platform in NewDevEnv. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
CreateCompilerFolder returned the persisted CompilerFolder whenever it existed, so a change to the BCPlatform version in Packages.json was ignored and an outdated compiler kept being reused. Record the resolved platform artifact URL in a marker file and recreate the cached folder when the configured version differs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
|
AB#658052 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
|
Copilot please resolve the merge conflicts |
…v-bcplatform-version # Conflicts: # build/scripts/NewBcContainer.ps1 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
What & why
NewDevEnv was not honoring the
BCPlatformversion pinned inbuild/Packages.json. The reason is thatbuild/scripts/DevEnv/NewDevEnv.psm1creates the dev container (New-BcContainer) and the compiler folder (New-BcCompilerFolder) directly, which bypasses the AL-Go override scripts (NewBcContainer.ps1/PreNewBcCompilerFolder.ps1) that inject theplatformArtifactUrlderived from the configured BCPlatform version. As a result a NewDevEnv container/compiler always used the platform shipped with the artifact instead of the pinned platform.This change makes NewDevEnv apply the same platform version that the CI/AL-Go path already uses. The compiler-folder cache records the resolved platform artifact URL and is recreated when that URL changes, including when the platform pin is added or removed.
Linked work
Fixes AB#658052
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
mainon November 5, 2026, ranInvoke-Pester -Path .\build\scripts\tests\PlatformHelper.Test.ps1 -PassThru: passed, 14 tests, 0 failures. Coverage includes full-version URL resolution, major.minor resolution, no configured platform, unavailable versions, and platform-index caching.Risk & compatibility
The new behavior only sets
platformArtifactUrlwhen aBCPlatformversion is configured inPackages.json; when it is absent the helper returns$nulland container/compiler creation uses the existing default platform. Changing or removing the pin invalidates the cached compiler folder. The two AL-Go override scripts were refactored to call the shared helper, so their platform-selection behavior is functionally identical (deduplication only).