Skip to content

refactor: load config as value object#2041

Merged
balanza merged 10 commits into89luca89:nextfrom
balanza:config-defaults
Apr 2, 2026
Merged

refactor: load config as value object#2041
balanza merged 10 commits into89luca89:nextfrom
balanza:config-defaults

Conversation

@balanza
Copy link
Copy Markdown
Collaborator

@balanza balanza commented Mar 31, 2026

Refactor the way we handle configuration so that, instead of collapsing the file values into the environment, the entire configuration is calculated and passed as a value object to the commands.

This allows the default container image and name to be configurable (see: 24e9ed8).

Expected benefits

  • Defaults, source config files and handled environment variables are now in the same file (pkg/config/config.go)
  • The CLI layer is not responsible for reading values from different sources.
  • Remove dependency on godotenv
  • The config values are passed to the command layer by value; callers can decide how to calculate the value set (it can be just the default values, reading from the default files, or a custom datasource)

What changed

  • package internal/config moved to pkg/config
  • config value trickled down from main to the command layer

Fixes #2040 (the fix: 24e9ed8)

Copy link
Copy Markdown
Collaborator

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some feedbacks but great work overall (also thank you for addressing this ❤️ )

@balanza balanza requested a review from dottorblaster April 1, 2026 21:30
Copy link
Copy Markdown
Collaborator

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go!

@balanza balanza merged commit 494b225 into 89luca89:next Apr 2, 2026
14 checks passed
@balanza balanza deleted the config-defaults branch April 2, 2026 12:49
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.

2 participants