Files
houseplan-card/.github/workflows/_process-resume.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

61 lines
3.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: "Продолжение ревью после Validate · тело (#623)"
# #636. Стадия `prepare` конвейера (process.yml) больше не ждёт Validate с
# мутантами на материале внутри job — раннер спал ≈ 28 минут на раунд при
# 10–12 минутах работы модели. Она диспатчит прогон, кладёт запечатанный
# маркер `review-pending-…` и выходит. Этот workflow просыпается на завершение
# любого Validate и, если раунд ждал именно этот прогон (маркер на материале,
# метка S7 стоит, активного прогона конвейера нет), переставляет метку S7 —
# новый прогон `prepare` находит завершённый dispatch и продолжает раунд.
# Ничего не оценивает: зелёный/красный разбирает сам конвейер. Страховка на
# потерянное событие — process-reconcile.yml с тем же маркером.
#
# Для события `workflow_run` GitHub берёт workflow только из ветки по
# умолчанию (main). Там лежит тонкий `process-resume.yml`, который вызывает
# этот файл по ссылке `@dev` (#623); сверка тонких копий — в preflight
# validate.yml.
on:
# #623: тело вызывается тонким файлом `process-resume.yml` из ветки по умолчанию
# по ссылке `@dev`; триггеры, run-name и concurrency живут там.
workflow_call:
permissions:
contents: read
actions: read
jobs:
resume:
name: "Разбудить раунд, ждавший этот Validate"
if: github.event.workflow_run.event == 'workflow_dispatch' && startsWith(github.event.workflow_run.head_branch, 'issue/')
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: process-resume-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: false
steps:
# Код берётся из dev, как у reconcile: после штатного слияния действует
# версия, которую проверил CI, а не копия из main.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: dev
fetch-depth: 1
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
# Метка переставляется HP_PROCESS_TOKEN: событие от GITHUB_TOKEN не
# запустило бы process.yml (см. шапку process.yml, п. 1).
- name: Решить по маркеру ожидания и переставить S7
env:
GH_TOKEN: ${{ secrets.HP_PROCESS_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: ${{ github.event.workflow_run.head_branch }}
SHA: ${{ github.event.workflow_run.head_sha }}
EVENT: ${{ github.event.workflow_run.event }}
STATUS: ${{ github.event.workflow_run.status }}
run: |
node scripts/process-resume.mjs \
--repo="$REPO" --branch="$BRANCH" --sha="$SHA" \
--event="$EVENT" --status="$STATUS" --apply=true | tee -a "$GITHUB_STEP_SUMMARY"