mass_driver.forges.github
Githubas Forge. Using the github lib if available
Module Contents
Classes
Base for github forge |
|
Github API wrapper for personal user token use, capable of creating/getting PRs |
|
Create PRs on Github as a Github App, not user |
Functions
Find the github remote from a cloneable URL |
|
Detect a PR’s repo and number |
API
- class mass_driver.forges.github.GithubBaseForge[source]
Bases:
mass_driver.models.forge.Forge
Base for github forge
- _github_api: github.Github = None
- create_pr(forge_repo_url: str, base_branch: mass_driver.models.forge.BranchName, head_branch: mass_driver.models.forge.BranchName, pr_title: str, pr_body: str, draft: bool)[source]
Send a PR, with msg body, to forge_repo for given branch of repo_path
- get_pr_status(pr_url: str) str [source]
Get the status of a single given PR, used as key to group PRs by status
- property pr_statuses: list[str]
List possible PR statuses that will be returned by get_pr_status.
List is sorted from most complete (accepted-and-merged) to least completed (not merged, not review-approved, has merge-conflicts).
The returned list’s ordering is used by the view-pr mass-driver command to show the PRs by status, from most completed to least completed.
- class mass_driver.forges.github.GithubPersonalForge(**data)[source]
Bases:
mass_driver.forges.github.GithubBaseForge
Github API wrapper for personal user token use, capable of creating/getting PRs
Reliance on pygithub means only able to deliver personal user token PRs, no Github app authentication.
Initialization
Log in to Github first
- token: pydantic.SecretStr = None
Github personal access token
- class mass_driver.forges.github.GithubAppForge(**data)[source]
Bases:
mass_driver.forges.github.GithubBaseForge
Create PRs on Github as a Github App, not user
Initialization
Log in to Github first
- app_id: pydantic.SecretStr = None
- app_private_key: pydantic.SecretStr = None
- app_installation_id: int = None