-
Notifications
You must be signed in to change notification settings - Fork 967
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
Enable programmatic overriding of environment variables #797
base: main
Are you sure you want to change the base?
Conversation
within defined scope. Also works for system properties, and for standard error stream.
Thank you for your contribution! We really value the time you've taken to put this together. Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement: |
+1 |
This PR likely will never be merged. https://github.com/lightbend/config#maintained-by
|
Thanks for chipping in @mkurz, unfortunately, I am aware of that, yet I am trying to make people realize the utility of the change, especially since it is small and pretty well-contained. Dear @lightbend maintainers, please consider merging this change, as no good workaround for the issue exists. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Thank you for trying to improve this library. I understand your wish to improve testability of your code, but we decided not to merge your suggestion. |
Dear @ennru, dear @lightbend maintainers, not only of my code but also of code maintained by teams, to which the people interested in that issue belong. And, by virtue of transitive dependencies, of code that uses zio-config and similar libraries. Modern standards of testability are much higher than they were at the time of the conception of this library. You, as the steward, have a unique opportunity to keep the library relevant. |
Here #798 extended functionality was merged (which is completely non-critical), although |
+1 |
Dear @ennru, dear https://github.com/lightbend maintainers, As correctly pointed out by @yantonov at #797 (comment), feature completeness should not mean, that the users should cope with the existing problems until they move to an alternative. As the responsible stewards of the library, which still enjoys great popularity within the ecosystem, please do consider merging these changes. |
This new API allows users to easily test how environment variables substitutions would work in their complex configurations, with:
Besides environment variables, the new API also lets one substitute system properties and standard error stream, everything in a scoped way (nothing is set globally, only per caller thread).
Caveat: the substitutions work only in the current thread, however, this should fit 99.9% of users, since it is rather unheard of, that one does multi-threaded computations during the configuration loading/resolving process.
References #796