Skip to content

const

Global variables for batch update commands.

PrMetadata

Bases: BaseModel

Metadata for a Pull Request on Github.

Source code in dapla_team_cli/pr/const.py
40
41
42
43
44
45
class PrMetadata(BaseModel):
    """Metadata for a Pull Request on Github."""

    number: Optional[int] = None
    url: Optional[str] = None
    branch_name: Optional[str] = None

RepoState

Bases: BaseModel

The state of a single repo.

Source code in dapla_team_cli/pr/const.py
60
61
62
63
64
65
66
class RepoState(BaseModel):
    """The state of a single repo."""

    name: str
    local_path: Path
    pr: PrMetadata
    workflow: WorkflowStatus

State

Bases: BaseModel

Model representing the state of all repos in a run.

Source code in dapla_team_cli/pr/const.py
69
70
71
72
73
74
75
76
77
78
class State(BaseModel):
    """Model representing the state of all repos in a run."""

    name: str
    repos: dict[str, RepoState] = {}
    version: str = "0.0.1"

    def get_repo_state(self, repo_name: str) -> RepoState:
        """Get the state of a single repo."""
        return self.repos[repo_name]

get_repo_state(repo_name)

Get the state of a single repo.

Source code in dapla_team_cli/pr/const.py
76
77
78
def get_repo_state(self, repo_name: str) -> RepoState:
    """Get the state of a single repo."""
    return self.repos[repo_name]

Status

Bases: Enum

Possible statuses for a single workflow item.

Source code in dapla_team_cli/pr/const.py
31
32
33
34
35
36
37
class Status(Enum):
    """Possible statuses for a single workflow item."""

    NOT_STARTED = auto()
    STARTED = auto()
    SUCCESS = auto()
    FAIL = auto()

WorkflowStatus

Bases: BaseModel

Status of stages in the workflow for a single repo.

Source code in dapla_team_cli/pr/const.py
48
49
50
51
52
53
54
55
56
57
class WorkflowStatus(BaseModel):
    """Status of stages in the workflow for a single repo."""

    pushed: Status = Status.NOT_STARTED
    opened: Status = Status.NOT_STARTED
    checks: Status = Status.NOT_STARTED
    atlantis_plan: Status = Status.NOT_STARTED
    approved: Status = Status.NOT_STARTED
    atlantis_apply: Status = Status.NOT_STARTED
    merged: Status = Status.NOT_STARTED