Consolidate base CI support into a new base class.
Review Request #12831 — Created Feb. 13, 2023 and submitted
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, andstart_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
whetherstart_build()
raises aCIBuildError
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.
Summary | ID |
---|---|
fcf1a5fa6c1a73f1dd40fbedff138245e3b0eaff |
Description | From | Last Updated |
---|---|---|
In your description, 3rd paragraph, "Status Updates" should be "status updates" |
david | |
Should add a docstring to rbintegrations/baseci/__init__.py. |
maubin | |
Should be either "StatusUpdate" (probably with a link), or "status update" |
david | |
Should be either "StatusUpdate" (with a link) or "status updates". Same throughout the rest of the change. |
david | |
Let's change "They" to "It" here just to be a bit more clear. |
david | |
Small nitpick: can use StatusUpdate here |
maubin | |
Looks like the end of the sentence got cut off. |
maubin | |
Could add a Returns section to the docstring while you're here. |
maubin |
- Change Summary:
-
Switched terminology to
StatusUpdate
(with a link) orstatus update
(often with:term:
) where appropriate. - Description:
-
This introduces a new
rbintegrations.baseci
module, containing aBaseCIIntegration
class. This class is responsible for listening topublish 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 forbuilds, 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 ~ class, and errors on status updates are automatically set based on whether start_build()
raises aCIBuildError
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 handlemanual run requests for the right configuration. Both of those will be available in Review Board 5.0.3. - Commits:
-
Summary ID de0e3e5ffbc3f7fa351059de20b66c7932b290b9 cab607aa3445cf366d930c9b50050f8ff94c74b2 - Diff:
-
Revision 2 (+5110 -1632)
Checks run (2 succeeded)
- Change Summary:
-
Posted the right revision of the update for review feedback.
- Commits:
-
Summary ID cab607aa3445cf366d930c9b50050f8ff94c74b2 604074cf38b3eb742967e11757b5e906cc3360b3 - Diff:
-
Revision 3 (+5136 -1632)
Checks run (2 succeeded)
- Change Summary:
-
- Added missing documentation.
- Fleshed out and improved other docs.
- Commits:
-
Summary ID 604074cf38b3eb742967e11757b5e906cc3360b3 fcf1a5fa6c1a73f1dd40fbedff138245e3b0eaff - Diff:
-
Revision 4 (+5166 -1630)