Skip to content

fix(previews): reap unlabelled stages and stop skipped runs cancelling teardown - #1586

Merged
Makisuo merged 3 commits into
mainfrom
fix/preview-orphan-proofing
Oct 19, 2026
Merged

Makisuo merged 3 commits into
mainfrom
fix/preview-orphan-proofing

fix(previews): let the orphan sweep read workflow runs

87c2df6
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Oct 19, 2026 in 31s

Confidence 10/10 · No issues found

🟢 Confidence 10/10 · safe to merge
The one change since the last review, actions: read, is exactly the scope the stage sweep's workflow-run lookup needs, and nothing else calls it.
no findings · tests covered · risk medium

Preview sweeps now treat "open but unlabelled" as retired, skipped preview runs get their own concurrency group so they cannot cancel a teardown, and the live cap drops to 3. Safe to merge: the earlier 403 is fixed by actions: read.

  • previewStateOf returns retired for an open PR without the preview label
  • deploy-pr-preview concurrency group is per-PR only for runs that deploy or tear down
  • cleanup-preview-orphans grants actions: read so the stage sweep can list preview runs
What was checked
  • actions: read covers GET /repos/{repo}/actions/workflows/deploy-pr-preview.yml/runs (pr-state.ts:38), and only preview-stage-orphan-sweep.ts:304 calls hasActivePreviewRun
  • The concurrency test matches the job if for closed, unlabeled and labelled pushes; a missing label.name yields false, not an error
  • CI's plan-tests step runs pr-state.test.ts under bun:test, and its assertions match previewStateOf

87c2df6 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.