mass_driver.models.patchdriver

PatchDriver base object definition

Module Contents

Classes

PatchOutcome

The category of result after using a PatchDriver over a single repository

PatchResult

The result of applying a patch on a repo

PatchDriver

Base class for creating patches over repositories

API

class mass_driver.models.patchdriver.PatchOutcome[source]

Bases: str, enum.Enum

The category of result after using a PatchDriver over a single repository

Initialization

Initialize self. See help(type(self)) for accurate signature.

PATCHED_OK = 'PATCHED_OK'

The Patch applied correctly

ALREADY_PATCHED = 'ALREADY_PATCHED'

The Patch was already applied, unnecessary to re-do

PATCH_DOES_NOT_APPLY = 'PATCH_DOES_NOT_APPLY'

The repo is missing a pre-requisite that makes patching irrelevant

PATCH_ERROR = 'PATCH_ERROR'

The Patch tried to apply, but failed somehow

class mass_driver.models.patchdriver.PatchResult[source]

Bases: pydantic.BaseModel

The result of applying a patch on a repo

outcome: mass_driver.models.patchdriver.PatchOutcome = None

The kind of result that patching had

details: str | None = None

Details of the PatchDriver as it patched this repo, if any

class mass_driver.models.patchdriver.PatchDriver[source]

Bases: pydantic.BaseModel

Base class for creating patches over repositories

_logger: logging.Logger = None

The logger object for this driver. Given dynamically by migration

abstract run(repo: mass_driver.models.repository.ClonedRepo) mass_driver.models.patchdriver.PatchResult[source]

Apply the update to given (cloned) Git Repository.

Return the outcome of patching for this repository.

property logger

Grab the logger of this driver, as passed dynamically via mass-driver code

class Config[source]

Pydantic config of the PatchDriver class

underscore_attrs_are_private = True

Ensure we can set internal non-serializeable fields via underscore