Improve repository management and validate configurations.

Review Request #12099 — Created March 4, 2022 and submitted

Information

ReviewBot
release-3.0.x

Reviewers

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.

Repository is now 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
repository fetching.

Unit tests pass.

Summary ID
Improve repository management and validate configurations.
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. `Repository` is now `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 repository fetching.
22d63dbc82f7cbb3e2b24505f167b57a258d2c0c
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (06c5e75)