(#3675) Extract all used environment variables#3241
Merged
gep13 merged 3 commits intochocolatey:developfrom Jun 5, 2025
Merged
(#3675) Extract all used environment variables#3241gep13 merged 3 commits intochocolatey:developfrom
gep13 merged 3 commits intochocolatey:developfrom
Conversation
df1f840 to
76676a3
Compare
Member
Author
|
Putting this back to draft, as we can not make all internal types available for dependent projects. |
76676a3 to
bf0d8b9
Compare
e489690 to
7cfa192
Compare
Member
Author
|
Converted this PR to draft until it is ready to be reviewed. |
c507e12 to
c439222
Compare
Member
Author
|
@gep13 this PR is now ready for review. |
gep13
requested changes
Jun 4, 2025
src/chocolatey/infrastructure.app/services/PowershellService.cs
Outdated
Show resolved
Hide resolved
src/chocolatey/infrastructure.app/templates/ChocolateyReadMeTemplate.cs
Outdated
Show resolved
Hide resolved
e48a233 to
a20eed7
Compare
These changes extracts all of the environment variables that we make use of while running Chocolatey CLI. Both variables that are used as part of running package scripts, and variables we use only when they are set on the system. A change to make these environment variables and all other internal types available to other products and the test projects has been made.
…sources Update EnvironmentVariables class to reference constants from chocolatey.StringResources instead of hardcoded strings. Mark the old EnvironmentVariables class as obsolete to enforce usage of the new centralized resource definitions. Refactor Helpers/Paths.cs and Helpers/EnvironmentHelper.cs to use EnvironmentVariables.System.Path for PATH variable access and modification, ensuring consistency with the updated resource usage. These changes improve maintainability by consolidating environment variable names in a single source and prevent duplication errors.
a20eed7 to
bffbb2d
Compare
…E template
Change the placeholder from ChocolateyPackageExitCode to
{EnvironmentVariables.Package.ChocolateyExitCode} to reflect the
correct environment variable name used for the script exit code.
This improves accuracy and consistency in the documentation.
6 tasks
Member
|
@AdmiringWorm great work here! Thanks for getting this done! |
Member
|
I have removed this PR from the milestone, since the issue #3675 is already contained in the milestone. |
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.
Description Of Changes
These changes extracts all of the environment variables that we
make use of while running Chocolatey CLI. Both variables that are
used as part of running package scripts, and variables we use
only when they are set on the system.
A change to make these environment variables and all other internal
types available to other products and the test projects has been made.
Motivation and Context
To be able to have a single location to add and use environment variable names from.
Testing
N/A. Need to be ran through test kitchen.
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
fixes #3675