pkgcore.bugzilla.transport module¶
HTTP plumbing for the Bugzilla REST API, on top of stdlib urllib.
- class pkgcore.bugzilla.transport.AuthMode(*values)[source]¶
Bases:
StrEnumWhere the api key is placed.
QUERYis the only mode bugs.gentoo.org honours today;HEADERexists for instances running Bugzilla 6.- HEADER = 'header'¶
- QUERY = 'query'¶
- class pkgcore.bugzilla.transport.Transport(*args, **kwargs)[source]¶
Bases:
ProtocolThe seam a client talks through
- class pkgcore.bugzilla.transport.UrllibTransport(base_url: str = 'https://bugs.gentoo.org', api_key: str | None = None, *, timeout: float = 30.0, retries: int = 3, auth_mode: AuthMode = AuthMode.QUERY, retry_writes: bool = False, user_agent: str | None = None, opener: OpenerDirector | None = None)[source]¶
Bases:
objectA Bugzilla transport built on
urllib.request.Reads are retried with exponential backoff, since bugs.gentoo.org signals overload by resetting the connection rather than returning 429. Writes are not, because a retried bug creation files a duplicate.
- pkgcore.bugzilla.transport.build_opener() OpenerDirector[source]¶
The opener used when a transport isn’t given one.
Indirected through a function so that
pkgcore.bugzilla.testingcan replace it, and intercept clients built somewhere it can’t reach.
- pkgcore.bugzilla.transport.build_user_agent(client: str | None = None) str[source]¶
Compose the User-Agent, most specific product first.
A caller’s own token goes in front of pkgcore’s rather than replacing it, so Gentoo infra can tell which tool the traffic came from while pkgcore stays identifiable.