pkgcore.bugzilla.bug module

Immutable value objects for what bugs.gentoo.org hands back.

Each Bug field carries the wire name it came from and how to decode it, so INCLUDE_FIELDS and parse_bug() are both derived from the one declaration and can’t drift apart.

class pkgcore.bugzilla.bug.Bug(*, id: BugId = 0, summary: str = '', product: str = '', component: str = '', version: str = '', status: str = '', resolution: str = '', severity: str = '', priority: str = '', assigned_to: str = '', creator: str = '', cc: tuple[str, ...]=(), keywords: tuple[str, ...]=(), whiteboard: str = '', alias: tuple[str, ...]=(), tags: tuple[str, ...]=(), depends_on: tuple[~pkgcore.bugzilla.wire.BugId, ...]=(), blocks: tuple[~pkgcore.bugzilla.wire.BugId, ...]=(), see_also: tuple[str, ...]=(), groups: tuple[str, ...]=(), flags: tuple[~pkgcore.bugzilla.bug.Flag, ...]=(), deadline: date | None = None, creation_time: datetime = datetime.datetime(1970, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), last_change_time: datetime = datetime.datetime(1970, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), package_list: PackageList = <PackageList ''>, runtime_testing_required: RuntimeTesting = RuntimeTesting.UNSET)[source]

Bases: object

An immutable snapshot of a bug.

Anonymous requests get every email address truncated at the @, so assigned_to, creator and cc only hold full addresses when the client was given an api key.

alias: tuple[str, ...]
arches(known_arches: Container[str]) tuple[str, ...][source]

Arch names found in CC, tolerating truncated anonymous addresses

assigned_to: str
blocks: tuple[BugId, ...]
property category: BugCategory | None
cc: tuple[str, ...]
component: str
creation_time: datetime
creator: str
deadline: date | None
depends_on: tuple[BugId, ...]
flag(name: str) bool | None[source]

Tri-state status of a named flag, None when it isn’t set

flags: tuple[Flag, ...]
groups: tuple[str, ...]
id: BugId
keywords: tuple[str, ...]
last_change_time: datetime
package_list: PackageList
priority: str
product: str
resolution: str
property resolved: bool
runtime_testing_required: RuntimeTesting
property sanity_check: bool | None
property security: bool

Whether the bug lives in the security product.

Orthogonal to carrying the SECURITY keyword, which marks an ordinary bug as blocking a security one.

see_also: tuple[str, ...]
severity: str
status: str
summary: str
tags: tuple[str, ...]
property url: str
version: str
whiteboard: str
class pkgcore.bugzilla.bug.BugChanges(id: BugId, last_change_time: datetime, changes: dict[str, ~pkgcore.bugzilla.bug.FieldChange]=<factory>, alias: tuple[str, ...]=())[source]

Bases: object

The result of updating a bug

alias: tuple[str, ...]
changes: dict[str, FieldChange]
id: BugId
last_change_time: datetime
class pkgcore.bugzilla.bug.Comment(id: CommentId, bug_id: BugId, count: int, text: str, creator: str, creation_time: datetime, is_private: bool = False, tags: tuple[str, ...] = ())[source]

Bases: object

A single comment on a bug

bug_id: BugId
count: int
creation_time: datetime
creator: str
id: CommentId
is_private: bool
property obsolete: bool
tags: tuple[str, ...]
text: str
class pkgcore.bugzilla.bug.FieldChange(added: tuple[str, ...] = (), removed: tuple[str, ...] = ())[source]

Bases: object

What one field gained and lost in an update

added: tuple[str, ...]
removed: tuple[str, ...]
class pkgcore.bugzilla.bug.Flag(name: str, status: FlagStatus, id: FlagId = 0, type_id: FlagTypeId = 0, setter: str = '', requestee: str = '')[source]

Bases: object

A flag set on a bug

property granted: bool | None

Tri-state view: True for +, False for -, None otherwise

id: FlagId
name: str
requestee: str
setter: str
status: FlagStatus
type_id: FlagTypeId
class pkgcore.bugzilla.bug.User(id: int, name: str, real_name: str = '')[source]

Bases: object

The account an api key belongs to

id: int
name: str
real_name: str
pkgcore.bugzilla.bug.parse_bug(raw: RawBug) Bug[source]

Build a Bug from a raw response, skipping absent fields

pkgcore.bugzilla.bug.parse_changes(raw: RawChanges) BugChanges[source]
pkgcore.bugzilla.bug.parse_comment(raw: RawComment) Comment[source]
pkgcore.bugzilla.bug.parse_user(raw: RawWhoami) User[source]