The configuration for cats is specified by both a config file and cli arguments. Values provided at the command line often
override the values provided in the config file. It means there is a bit of work to be done in order to distil all that information into a fixed runtime configuration before cats can start making a request to a CI service. Namely, cats needs
The location
The APIInterface instance that prescribes how to contact the CI service
The job duration
This PR moves the processing required to set these three things (the cats runtime configuration) into a separate module configure that provides a single configure function as an entry point. Benefits are:
Less code in __init__.py which is starting get big
Easier to add unit tests around the processing of config file and cli arguments
The configuration for cats is specified by both a config file and cli arguments. Values provided at the command line often override the values provided in the config file. It means there is a bit of work to be done in order to distil all that information into a fixed runtime configuration before cats can start making a request to a CI service. Namely, cats needs
This PR moves the processing required to set these three things (the cats runtime configuration) into a separate module
configure
that provides a singleconfigure
function as an entry point. Benefits are:__init__.py
which is starting get big