fix(recipe-report): weekly trigger uses launch-report.py 'fresh'; start kills idle/leftover session
A stale cc-ci-report session (from a prior week's run, gone idle) caused this week's launch-report.py 'start' (use-or-create) to leave it and never run a fresh report. Fix: upgrade-all step 6 now calls 'fresh', and start only leaves a session that's actively busy producing a report — an idle/leftover session is killed + restarted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -117,9 +117,10 @@ End with the report path and a reminder that **nothing was merged**.
|
||||
|
||||
## 6. Launch the public Recipe Report
|
||||
Once the summary is written, kick off the weekly public report (its own agent, separate model — default
|
||||
opus): `python3 /srv/cc-ci/cc-ci-plan/launch-report.py start`. It runs `/recipe-report`, reviews this
|
||||
run + the live recipe/PR state, and publishes to https://report.ci.commoninternet.net. Fire-and-forget
|
||||
— it runs independently; you can then go idle.
|
||||
opus): **`python3 /srv/cc-ci/cc-ci-plan/launch-report.py fresh`** (use `fresh`, not `start` — the report
|
||||
is a one-shot and must always run a NEW session for THIS week, even if a previous report session is
|
||||
still around). It runs `/recipe-report`, reviews this run + the live recipe/PR state, and publishes to
|
||||
https://report.ci.commoninternet.net. Fire-and-forget — it runs independently; you can then go idle.
|
||||
|
||||
## Safety / coordination (this matters — shared host with the build loops)
|
||||
- **Sequential is the default for a reason.** Recipe deploys are **stateful on the shared Swarm** and
|
||||
|
||||
@ -32,6 +32,7 @@ def die(m): log(f"ERROR: {m}"); sys.exit(1)
|
||||
def _sh(c): return subprocess.run(c, capture_output=True, text=True)
|
||||
def session_alive(): return _sh(["tmux", "has-session", "-t", SESSION]).returncode == 0
|
||||
def kill_session(): subprocess.run(["tmux", "kill-session", "-t", SESSION], capture_output=True)
|
||||
def _busy(): return "esc to interrupt" in _sh(["tmux", "capture-pane", "-pt", SESSION]).stdout
|
||||
|
||||
|
||||
def build_kickoff(date):
|
||||
@ -56,9 +57,11 @@ def start(mode, date):
|
||||
die("tmux not found")
|
||||
Path(LOG_DIR).mkdir(parents=True, exist_ok=True)
|
||||
if session_alive():
|
||||
if mode == "use-or-create":
|
||||
log(f"{SESSION} already running — leaving it"); return
|
||||
log(f"{SESSION} exists — killing (fresh)"); kill_session(); time.sleep(1)
|
||||
# The report is a one-shot. Leave the session ONLY if it's actively producing a report;
|
||||
# an idle/leftover session (e.g. last week's, gone idle) is killed so a new run starts.
|
||||
if mode == "use-or-create" and _busy():
|
||||
log(f"{SESSION} busy with a report — leaving it"); return
|
||||
log(f"{SESSION} exists (idle/leftover) — killing first"); kill_session(); time.sleep(1)
|
||||
|
||||
kf = Path(LOG_DIR) / f".kickoff-{SESSION}.txt"
|
||||
kf.write_text(build_kickoff(date))
|
||||
|
||||
Reference in New Issue
Block a user