Change (autotransform.change.base)

The base class and associated classes for Change components.

class autotransform.change.base.Change

Bases: NamedComponent

The base for Change components. Used by AutoTransform to manage submissions to code review and source control systems.

name

The name of the Component.

Type

ClassVar[ChangeName]

abstract get_batch() Batch

Gets the Batch that was used to produce the Change.

Returns

The Batch used to produce the Change.

Return type

Batch

get_created_timestamp() int

Returns the timestamp when the Change was created.

Returns

The timestamp in seconds when the Change was created.

Return type

int

abstract get_labels() List[str]

Gets all labels for a Change.

Returns

The list of labels.

Return type

List[str]

get_last_updated_timestamp() int

Returns the timestamp when the Change was last updated.

Returns

The timestamp in seconds when the Change was last updated.

Return type

int

abstract get_reviewers() List[str]

Gets all reviewers for a Change.

Returns

The list of reviewers.

Return type

List[str]

abstract get_schema() AutoTransformSchema

Gets the Schema that was used to produce the Change.

Returns

The Schema used to produce the Change.

Return type

AutoTransformSchema

abstract get_state() ChangeState

Gets the current state of the Change.

Returns

The current state of the Change.

Return type

ChangeState

abstract get_team_reviewers() List[str]

Gets all team reviewers for a Change.

Returns

The list of team reviewers.

Return type

List[str]

name: ClassVar[ChangeName]
take_action(action: Action, runner: Runner) bool

Tells the Change to take an Action based on the results of a Step run.

Parameters
  • action (Action) – The Action to take.

  • runner (Runner) – A Runner which can be used to take an Action.

Returns

Whether the Action was taken successfully.

Return type

bool

class autotransform.change.base.ChangeName(value)

Bases: str, Enum

A simple enum for mapping.

GITHUB = 'github'
class autotransform.change.base.ChangeState(value)

Bases: str, Enum

A simple enum for the state of a given Change in code review or version control systems.

APPROVED = 'approved'
CHANGES_REQUESTED = 'changes_requested'
CLOSED = 'closed'
MERGED = 'merged'
OPEN = 'open'