Skip to content

Rename DSCConfigRoot environment variable to DSC_CONFIG_ROOT and handle existing value #335

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

Closed
michaeltlombardi opened this issue Mar 1, 2024 · 0 comments
Assignees
Labels
Doc-Impact Issue-Enhancement The issue is a feature or idea

Comments

@michaeltlombardi
Copy link
Collaborator

Summary of the new feature / enhancement

As a user and integrator, I want the environment variables that DSC uses to follow a consistent naming standard and for DSC to warn if it's overriding an externally set value for the variable. This lowers cognitive load and helps users understand whether DSC is going to behave differently than they might otherwise expect.

Currently, DSC always sets the new DSCConfigRoot environment variable when a user specifies the --path option for a dsc config * command. This doesn't match the format of the existing DSC_RESOURCE_PATH environment variable, and non-Windows environment variables are typically uppercase.

Users, especially higher-order and integrating tools, may want to reference a root folder for the purposes of locating other files for the configuration to use, even when the configuration isn't saved to disk. In these cases, the user or tool would set the environment variable and call the dsc config * command with the --document option or by passing the document from stdin. This works as expected. However, if the environment variable has been manually set and the user calls the command with the --path option, DSC silently overrides the value of the existing environment variable instead of warning the user.

Proposed technical implementation details (optional)

  1. Rename the environment variable from DSCConfigRoot to DSC_CONFIG_ROOT.
  2. Check if the environment variable has already been set when the --path option is specified. If it has, write a warning message to the user indicating that the variable value is being overridden for the command with the parent folder of the specified document path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Doc-Impact Issue-Enhancement The issue is a feature or idea
Projects
Status: Done
Development

No branches or pull requests

2 participants