mass_driver.models.forge

Base definition of Forge, applying changes across git Repositories

Module Contents

Classes

Forge

Base class for git Forges like Github

PROutcome

The category of result after using a Forge over a single repository

PRResult

The result of applying a patch on a repo

Data

PRStatus

The status of a specific PR, as series of flags and bool-predicate.

API

mass_driver.models.forge.PRStatus = None

The status of a specific PR, as series of flags and bool-predicate.

Keys must be sorted (inserted) from most PR-completed (PR is merged/closed) to least completed (unreviewed, draft, review-rejected, merge conflicts…)

class mass_driver.models.forge.Forge[source]

Bases: pydantic.BaseSettings

Base class for git Forges like Github

abstract create_pr(forge_repo_url: str, base_branch: mass_driver.models.repository.BranchName, head_branch: mass_driver.models.repository.BranchName, pr_title: str, pr_body: str, draft: bool) str[source]

Send a PR to forge_repo for given branch of repo_path. Returns PR HTML URL

abstract get_pr_status(pr: str) str[source]

Get the status of a single given PR, used as key to group PRs by status

abstract property pr_statuses: list[str]

A list of 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 Config[source]

Configuration of the Forge class

underscore_attrs_are_private = True

Ensure that _api is treated private

env_prefix = 'FORGE_'
class mass_driver.models.forge.PROutcome[source]

Bases: str, enum.Enum

The category of result after using a Forge over a single repository

Initialization

Initialize self. See help(type(self)) for accurate signature.

PR_CREATED = 'PR_CREATED'

The PR was created correctly

PR_FAILED = 'PR_FAILED'

The PR failed to be created

class mass_driver.models.forge.PRResult[source]

Bases: pydantic.BaseModel

The result of applying a patch on a repo

outcome: mass_driver.models.forge.PROutcome = None

The kind of result that PR creation had

pr_html_url: str | None = None

The HTML URL of the PR that was generated, if any

details: str | None = None

Details of the PR creation of this repo, if any