Files
computer-playbook/cli/meta/ci/roles/runtime/__init__.py
T
kevinveenbirkenbachandClaude Opus 4.8 40052446dc refactor(ci): move role-runtime summary into cli.meta.ci.roles.runtime
Replace the single utils/github/profile/role_summary.py script with a
focused CLI package split per responsibility (model, logparse, csvio,
render, github, sources). Output format is selectable via --format
(table default, plus markdown, csv, json); source is auto-detected as an
Ansible log, a role-runtimes CSV, or a GitHub Actions run/job URL (CSV
artifacts downloaded via gh).

The compose workflow now writes the CSV as a downloadable artifact and
appends the per-variant markdown to the step summary, and hard-fails
when the log is missing or carries no profile_roles data so a broken
metrics capture can no longer pass silently.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 03:10:07 +02:00

14 lines
661 B
Python

"""Summarise Ansible `profile_roles` runtimes per matrix-deploy variant.
Single responsibility per module:
- `model` — the `RoleRuntime` record (one role's time within a segment).
- `logparse` — Ansible run log -> records (splits by matrix round/pass markers).
- `csvio` — records <-> CSV (the on-disk metrics schema, a single SPOT).
- `render` — records -> text in the format chosen via `--format`.
- `github` — a run/job URL -> records (downloads the CSV artifacts via `gh`).
- `sources` — pick the right loader for a log path, CSV path, or URL.
CLI: `python -m cli.meta.ci.roles.runtime <source> [--format ...] [--output ...]`.
"""