|
| 1 | +# Auto-merge sync PRs Implementation Plan |
| 2 | + |
| 3 | +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. |
| 4 | +
|
| 5 | +**Spec:** `docs/2026-08-28-auto-merge-sync-prs/spec.md` |
| 6 | +**Branch:** `feature/2026-08-28-auto-merge-sync-prs` |
| 7 | + |
| 8 | +**Goal:** Queue GitHub auto-merge on bot catalog and post-release manifest PRs; fail the job if queueing fails. |
| 9 | + |
| 10 | +**Architecture:** Keep `gh pr merge --auto --squash --delete-branch`. Remove the swallow on the release job. Call the same command from `catalog-sync-ci.ts` after create and after updating an existing PR. Tests assert the workflow/script strings. Repo `allow_auto_merge` is enabled via GitHub API (already done). |
| 11 | + |
| 12 | +**Tech Stack:** GitHub Actions, `gh`, Bun tests (`tests/unit/release-workflow.test.ts`). |
| 13 | + |
| 14 | +## Global Constraints |
| 15 | + |
| 16 | +- PRs against `BrainerVirus/opencode-commandcode` base `main`. Squash + delete source branch. |
| 17 | +- In-place `feature/2026-08-28-auto-merge-sync-prs` (no worktrees). |
| 18 | +- Conventional commit `ci:` so path-gated semantic-release does not publish. |
| 19 | +- Do not fold this package into workit. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +### Task 1: Fail loud on manifest auto-merge; queue catalog PRs |
| 24 | + |
| 25 | +**Files:** |
| 26 | +- Modify: `.github/workflows/release.yml` |
| 27 | +- Modify: `scripts/catalog-sync-ci.ts` |
| 28 | +- Modify: `tests/unit/release-workflow.test.ts` |
| 29 | +- Modify: `README.md` |
| 30 | + |
| 31 | +- [ ] **Step 1: Write the failing test** |
| 32 | + |
| 33 | +In `tests/unit/release-workflow.test.ts`, on the sync step `run` string: |
| 34 | + |
| 35 | +- still contains `gh pr merge --auto --squash --delete-branch` |
| 36 | +- does **not** contain `auto-merge unavailable` or `|| echo` |
| 37 | + |
| 38 | +On `scripts/catalog-sync-ci.ts` source: contains `gh pr merge --auto --squash --delete-branch`. |
| 39 | + |
| 40 | +- [ ] **Step 2: Run the test and confirm it fails** |
| 41 | + |
| 42 | +```bash |
| 43 | +bun test tests/unit/release-workflow.test.ts |
| 44 | +``` |
| 45 | + |
| 46 | +- [ ] **Step 3: Implement** |
| 47 | + |
| 48 | +`release.yml`: drop `|| echo "auto-merge unavailable — merge the sync PR after CI is green"`. |
| 49 | + |
| 50 | +`catalog-sync-ci.ts`: after `gh pr create` and after logging an updated existing PR, run `gh pr merge --auto --squash --delete-branch` (stdio inherit, same cwd). Do not swallow errors. |
| 51 | + |
| 52 | +README Development: catalog and manifest-sync PRs auto-merge when the five checks are green. |
| 53 | + |
| 54 | +- [ ] **Step 4: Run tests and `bun run check`** |
| 55 | + |
| 56 | +```bash |
| 57 | +bun test tests/unit/release-workflow.test.ts |
| 58 | +bun run check |
| 59 | +``` |
0 commit comments