Skip settings schema validation on PS5.1 when JSON exceeds command-line length limit#2231
Open
Skip settings schema validation on PS5.1 when JSON exceeds command-line length limit#2231
Conversation
Write settings JSON to a temp file instead of passing it as a command-line argument to pwsh.exe, which exceeds the Windows command-line length limit (~32K chars) for large settings. Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/90f81e6b-6fa6-4fa5-9a16-4c43637c704d Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
…th limit Instead of writing to a temp file, simply skip the validation when the settings JSON is too large (>30K chars) for the Windows command-line limit. Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/333f25d2-8e08-4ebf-8b95-fc6fe2001579 Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/8ee7b1e9-d14b-41b8-b172-81c61ffe05c8 Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
mazhelez
April 30, 2026 13:49
View session
mazhelez
approved these changes
Apr 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a Windows PowerShell 5.1 limitation where ValidateSettings shells out to pwsh and can exceed the Windows ~32K command-line length limit when passing large settings JSON, causing validation to fail.
Changes:
- Add a PS5.1 guard to skip settings schema validation when the serialized settings JSON is larger than 30,000 characters.
- Update release notes to document the fix for the “filename or extension is too long” validation error.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| RELEASENOTES.md | Documents the PS5.1 validation-length-limit fix in the Issues list. |
| Actions/.Modules/ReadSettings.psm1 | Adds an early-exit condition in ValidateSettings for PS5.1 when settings JSON is very large. |
Collaborator
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/2daf92be-f2f4-44c9-a10c-46a1bd01e4c9 Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Contributor
Author
Applied all three changes from the review in commit bb500e1:
|
mazhelez
reviewed
Apr 30, 2026
Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/a56d8a43-8737-4e44-a8d7-e0b0370497b9 Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
mazhelez
reviewed
Apr 30, 2026
…s test Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/a6d20e17-ae77-432d-92ee-c96d102e2301 Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
…versized JSON Agent-Logs-Url: https://github.com/microsoft/AL-Go/sessions/60d8dbf0-a9a5-4827-9ba8-7459f8bd422a Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
The test should assert on OutputWarning (the function ValidateSettings actually calls) rather than Write-Host (an internal implementation detail of DebugLogHelper). Also removes unnecessary Out-Host mock. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mazhelez
approved these changes
May 6, 2026
Collaborator
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Contributor
Author
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
On PS5.1,
ValidateSettingsshells out topwsh.exepassing the full settings JSON as a command-line argument. For repositories with many projects/settings, the JSON can exceed the ~32K Windows command-line limit, producing:Fix: Silently skip schema validation on the PS5.1 code path when
$settingsJson.Length > 30000. Usescontinueinstead ofreturnto ensure subsequent piped settings objects are still validated. The PS7+ in-processInvoke-Commandpath is unaffected since it passes the JSON without command-line length constraints.✅ Checklist