Skip to content

PullRequest

🛈 DocStrings

Pull request model.

Source code in src/githarbor/core/models.py
@dataclass
class PullRequest:
    """Pull request model."""

    number: int
    """Pull request number."""
    title: str
    """Title of the pull request."""
    source_branch: str
    """Branch containing the changes."""
    target_branch: str
    """Branch to merge into."""
    description: str = ""
    """Description/body of the pull request."""
    state: str | None = None
    """Current state (open/closed/merged)."""
    created_at: datetime | None = None
    """Creation timestamp."""
    updated_at: datetime | None = None
    """Last update timestamp."""
    merged_at: datetime | None = None
    """Merge timestamp if merged."""
    closed_at: datetime | None = None
    """Closing timestamp if closed."""
    author: User | None = None
    """PR creator."""
    assignees: list[User] = field(default_factory=list)
    """Assigned reviewers."""
    labels: list[Label] = field(default_factory=list)
    """Applied labels."""
    comments: list[Comment] = field(default_factory=list)
    """PR comments."""
    merged_by: User | None = None
    """User who merged the PR."""
    review_comments_count: int | None = None
    """Number of review comments."""
    commits_count: int | None = None
    """Number of commits."""
    additions: int | None = None
    """Lines added."""
    deletions: int | None = None
    """Lines deleted."""
    changed_files: int | None = None
    """Number of files changed."""
    mergeable: bool | None = None
    """Whether PR can be merged."""
    url: str | None = None
    """URL to the PR."""

additions class-attribute instance-attribute

additions: int | None = None

Lines added.

assignees class-attribute instance-attribute

assignees: list[User] = field(default_factory=list)

Assigned reviewers.

author class-attribute instance-attribute

author: User | None = None

PR creator.

changed_files class-attribute instance-attribute

changed_files: int | None = None

Number of files changed.

closed_at class-attribute instance-attribute

closed_at: datetime | None = None

Closing timestamp if closed.

comments class-attribute instance-attribute

comments: list[Comment] = field(default_factory=list)

PR comments.

commits_count class-attribute instance-attribute

commits_count: int | None = None

Number of commits.

created_at class-attribute instance-attribute

created_at: datetime | None = None

Creation timestamp.

deletions class-attribute instance-attribute

deletions: int | None = None

Lines deleted.

description class-attribute instance-attribute

description: str = ''

Description/body of the pull request.

labels class-attribute instance-attribute

labels: list[Label] = field(default_factory=list)

Applied labels.

mergeable class-attribute instance-attribute

mergeable: bool | None = None

Whether PR can be merged.

merged_at class-attribute instance-attribute

merged_at: datetime | None = None

Merge timestamp if merged.

merged_by class-attribute instance-attribute

merged_by: User | None = None

User who merged the PR.

number instance-attribute

number: int

Pull request number.

review_comments_count class-attribute instance-attribute

review_comments_count: int | None = None

Number of review comments.

source_branch instance-attribute

source_branch: str

Branch containing the changes.

state class-attribute instance-attribute

state: str | None = None

Current state (open/closed/merged).

target_branch instance-attribute

target_branch: str

Branch to merge into.

title instance-attribute

title: str

Title of the pull request.

updated_at class-attribute instance-attribute

updated_at: datetime | None = None

Last update timestamp.

url class-attribute instance-attribute

url: str | None = None

URL to the PR.

:fa-brands-github: Show source on GitHub