This PR completely reworks the way commands receive the configuration values associated with them. It does this by splitting each command configuration out into its own block, allowing for per-command configuration requirements.
Old Methods
The old method used a single configuration setup for the entire application. This means every command required the exact same configuration, with each command only using the configs it needed to.
The commands also used the same setup function, which was an end-to-end setup of database connections, loggers etc...
New Methods
This PR introduces the following new behavior:
Split of all configuration setups into discrete blocks
Generalization of common configs and common validation methods for code reuse
New PreRun functions for every command that handles getting and validating command configurations
Removal of app-wide dependency on single setup function, each command only sets up what it needs
This achieves the following:
Better code reuse
Discrete commands allow for easier debugging and less downstream affects if things change
Easier locations to establish common configurations and validations
Better --help output for each command
Smaller/better scoped config requirements for each command
Scope of this PR
This PR completely reworks the way commands receive the configuration values associated with them. It does this by splitting each command configuration out into its own block, allowing for per-command configuration requirements.
Old Methods
The old method used a single configuration setup for the entire application. This means every command required the exact same configuration, with each command only using the configs it needed to.
The commands also used the same
setup
function, which was an end-to-end setup of database connections, loggers etc...New Methods
This PR introduces the following new behavior:
setup
function, each command only sets up what it needsThis achieves the following:
--help
output for each command