Skip to content

AL-Go projects with large amounts of apps will fill up the environment variable#2049

Merged
aholstrup1 merged 17 commits into
microsoft:mainfrom
aholstrup1:aholstrup/installapps
Dec 4, 2025
Merged

AL-Go projects with large amounts of apps will fill up the environment variable#2049
aholstrup1 merged 17 commits into
microsoft:mainfrom
aholstrup1:aholstrup/installapps

Conversation

@aholstrup1
Copy link
Copy Markdown
Collaborator

@aholstrup1 aholstrup1 commented Nov 29, 2025

❔What, Why & How

Repro steps:

  1. Create an AL-Go project with a large amount of apps
  2. Create another AL-Go project where some apps have dependencies on the apps in step 1

AL-Go will run the CI/CD in two phases. It will build a lot of apps in the first phase, and then in phase 2 those apps will downloaded as part of the "Download Project Dependencies" action. Here, AL-Go constructs a list of apps and then outputs that list. Once we start the "RunPipeline" action those lists of apps will be added as an environment variable. Once that happens we get:

Error: Unexpected error when running action. Error Message: The environment block used to start a process cannot be longer than 65535 bytes.  Your environment block is 67479 bytes long.  Remove some environment variables and try again.

If you have a lot of apps, this list will very quickly become quite large and will therefore fill up the environment block.

Proposed Solution:
Write the lists to files in a temporary folder and read the lists from those files instead of making them environment variables.

✅ Checklist

  • Add tests (E2E, unit tests)
  • Update RELEASENOTES.md
  • Update documentation (e.g. for new settings or scenarios)
  • Add telemetry

Copilot AI review requested due to automatic review settings November 29, 2025 11:43
@aholstrup1 aholstrup1 requested a review from a team as a code owner November 29, 2025 11:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an issue where AL-Go projects with large numbers of apps would exceed the 65,535 byte environment variable limit during CI/CD workflows. The solution changes the approach from passing large JSON-formatted app lists as environment variables to writing them as files in temporary folders and passing file paths instead.

Key changes:

  • Modified DownloadProjectDependencies to write downloaded app lists to temporary JSON files instead of returning JSON strings
  • Updated RunPipeline to read app lists from file paths instead of parsing JSON strings from parameters
  • Updated documentation to reflect that parameters now accept file paths instead of JSON strings

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
RELEASENOTES.md Added release note documenting the fix for large environment variable issue
Actions/RunPipeline/action.yaml Changed input descriptions and defaults to indicate file paths instead of JSON strings
Actions/RunPipeline/RunPipeline.ps1 Added logic to read app lists from files when paths are provided
Actions/RunPipeline/README.md Updated documentation to reflect file path inputs
Actions/DownloadProjectDependencies/DownloadProjectDependencies.Action.ps1 Changed to write app lists to temporary files and output file paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread Actions/RunPipeline/README.md Outdated
Comment thread Actions/RunPipeline/RunPipeline.ps1 Outdated
Comment thread Actions/RunPipeline/RunPipeline.ps1 Outdated
aholstrup1 and others added 2 commits November 30, 2025 11:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread Actions/DownloadProjectDependencies/DownloadProjectDependencies.Action.ps1 Outdated
Copy link
Copy Markdown
Collaborator

@mazhelez mazhelez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just one more iteration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Actions/DownloadProjectDependencies/DownloadProjectDependencies.Action.ps1 Outdated
@aholstrup1 aholstrup1 requested a review from mazhelez December 1, 2025 09:37
spetersenms
spetersenms previously approved these changes Dec 2, 2025
@mazhelez
Copy link
Copy Markdown
Collaborator

mazhelez commented Dec 3, 2025

⚠️ Release Notes Update Reminder

Thank you for updating the release notes!

Please ensure that your changes are placed above the new version section (currently ## v8.1) in the RELEASENOTES.md file.

This helps maintain a clear changelog structure where new changes are grouped under the latest unreleased version.

Comment thread RELEASENOTES.md Outdated
Co-authored-by: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com>
spetersenms
spetersenms previously approved these changes Dec 3, 2025
mazhelez
mazhelez previously approved these changes Dec 3, 2025
@aholstrup1 aholstrup1 dismissed stale reviews from mazhelez and spetersenms via baf3903 December 3, 2025 13:49
mazhelez
mazhelez previously approved these changes Dec 3, 2025
@aholstrup1 aholstrup1 merged commit 78e60e6 into microsoft:main Dec 4, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants