-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API] GetConfiguration() sets the configuration for other calls #1347
Comments
Hopefully the changes made for 0.10.8 fix issues with repeated values making it through. Just ensure that you never access Added this to GetChocolatey summary:
|
Wouldn't it be better to return a cloned config in the mentioned methods to prevent this issue? Or would that cause more harm? |
@batzen that is exactly what the API does. If those mentioned methods returned a cloned config as well, it would cause more harm than good. |
The one thing I think may still be an issue is that with Boxstarter there may be some nesting, so when one Configuration is returned, that gets used with the nested packages as well instead of finishing the use, then allowing the config to return to the default setting for use with the next command call. |
I guess every package in boxstarter is nested and that's the problem. |
The problem comes down to a base configuration that is set early on that needs to be maintained across multiple calls. #1296 has more information on the reasoning and issues that were there previously. |
I guess the only one really knowing what has to be changed in boxstarter is @mwrock. |
Add comments on using ChocolateyConfiguration directly. Also provide warnings against nested calls to certain commands.
Previously, `GetChocoaltey.GetConfiguration()` would allow manipulating the configuration for other calls when using Chocolatey's API. Ensure that it is purely used for informational purposes and won't affect the settings that are used when running Chocolatey's API with future calls.
choco/src/chocolatey/GetChocolatey.cs
Lines 368 to 373 in e96fb15
The text was updated successfully, but these errors were encountered: