Skip to content
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

config: prepare for introducing config file handling #248

Merged
merged 3 commits into from
Jan 22, 2024
Merged

Conversation

ffromani
Copy link
Contributor

This PR is cleanup and prep work for #111.

These are value-adding cleanups that can be merged early and that are expected to have no user-visible changes except for the hostname default value, which should be harmless anyway.
All in all, mostly internal refactoring.

we were abusing objects to hold global settings.
It's time to start cleaning up, so we move globals in
their own object, and start adding p;roper JSON annotation.

internal-only change.

Signed-off-by: Francesco Romani <[email protected]>
move configfile processing in its own file,
to be expanded later.

Internal-only change.

Signed-off-by: Francesco Romani <[email protected]>
Split the handling of defaults value from flags
processing _and_ from the environment variables
processing.

Unfortunately is quite hard to de-entangle the mess
with incremental steps so we bite the bullet and we
cut the (albeit little) gordian knot with a single swing
in this change.

Move environment variables override in their own
file, and move the defaults processing in its own
function, so the flags can now trivially only bind
parameter names to values.

Minimal and expected harmless user-visible changes
(due to different flow, unavoidable, only in hostname
processing). Otherwise internal-only change.

Signed-off-by: Francesco Romani <[email protected]>
@ffromani ffromani merged commit c75747f into main Jan 22, 2024
2 checks passed
@ffromani ffromani deleted the config-redo-prep branch January 22, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant