Update variables to handle InsertJsonValues too long#425
Open
pieandcakes wants to merge 1 commit intoAArnott:microbuildfrom
Open
Update variables to handle InsertJsonValues too long#425pieandcakes wants to merge 1 commit intoAArnott:microbuildfrom
pieandcakes wants to merge 1 commit intoAArnott:microbuildfrom
Conversation
InsertJsonValues can be too long if there are many vsman to insert. If this happens, AzDO has a variable limitation of ~32k characters for the variable. This adds a check to use the newly introduced InsertJsonValuesFile where the InsertJsonValues is written to a file and then processed by InsertVSPayload.
AArnott
requested changes
Oct 16, 2025
| # write the value to a temp file and use the InsertJsonValuesFile variable that InsertVSPayload understands. | ||
| if ($_.BaseName -eq "InsertJsonValues") { | ||
| Write-Warning "The script InsertJsonValues.ps1 is longer than 32k characters." | ||
| Write-Warning "Writing to a temp file and setting INSERTJSONVALUESFILE to the location of the file." |
Owner
There was a problem hiding this comment.
Rather than special case InsertJsonValues in this script (which should be general purpose), I think converting the value to a .txt file should be done at insertion time where it has to deal with this variable specifically.
Author
There was a problem hiding this comment.
So you're saying that the check (and converting it to a text file) should be in _define.ps1 ?
| # Write file to the new parameter. | ||
| $vars["InsertJsonValuesFile"] = "$tmpFile" | ||
| } else { | ||
| Write-Error "The script $($_.BaseName).ps1 is too long (> 32k characters). Skipping setting the environment variable." |
Owner
There was a problem hiding this comment.
I think this should be a warning rather than an error.
AArnott
requested changes
Oct 16, 2025
Owner
AArnott
left a comment
There was a problem hiding this comment.
When the changes I've requested are applied, I think this PR should target the main branch, and a separate PR should that targets microbuild should edit the insertion pipeline to handle the long variable value specially.
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.
InsertJsonValues can be too long if there are many vsman to insert. If this happens, AzDO has a variable limitation of ~32k characters for the variable. This adds a check to use the newly introduced InsertJsonValuesFile where the InsertJsonValues is written to a file and then processed by InsertVSPayload.