GithubRepo (autotransform.repo.github)
The implementation for the GithubRepo.
- class autotransform.repo.github.GithubRepo(*, base_branch: str, full_github_name: str, commit_repo: str | None = None, hide_automation_info: bool = False, hide_autotransform_docs: bool = False, labels: ~typing.List[str] = <factory>, reviewers: ~typing.List[str] = <factory>, team_reviewers: ~typing.List[str] = <factory>)
Bases:
GitRepoA Repo that provides support for submitting changes as a pull request against a Github repo.
- full_github_name
The fully qualified name of the Github Repo.
- Type:
str
- commit_repo
The repo from which to generate a Pull Request. Used if creating a Pull Request from a fork. Defaults to None.
- Type:
optional, Optional[str]
- hide_automation_info
Whether to hide information on how automation was done from the pull request body. Defaults to False.
- Type:
bool, optional
- hide_autotransform_docs
Whether to hide links to AutoTransform docs from the pull request body. Defaults to False.
- Type:
bool, optional
- labels
The labels to add to pull requests. Defaults to [].
- Type:
List[str], optional
- reviewers
The reviewers to request for pull requests. Defaults to [].
- Type:
List[str], optional
- team_reviewers
The team reviewers to request for pull requests. Defaults to [].
- Type:
List[str], optional
- commit_repo: str | None
- full_github_name: str
- get_automation_info(schema: AutoTransformSchema | None, batch: Batch) str
Gets information on automating with AutoTransform.
- Parameters:
schema (Optional[AutoTransformSchema]) – The Schema making the Change.
batch (Batch) – The Batch the Change is being made for.
- Returns:
The text for automating.
- Return type:
str
- get_outstanding_changes() Sequence[GithubChange]
Gets all outstanding pull requests for the Repo.
- Returns:
The outstanding Changes against the Repo.
- Return type:
Sequence[GithubChange]
- 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
- hide_automation_info: bool
- hide_autotransform_docs: bool
- labels: List[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- reviewers: List[str]
- submit(batch: Batch, _transform_data: Mapping[str, Any] | None, change: Change | None = None) None
Performs the normal submit for a git repo then submits a pull request against the provided Github repo.
- team_reviewers: List[str]
- class autotransform.repo.github.GithubRepoBatchMetadata(*, body: str, labels: ~typing.List[str] = <factory>, reviewers: ~typing.List[str] = <factory>, team_reviewers: ~typing.List[str] = <factory>)
Bases:
BaseModelThe metadata used by GithubRepo.
- body
The body of the Pull Request to make.
- Type:
str
- labels
The labels to add to the Pull Request. Defaults to [].
- Type:
optional, List[str]
- reviewers
The reviewers to request for the Pull Request. Defaults to [].
- Type:
optional, List[str]
- team_reviewers
The team reviewers to request for the Pull Request. Defaults to [].
- Type:
optional, List[str]
- body: str
- labels: List[str]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- reviewers: List[str]
- team_reviewers: List[str]