You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve file handling in Update AL-Go System Files - #2273
Custom-template customALGoFiles settings previously took effect in consumer repositories only after a later update. Also, files present in the original AL-Go template but absent from the custom template were not selected for propagation.
This PR makes Update AL-Go System Files read the custom template’s current settings during the same run.
Include and exclude rules are now resolved against both the custom template and the original AL-Go template. For example, a custom template may not contain the Power Platform workflows available in the original template. When a PTE consumer repository enables a Power Platform solution, those workflows can now be propagated from the original template. Custom-template exclusions can likewise prevent original-template files from being propagated.
The update also:
Adds destinationName to filesToInclude to copy a file under a different name.
Resolves destination collisions by keeping the first eligible match. Custom-template matches are considered before original-only matches; within each template, default rules precede configured rules.
Skips updates and removals involving paths redirected through symlinks or junctions, with a warning.
Migration note: Changing destinationName does not remove the previously propagated filename. Remove that file manually if it is no longer needed.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR enhances the customALGoFiles behavior during “Update AL-Go System Files”, adding support for unconditional removals (filesToRemove) and improving custom-template behavior by merging template settings directly and resolving files from the original AL-Go template where applicable.
Changes:
Add customALGoFiles.filesToRemove support end-to-end (schema, defaults, resolution logic, docs, and release notes).
Update CheckForUpdates to read template repo settings via ReadSettings and merge template settings during file resolution.
Expand automated coverage (unit + e2e) for include/exclude/remove resolution and custom-template propagation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
File
Description
e2eTests/scenarios/CustomTemplate/runtest.ps1
Extends e2e scenario to validate custom-template file include/exclude/remove propagation and workflow presence.
Tests/CheckForUpdates.Action.Test.ps1
Adds unit tests for destination-folder resolution and expanded GetFilesToUpdate behaviors (including filesToRemove).
Actions/CheckForUpdates/CheckForUpdates.ps1
Updates settings reading (incl. trigger) and wires template settings + filesToRemove into update/removal flow.
Removal destinations are not constrained to $baseFolder. A filesToRemove entry with a matching template file and destinationFolder = '..' produces a destinationFullPath outside the repository; CheckForUpdates.ps1 later converts it to a relative path and passes it to Remove-Item. Normalize every removal destination and reject paths that are not descendants of the repository root before returning this list.
This containment check runs only after Get-ChildItem -Path has already interpreted and traversed sourceFolder. Consequently, a valid literal folder such as scripts[1] is treated as a wildcard path and is not discovered, while an escaping or redirected folder can be enumerated before its files are rejected. Resolve and validate the source directory first, then enumerate it with -LiteralPath.
Clarify custom-template handling and settings merge behavior
Scenarios/CustomizingALGoForGitHub.md:250
“Used as-is” is inaccurate for settings files: GetModifiedSettingsContent preserves the destination settings and only updates the $schema from the original source when the destination exists. Clarify that the custom-template copy is ignored while the normal settings merge behavior still applies.
Validate destinationName as a cross-platform filename
Actions/.Modules/settings.schema.json:766
destinationName is documented as a filename, but the schema accepts separators and platform-invalid characters. Because the implementation passes it directly to Join-Path, the same value can create a subdirectory on Windows but a backslash-named file on Linux, or fail during the update. Validate it as one cross-platform filename in both the schema and runtime path handling.
Previously missed (1)
In code that hasn't changed since last review
Validate destinationName as a cross-platform filename Actions/.Modules/settings.schema.json:766
destinationName is documented as a filename, but the schema accepts separators and platform-invalid characters. Because the implementation passes it directly to Join-Path, the same value can create a subdirectory on Windows but a backslash-named file on Linux, or fail during the update. Validate it as one cross-platform filename in both the schema and runtime path handling.
The previously missed issue Validate destinationName as a cross-platform filename was not added by this Pull-Request and would also apply to sourceFolder and destinationFolder.
I would like to keep it as is, because it currently works just fine.
I update the docu, releasenotes, PR description and PR title to better reflect the changes of this PR.
This branch has not been deployed
No deployments
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
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
Custom-template
customALGoFilessettings previously took effect in consumer repositories only after a later update. Also, files present in the original AL-Go template but absent from the custom template were not selected for propagation.This PR makes Update AL-Go System Files read the custom template’s current settings during the same run.
Include and exclude rules are now resolved against both the custom template and the original AL-Go template. For example, a custom template may not contain the Power Platform workflows available in the original template. When a PTE consumer repository enables a Power Platform solution, those workflows can now be propagated from the original template. Custom-template exclusions can likewise prevent original-template files from being propagated.
The update also:
destinationNametofilesToIncludeto copy a file under a different name.Migration note: Changing
destinationNamedoes not remove the previously propagated filename. Remove that file manually if it is no longer needed.See the updated custom template documentation and release notes.
Related to #2227.
Checklist