-
Notifications
You must be signed in to change notification settings - Fork 187
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
[full-ci] Revamp Config Parsing #2708
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
@refs I'm not sure about approach No1. Would that work with any configuration type? (yml? json? xml?) |
yes, supports many encoders: https://github.com/gookit/config/blob/8a7c1f28b5b0e9abecffc94d0d865e17a531eb0d/config.go#L87 |
… logging. Considering using a package level global logging...
💥 Acceptance test Core-API-Tests-ocis-storage-10 failed. Further test are cancelled... |
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see that out in the wild 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let it fly
TODO
docs
pipeline on CIaction: how do we want to generate docs for the new structs? We can reuse the oldsee Generate config docs #2806Description
field in the flags and have ago:generate
do the workThis is an implementation of the proposed configuration proposal on #2704
config.Config
structs as I wish.This is also in preparation for the upcoming "restart a service if a config changes" story.
ENV Variables and Templates
We have 2 options. Let the
ENV
parsing to the config file, which looks like:proxy.yaml:
There clearly
PROXY_HTTP_ADDR
will take precedence over the default specified in the config filelocalhost:2222
.The other alternative is to parse a set of predefined ENV variables, get the config environment and overwrite the config values, trimming down the config a bit.
I personally prefer the first approach, since it allows more flexibility for the end user as they are in control of the environment, and we only need to provide with a default in-memory config file that reads from the default environment values, in the case there is no
extension.[*]
config file on the user's machine, this way we don't break config parsing in the case the user wants to use only environment variables.