Improve repository management and validate configurations.
Review Request #12099 — Created March 4, 2022 and submitted — Latest diff uploaded
The repository code has been reworked a little to provide a better
interface for defining repository types, and to avoid hard-coding the
repository types everywhere.
BaseRepository. It defines the type IDs for
configuration files that it supports, as well as the SCMTool name for
API queries. Common setup is performed in
__init__(), reducing what
subclasses need to be responsible for.
This allows us to better abstract the repository support, which will in
time allow us to provide wider support for other SCMs.
Configuration is now less prone to failures. Missing configuration keys
now trigger a logging error, rather than crashing. Errors fetching
repository information are logged as well.
Unit tests have been added for configuration validation and loading, and
Unit tests pass.