utils.github package

Subpackages

Submodules

utils.github.playwright_summary module

Render Playwright JUnit XML reports as GitHub Actions step-summary markdown.

Walks the given directory, parses every playwright-junit.xml it finds, and prints a markdown table with one row per test case (app, test title, status, message) to stdout. The output is designed to be appended to $GITHUB_STEP_SUMMARY.

Usage:

python3 utils/github/playwright_summary.py <reports-dir> [<context-label>] # nocheck: self-path-reference

utils.github.playwright_summary.main() → int

utils.github.pytest_summary module

Render pytest junit-xml reports as a GitHub step-summary section.

Usage: python3 utils/github/pytest_summary.py <reports-dir> # nocheck: self-path-reference

Reads every *.xml under <reports-dir> (one per test target, written by scripts/tests/code/run.sh via --junitxml). Per report: a headline with the pass/fail/skip counts and total time, failures rendered opened, and the full per-test table (name, status, duration) collapsed in a details block, slowest first.

utils.github.pytest_summary.main() → int

utils.github.run_name module

Recover a manual CI run’s inputs from its run name.

entry-manual-steer.yml declares a run-name: that interpolates the dispatch inputs. Once a run has started, that title is the only record of them: the REST API answers inputs: null for a workflow_dispatch run. Anything that wants to know what a run was dispatched with therefore parses the title — and parsing it against a hand-copied format would drift the moment the workflow changes, silently and without a failing test.

So the format is read from the workflow itself. Every input renders as one segment, <head><value> ``, where the head is the emoji the workflow's own ``format('🐧{0} ', …) prefixes the value with. An input holding its default renders no segment at all, so a title carries only what deviates — and an absent input means “the workflow’s default”, which is exactly what a retrigger should leave alone.

utils.github.run_name.heads(tpl: str | None = None) → dict[str, str]

Input name -> the literal its value segment opens with, template order.

utils.github.run_name.markers(tpl: str | None = None) → dict[str, str]

Input name -> the literal its marker segment renders when set.

utils.github.run_name.openings(tpl: str | None = None) → set[str]

Every literal a rendered segment can start with, so any of them ends the value before it.

Comparison operands (inputs.workspace != 'auto') and the glyphs a value renders as are excluded: they are what the template tests and emits, never what a segment opens with.

utils.github.run_name.segments(tpl: str | None = None) → list[tuple[str, str, bool]]

(input name, opening literal, is_marker) per rendered segment, in template order.

A value segment interpolates its input through a format() placeholder and opens with the format string up to {0}. A marker segment carries no value at all: its literal shows only that the input was set, and its absence is the other state.

An input whose format() opens with nothing yields no segment: with no opening literal there is nothing to locate in a title, and str.find('') would match at position 0 and hand back the title’s own prefix as the value. Such an input renders a glyph the reader understands and is recovered from the job log instead (runs.LOG_INPUTS).

utils.github.run_name.template() → str

The raw run-name: string declared by the manual CI workflow.

utils.github.run_name.value_from_title(title: str, input_name: str, tpl: str | None = None) → str

Value input_name held when the run named title was dispatched.

Returns an empty string when the title carries no segment for the input — it was dispatched with the workflow’s default, or the title comes from another entry point entirely and records nothing at all.

Raises:

ValueError – the run name renders no segment for this input, so no title could ever carry its value.

utils.github.run_name.values_from_title(title: str, tpl: str | None = None) → dict[str, str]

Every input the run named title records, keyed by input name.

Value inputs left on their default render no segment and are absent. A marker input is always reported, 'true' or 'false' by the marker’s presence — which is why a title that does not open with the run name’s own prefix yields nothing at all rather than a title-wide ‘false’.

Module contents