GithubChange (autotransform.change.github)

The implementation for the GithubChange.

class autotransform.change.github.GithubChange(*, full_github_name: str, pull_number: int)

Bases: Change

A Change representing a Pull Request on a Github repo.

full_github_name

The fully qualified name of the Github Repo the Pull Request is against.

Type:

str

pull_number

The number for the Pull Request.

Type:

int

name

The name of the Component.

Type:

ClassVar[ChangeName]

abandon() bool

Close the Pull Request and delete the associated branch.

Returns:

Whether the abandon was completed successfully.

Return type:

bool

add_labels(labels: List[str]) bool

Adds labels to an outstanding Change.

Parameters:

labels (List[str]) – The labels to add.

Returns:

Whether the labels were added successfully.

Return type:

bool

add_reviewers(reviewers: List[str], team_reviewers: List[str]) bool

Adds reviewers to an outstanding Change.

Parameters:
  • reviewers (List[str]) – The reviewers to add.

  • team_reviewers (List[str]) – Any team reviewers to add.

Returns:

Whether the reviewers were added successfully.

Return type:

bool

comment(body: str) bool

Comments on an outstanding Change.

Parameters:

body (str) – The body of the comment.

Returns:

Whether the comment was successful.

Return type:

bool

full_github_name: str
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 Pull Request was created.

Returns:

The timestamp in seconds when the Pull Request was created.

Return type:

int

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 Pull Request was last updated.

Returns:

The timestamp in seconds when the Pull Request was last updated.

Return type:

int

get_mergeable_state() str

Gets the mergeable state of the Change.

Returns:

The mergeable state of the Change.

Return type:

ChangeState

get_review_state() ReviewState

Gets the current review state of the Change.

Returns:

The current review state of the Change.

Return type:

ReviewState

get_reviewers() List[str]

Gets all reviewers for a Change.

Returns:

The list of reviewers.

Return type:

List[str]

get_schema() AutoTransformSchema

Gets the Schema that was used to produce the Change.

Returns:

The Schema used to produce the Change.

Return type:

AutoTransformSchema

get_schema_name() str

Gets the name of the Schema that produced the Change.

Returns:

The name of the Schema.

Return type:

str

get_state() ChangeState

Gets the current state of the Change.

Returns:

The current state of the Change.

Return type:

ChangeState

get_team_reviewers() List[str]

Gets all team reviewers for a Change.

Returns:

The list of team reviewers.

Return type:

List[str]

get_test_state() TestState

Gets the current test state of the Change.

Returns:

The current test state of the Change.

Return type:

TestState

merge() bool

Merges the Pull Request and deletes the branch.

Returns:

Whether the merge was completed successfully.

Return type:

bool

name: ClassVar[ChangeName] = 'github'
pull_number: int
remove_label(label: str) bool

Removes a label from an outstanding Change.

Parameters:

label (str) – The label to remove.

Returns:

Whether the label was removed successfully.

Return type:

bool