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 abandon() bool

Close out and abandon a Change, removing it from the code review and/or version control system.

Returns

Whether the abandon was completed successfully.

Return type

bool

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

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_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

name: ClassVar[ChangeName]
take_action(action_type: ActionType, runner: Runner) bool

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

Parameters
  • action_type (ActionType) – 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'