Consolidate base CI support into a new base class.

Review Request #12831 — Created Feb. 13, 2023 and submitted — Latest diff uploaded

Information

rbintegrations
release-3.x

Reviewers

This introduces a new rbintegrations.baseci module, containing a
BaseCIIntegration class. This class is responsible for listening to
publish and manual run requests, handling configuration queries, and
providing standard management of status updates.

There are new helpers for updating status updates with arbitrary fields,
or putting them into specific (standardized) modes. These are smart in
that they'll only make changes to status updates for fields that are
given new values.

Subclasses no longer need to implement separate code paths for publish
and manual run. Instead, they just implement an optional
prepare_build() method to filter configurations or supply state for
builds, and start_build() for actually performing the build.

Build state generation and validation is taken care of in the base
class, and errors on status updates are automatically set based on
whether start_build() raises a CIBuildError or a plain exception.

This will soon be followed up by a change to make use of new
StatusUpdate methods for status changes, and to correctly handle
manual run requests for the right configuration. Both of those will
be available in Review Board 5.0.3.

Unit tests pass on all supported versions of Python.

This will be pending a test in production by a customer.

Commits

Files