Repo (autotransform.repo.base)¶
The base class and associated classes for Repo components.
- class autotransform.repo.base.Repo¶
Bases:
NamedComponent
The base for Repo components. Used by AutoTransform to interact with version control and code review systems.
- abstract clean(batch: Batch) None ¶
Clean any changes present in the Repo that have not been submitted.
- Parameters:
batch (Batch) – The Batch for which we are cleaning the repo.
- abstract get_changed_files(batch: Batch) List[str] ¶
Gets all files in the repo that have been modified.
- Parameters:
batch (Batch) – The Batch that was used for the transformation
- Returns:
The list of files that have unsubmitted changes.
- Return type:
List[str]
- abstract get_outstanding_changes() Sequence[Change] ¶
Gets all outstanding Changes for the Repo.
- Returns:
The outstanding Changes against the Repo.
- Return type:
Sequence[Change]
- has_changes(batch: Batch) bool ¶
Check whether any changes have been made to the underlying code based on the Batch.
- Parameters:
batch (Batch) – The Batch that was used for the transformation.
- Returns:
Returns True if there are any changes to the codebase.
- Return type:
bool
- abstract has_outstanding_change(batch: Batch) bool ¶
Checks the state of the repo to see whether an outstanding Change for the Batch exists.
- Parameters:
batch (Batch) – The Batch to check for.
- Returns:
Whether an outstanding Change exists.
- Return type:
bool
- abstract rewind(batch: Batch) None ¶
Rewind the repo to a pre-submit state to prepare for executing another Batch. This should NOT delete any submissions (i.e. commits should stay present).
- Parameters:
batch (Batch) – The Batch for which changes were submitted.