Action (autotransform.step.action.base)

The base class and associated classes for Action components.

class autotransform.step.action.base.Action

Bases: NamedComponent

The base for Action components. Used by AutoTransform to perform some task on outstanding Changes based on Steps in the Manager. Tasks include options such as updating, abandoning, merging, and more.

name

The name of the component.

Type:

ClassVar[ActionName]

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: ClassVar[ActionName]
abstract run(change: Change) bool

Performs the action on the specified Change.

Parameters:

change (Change) – The Change to perform the Action on.

Returns:

Whether the Action was successful.

Return type:

bool

class autotransform.step.action.base.ActionName(value)

Bases: str, Enum

A simple enum for mapping.

ABANDON = 'abandon'
ADD_LABELS = 'add_labels'
ADD_OWNERS_AS_REVIEWERS = 'add_owners_as_reviewers'
ADD_OWNERS_AS_TEAM_REVIEWERS = 'add_owners_as_team_reviewers'
ADD_REVIEWERS = 'add_reviewers'
COMMENT = 'comment'
MERGE = 'merge'
NONE = 'none'
REMOVE_LABEL = 'remove_label'
REQUEST = 'request'
UPDATE = 'update'