Repository navigation
Improve file handling in Update AL-Go System Files - #2273
Ole Wunschmann (OleWunschmann) wants to merge 96 commits into
Conversation
There was a problem hiding this comment.
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.filesToRemovesupport end-to-end (schema, defaults, resolution logic, docs, and release notes). - Update
CheckForUpdatesto read template repo settings viaReadSettingsand 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. |
| Actions/CheckForUpdates/CheckForUpdates.HelperFunctions.ps1 | Implements ResolveFilePathsInDestinationFolder and extends GetFilesToUpdate to produce include/exclude/remove lists. |
| Actions/.Modules/settings.schema.json | Extends settings schema with customALGoFiles.filesToRemove and clarifying descriptions. |
| Actions/.Modules/ReadSettings.psm1 | Adds default filesToRemove array under customALGoFiles. |
| Scenarios/settings.md | Documents customALGoFiles.filesToRemove in settings reference. |
| Scenarios/CustomizingALGoForGitHub.md | Adds conceptual docs + examples for original-template resolution and filesToRemove. |
| RELEASENOTES.md | Documents enhanced customALGoFiles behavior and new filesToRemove. |
|
Maria Zhelezova (@mazhelez) The failing PS5 tests should be fixed now. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
Actions/CheckForUpdates/CheckForUpdates.HelperFunctions.ps1:1205
- Removal destinations are not constrained to
$baseFolder. AfilesToRemoveentry with a matching template file anddestinationFolder = '..'produces adestinationFullPathoutside the repository;CheckForUpdates.ps1later converts it to a relative path and passes it toRemove-Item. Normalize every removal destination and reject paths that are not descendants of the repository root before returning this list.
$filesToRemove += @(ResolveFilePaths -sourceFolder $originalTemplateFolder -destinationFolder $baseFolder -files $filesToRemoveUnresolved -projects $projects)
}
$filesToRemove += @(ResolveFilePaths -sourceFolder $templateFolder -originalSourceFolder $originalTemplateFolder -destinationFolder $baseFolder -files $filesToRemoveUnresolved -projects $projects)
$filesToRemove += @(ResolveFilePathsInDestinationFolder -destinationFolder $baseFolder -files $filesToRemoveUnresolved -projects $projects)
There was a problem hiding this comment.
🟡 Changes recommended
The exclusion tooltip omits potential destination-file deletion, and the release notes omit that an empty trigger prevents trigger-based ConditionalSettings from affecting file selection or workflow generation.
2 open issues
Review effort: Max
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical issues permit out-of-workspace settings reads, produce incorrect build depths from stale or context-dependent settings, and mishandle renamed workflows or overwrite consumer settings.
6 open issues
Preserve default classification for configured mappings · New Validate settings paths before reading them · New Remove stale project-settings snapshot when source is absent · New Calculate dependency depth for the correct workflow context · New Validate excluded source paths before scheduling removals · New Document deletions restored by default include rules · New
2 resolved since last review
Review effort: Max
Enhance AL-Go System Files to utilize latest repository settings from a custom template, ensuring proper workflow dependency depth and file inclusion/exclusion rules. Introduce breaking change for standard workflows/scripts in consumer repositories. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This PR validates source content reads and destination writes/removals during update processing. Extending validation to earlier settings loading would broaden that scope and is intentionally left unchanged. The release notes now clarify this boundary. |
There was a problem hiding this comment.
🟡 Changes recommended
Critical path-validation gaps allow symlinked settings to be read before validation and redirected template roots to be trusted, permitting settings outside the workspace to influence updates.
3 open issues
Review effort: Max
|
|
||
| # Apply unusedALGoSystemFiles logic | ||
| $unusedALGoSystemFiles = $settings.unusedALGoSystemFiles | ||
| $unusedALGoSystemFileNames = [System.Collections.Generic.HashSet[string]]::new($pathComparer) |
There was a problem hiding this comment.
I agree.
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved path-handling flaws can read settings outside the workspace or overwrite existing settings, while dependency-depth and workflow-processing defects can break CI.
4 open issues
2 resolved since last review
Review effort: Max
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved update defects can preserve stale settings, underestimate build depth, delete consumer files through unvalidated symlinked exclusions, and bypass required processing for renamed files.
1 open issue
3 resolved since last review
Review effort: Max
The only listed open issue was fixed in 1e9e5cd, restoring case-insensitive matching for unusedALGoSystemFiles. The introductory summary does not match the listed findings. Previously discussed limitations and scope decisions remain documented in their respective threads. |
|
There was a problem hiding this comment.
🟡 Changes recommended
Unvalidated symlinks can supply external update settings, the Linux end-to-end scenario fails, and inconsistent dependency settings or stale snapshots can produce incorrect workflows.
4 open issues
1 resolved since last review
Review effort: Max
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved critical defects can generate insufficient build depth, retain removed template settings, delete case-distinct Linux files, and read or act on unvalidated symlinked paths.
1 open issue
3 resolved since last review
Review effort: Max
All mentioned issues have already been addressed in the corresponding review comments. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The broader concerns in this review summary are acknowledged limitations already discussed and explicitly deferred in resolved threads:
“Keep unused system-file matching case-insensitive” is already fixed in 1e9e5cd, which restored the legacy -contains / -notcontains comparisons. Maria Zhelezova (@mazhelez) spetersenms Alexander Holstrup (@aholstrup1) FYI |



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. These settings are used for file selection, workflow customization, and dependency-depth calculation, rather than taking effect only on the next update.
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