pkgcore.bugzilla.query module¶
Composable searches against GET /rest/bug.
Constraints come in two flavours. Plain equality goes in BugQuery.simple
as repeated parameters, which Bugzilla ORs within a key and ANDs across keys.
Anything needing an operator becomes a Criterion rendered into the
f<N>/o<N>/v<N> boolean chart parameters, with the slot numbers
allocated at render time so any two queries can be combined.
- class pkgcore.bugzilla.query.BugQuery(simple: tuple[tuple[str, tuple[str, ...]], ...] = (), charts: tuple[Criterion | ChartGroup, ...] = (), limit: int | None = None, offset: int | None = None, order: str | None = None)[source]¶
Bases:
objectA search, built from named constructors and combined with
&- classmethod any_of(*queries: BugQuery) BugQuery[source]¶
OR several chart-only queries together.
Simple parameters can’t take part in a chart group, so a query holding any is rejected rather than silently ANDed in.
- batches(base_length: int = 0, max_length: int = 6000) Iterator[BugQuery][source]¶
Split into sub-queries whose encoded parameters each fit the budget.
Only the largest splittable axis is divided, either the
idsimple parameter or aCriterionmarked splittable; everything else is repeated in every batch. Sizing uses the encoded length rather than a count, so it adapts to long atoms instead of guessing.
- classmethod category(*categories: BugCategory) BugQuery[source]¶
Restrict to keywordreqs and/or stablereqs
- charts: tuple[Criterion | ChartGroup, ...]¶
- classmethod flag(name: str, *statuses: FlagStatus | str) BugQuery[source]¶
Match a flag by status.
Bugzilla can’t express “flag is absent”; those bugs have to be fetched and filtered client side.
- classmethod package_list_any(packages: Iterable[object]) BugQuery[source]¶
Match bugs whose package list mentions any of these packages
- paged(limit: int, offset: int = 0) BugQuery[source]¶
Return a copy with explicit paging.
Bugzilla rejects an offset without a limit, and treats
limit=0as unlimited while silently discarding the offset, so both are refused.
- params() list[tuple[str, str]][source]¶
Render to ordered query parameters.
Ordered pairs rather than a mapping, since chart slots are positional and duplicate keys are meaningful.
- class pkgcore.bugzilla.query.ChartGroup(join: Join, children: tuple[Criterion | ChartGroup, ...])[source]¶
Bases:
objectSeveral conditions combined with an explicit join
- children: tuple[Criterion | ChartGroup, ...]¶