mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 12:17:13 +00:00
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>
14 lines
661 B
Python
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 ...]`.
|
|
"""
|