Files
houseplan-card/.github/workflows/_process-metrics.yml
T
Claude baf283c50f ci: thin default-branch callers invoke reusable bodies at @dev (#623)
Six workflows run from the default branch (issues, schedule, workflow_run):
process, process-resume, process-reconcile, mutation-gate, nightly,
process-metrics. Their bodies move to _<name>.yml (on: workflow_call); the
original files keep only triggers, run-name, permissions, concurrency and one
job `uses: Matysh/houseplan-card/.github/workflows/_<name>.yml@dev` with
`secrets: inherit`. A pipeline change becomes one commit to dev.

- caller job permissions = union of body job permissions (#556 minimum kept
  per job inside the body); caller `if` repeats the body guard for process and
  process-resume so unrelated events stay skipped;
- dispatch inputs forwarded via workflow_call inputs of the same names;
- _mutation-gate.yml keys evidence/marker on job.workflow_sha (the body SHA):
  in a called workflow github.workflow_sha belongs to the caller in main;
- action-pins: narrow exception for this repo's _*.yml at @dev with a reason;
- preflight workflow_sync compares all six thin callers (was 3 of 6);
  performance.yml excluded: its schedule judges main with main's own body;
- tests read bodies from _*.yml; new test/default-branch-workflows.test.mjs;
  six mutants; PROCESS.md §10.4, AGENTS.md, REVIEWER.md updated.

Issue: #623
User-Visible: no
2026-09-24 10:23:28 +03:00

60 lines
2.5 KiB
YAML

name: "Метрики процесса · тело (#623)"
# #637: еженедельный замер вместо ощущений — lead time S→S7→S8, раунды ревью,
# прогоны Validate по исходам, минуты конвейера в S4/S7. Только чтение: отчёт
# идёт в step summary и артефакт; в issue и репозиторий ничего не пишется.
# Цифры аудита 22.09 (1,57 раунда код-ревью, S7 ≈ 36 мин/раунд, 226 Validate
# за неделю) были собраны руками за час — теперь они стоят один запуск.
on:
# #623: тело вызывается тонким файлом `process-metrics.yml` из ветки по умолчанию
# по ссылке `@dev`; триггеры, run-name и concurrency живут там.
workflow_call:
inputs:
days:
description: "Окно в днях"
required: false
type: string
default: "7"
permissions:
contents: read
actions: read
issues: read
jobs:
metrics:
name: "Снимок недели: issue, раунды, прогоны"
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
# Код — из dev, как у reconcile: расписание читается из main, а исполняется
# версия, которую проверил CI.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: dev
fetch-depth: 1
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
- name: Собрать отчёт
env:
GH_TOKEN: ${{ secrets.HP_PROCESS_TOKEN }}
REPO: ${{ github.repository }}
DAYS: ${{ inputs.days || '7' }}
run: |
mkdir -p artifacts/process-metrics
node scripts/process-metrics.mjs --repo="$REPO" --days="$DAYS" \
--output=artifacts/process-metrics/report.md \
--json=artifacts/process-metrics/report.json > /dev/null
cat artifacts/process-metrics/report.md >> "$GITHUB_STEP_SUMMARY"
- name: Сохранить отчёт
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: process-metrics-${{ github.run_id }}
path: artifacts/process-metrics
if-no-files-found: error
retention-days: 90