Files
cc-ci-orchestrator/.claude/skills/ci-test-review/verify-pr.sh
T
notplantsandClaude Opus 4.8 db31c08d6a Add /recipe-upgrade + /upgrade-all skills (cc-ci-gated upgrades, never merge)
Per-recipe and fleet-wide upgrade skills modelled on recipe-maintainer's
recipe-upgrade-full / recipe-upgrade-cron-all, but gated by the cc-ci CI server
and inheriting ci-test-review's create+verify+never-merge discipline.

- recipe-upgrade/: plan (release notes, breaking changes) -> implement (abra
  recipe upgrade + version bump + config, lint) -> open the recipe PR -> VERIFY
  green on cc-ci (full suite cold against the PR head via verify-pr.sh). If the
  upgrade is correct but a cc-ci TEST went stale, also update the test, verify
  it, and open a second PR to recipe-maintainers/cc-ci. Never merges; never
  weakens a test; prefers a recipe-only PR. Emits a parseable RESULT line.
  + open-recipe-pr.sh: adapted recipe-create-pr; runs on cc-ci (has the recipe
    checkout + bot token), creds passed from the orchestrator .testenv;
    force-syncs the mirror main so the PR diff is exactly the upgrade.
- upgrade-all/: weekly fan-out — enumerate enrolled recipes, survey upgrades,
  run /recipe-upgrade per upgradeable recipe via subagent (sequential default,
  --parallel / --dry-run), collect into one PR-list summary. Coordination +
  single-writer + shared-Swarm-teardown guardrails; built for a weekly cron.
- ci-test-review/verify-pr.sh: pass SRC (recipe-maintainers/<recipe>) alongside
  REF so the harness clones the mirror PR head correctly (its real contract).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 17:19:20 +01:00

53 lines
2.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# ci-test-review :: deterministic PR verification on the CI server (NO AI)
# -------------------------------------------------------------------------
# Verifies a RECIPE PR the same way `!testme` does: deploy + run the FULL suite
# COLD against the PR head on cc-ci. The harness decides pass/fail — this script
# only runs it and reports the exit code + RUN SUMMARY. AI never judges here.
#
# RECIPE=ghost REF=my-fix-branch verify-pr.sh # 1 cold green = working
# RECIPE=lasuite-drive REF=sha REPEAT=3 verify-pr.sh # repeated-green: ONLY
# # for a known-flaky recipe
#
# REF is the recipe PR head (branch name or sha) on the recipe mirror that abra
# fetches from. Green iff EVERY repeat exits 0.
#
# (CI-SERVER PRs are verified differently — check the branch out in a clone on
# cc-ci, rebuild, re-run the failing recipe(s) + a regression sample — see
# SKILL.md step 5; that path is bespoke and not scripted here.)
set -o errexit -o nounset -o pipefail
SSH="${SSH:-cc-ci}"
REPEAT="${REPEAT:-1}"
: "${RECIPE:?set RECIPE (e.g. ghost)}"
: "${REF:?set REF (the PR head branch or sha)}"
# SRC = the mirror repo under git.autonomic.zone holding the PR branch. The harness
# clones SRC at REF (then pulls upstream tags so the upgrade tier can deploy a prior
# published version). Defaults to the recipe's recipe-maintainers mirror.
SRC="${SRC:-recipe-maintainers/${RECIPE}}"
RUNID="$(date -u +%Y%m%dT%H%M%SZ)"
REMOTE_LOG="/root/cc-ci-review-logs/verify-${RECIPE}-${RUNID}"
ssh "$SSH" "mkdir -p /root/cc-ci-review-logs"
echo "verify-pr: RECIPE=$RECIPE SRC=$SRC REF=$REF cold full-suite x${REPEAT} on ${SSH}" >&2
green=1
for i in $(seq 1 "$REPEAT"); do
log="${REMOTE_LOG}.${i}.log"
rc=0
# Real harness, cold (no --quick), against the mirror PR head — same path as !testme.
ssh "$SSH" "cd /root/cc-ci && RECIPE='${RECIPE}' SRC='${SRC}' REF='${REF}' cc-ci-run runner/run_recipe_ci.py >'${log}' 2>&1" || rc=$?
echo "--- pass ${i}/${REPEAT}: exit ${rc} (log ${SSH}:${log}) ---" >&2
ssh "$SSH" "awk '/===== RUN SUMMARY =====/{f=1} f{print}' '${log}'" >&2 || true
[ "$rc" = "0" ] || green=0
done
if [ "$green" = "1" ]; then
echo "VERDICT: GREEN — ${RECIPE} PR (REF=${REF}) passed cold full-suite x${REPEAT}. Ready for operator merge (NOT merged)." >&2
exit 0
else
echo "VERDICT: RED — ${RECIPE} PR (REF=${REF}) did not pass. Iterate the fix (<=3 attempts) or report needs-work. Do NOT weaken tests; do NOT merge." >&2
exit 2
fi