Fix $mask variable mutation in GetDependencies inner loop#2247
Open
Copilot wants to merge 5 commits into
Open
Conversation
The outer foreach loop variable $mask was being reassigned inside the inner foreach loop when prepending the buildMode. This caused incorrect artifact mask names when iterating over multiple dependencies with different build modes. Introduced a local $currentMask variable to preserve the original $mask value across inner loop iterations. Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/57de4c0d-e2ce-40ca-9c16-0cd1503b3c8f Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix bug in AL-Go's GetDependencies function
Fix May 11, 2026
$mask variable mutation in GetDependencies inner loop
Collaborator
|
@copilot awesome! Please include release notes. |
Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/36cbe5be-4091-488a-af40-a744e4c0694a Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Contributor
Author
mazhelez
approved these changes
May 11, 2026
Collaborator
|
@copilot for the release notes, can you please follow the pattern and include the issue number? |
Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/4f3c6851-daf2-47cc-87de-59971993664f Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes a bug in GetDependencies where the artifact mask string was being mutated across inner-loop iterations, leading to incorrect artifact name masks when multiple dependency probing paths use different buildMode values.
Changes:
- Introduces a per-iteration
$currentMaskto prevent mutation of the outer$maskvariable. - Updates all inner-loop usages to reference
$currentMaskinstead of$mask. - Adds a release note entry documenting the issue and fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| RELEASENOTES.md | Documents the fixed GetDependencies mask prefix leak (Issue 2236). |
| Actions/Github-Helper.psm1 | Stops mutating the outer $mask by switching inner-loop logic to a local $currentMask. |
aholstrup1
approved these changes
May 19, 2026
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 & How
GetDependenciesmutates the outerforeach($mask in $masks)loop variable inside the innerforeach($dependency in $probingPathsJson)loop when prependingbuildMode. This causes the mask to accumulate prefixes across dependency iterations:Introduced a local
$currentMaskvariable initialized from$maskat the top of the inner loop. All inner-loop references now use$currentMask, leaving the outer loop variable untouched.Related to issue: #2236
✅ Checklist