Skip to content

feat(github): show every target's plan, not just the reviewed one - #1425

Open
aparajon wants to merge 1 commit into
armand/multi-target-plan-groupsfrom
armand/multi-target-plan-group-bodies
Open

aparajon wants to merge 1 commit into
armand/multi-target-plan-groupsfrom
armand/multi-target-plan-group-bodies

Conversation

@aparajon

@aparajon aparajon commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Targets under a targets: list are planned each and converge on their own, so
they are free to hold different schemas and usually do. The plan comment already
named that divergence, but it still rendered only the reviewed plan's DDL. An
operator was being asked to authorize work the comment never showed them.

Each distinct plan now renders under the members that would run it. The reviewed
plan stays open, the rest collapse behind a line saying the apply runs them too,
and a group already at the desired schema is named rather than hidden. The
summary line counts the rollout rather than the reviewed plan alone.

A primary already at the desired schema also no longer short-circuits the whole
comment to "No schema changes detected" while its siblings still have work.

In the example below primary/testapp_1 is the reviewed target and alters
users, primary/testapp_2 plans the same change, and primary/testapp_3 plans
that alter plus an index.

Before                                          After

+------------------------------------------+    +------------------------------------------+
| Planned separately for 3 targets         |    | Planned separately for 3 targets         |
| 2 distinct plans. Each applies its own   |    | 2 distinct plans. Each applies its own   |
+------------------------------------------+    +------------------------------------------+
| ALTER users ADD email                    |    | [open] testapp_1 (primary), testapp_2    |
|                                          |    |        - 1 DDL statement                 |
|   x testapp_3's second statement is      |    |        ALTER users ADD email             |
|     nowhere on the comment               |    +------------------------------------------+
|                                          |    | [+] testapp_3 - 2 DDL statements         |
|                                          |    +------------------------------------------+
|                                          |    | ! Applying runs each target's own plan,  |
+------------------------------------------+    |   including the collapsed one            |
| Plan: 1 table to alter                   |    +------------------------------------------+
|   x counts the primary alone             |    | Plan: 2 distinct plans on 3 targets      |
+------------------------------------------+    +------------------------------------------+

This upholds RV-3: the consent an operator gives is specific to what will
run, and what will run is every target's plan, not one member's.

Targets converging: before

Schema Change Plan — Production

Database: testapp | Type: MySQL | Schema Name: testapp

Requested by @jackjackbits at 2026-01-01 00:00:00 UTC · planned from abcdef1

Planned separately for all 3 targets (primary/testapp_1, primary/testapp_2, primary/testapp_3) — 2 need this change, 1 is already at this schema.

ALTER TABLE `users` ADD COLUMN `email` varchar(255);

📋 Plan: 1 table to alter


▶️ To apply all schema changes from this PR, comment:

schemabot apply -e production
Targets converging: after

Schema Change Plan — Production

Database: testapp | Type: MySQL | Schema Name: testapp

Requested by @jackjackbits at 2026-01-01 00:00:00 UTC · planned from abcdef1

Planned separately for all 3 targets (primary/testapp_1, primary/testapp_2, primary/testapp_3) — 2 need this change, 1 is already at this schema.

primary/testapp_1 (primary), primary/testapp_3 — 1 DDL statement

ALTER TABLE `users` ADD COLUMN `email` varchar(255);

primary/testapp_2 — already at this schema, nothing to apply.

📋 Plan: 1 DDL statement on 2 of 3 targets


▶️ To apply all schema changes from this PR, comment:

schemabot apply -e production
Targets diverging: before

Schema Change Plan — Production

Database: testapp | Type: MySQL | Schema Name: testapp

Requested by @jackjackbits at 2026-01-01 00:00:00 UTC · planned from abcdef1

Planned separately for all 3 targets (primary/testapp_1, primary/testapp_2, primary/testapp_3) — 2 distinct plans. Each target applies its own.

ALTER TABLE `users` ADD COLUMN `email` varchar(255);

📋 Plan: 1 table to alter


▶️ To apply all schema changes from this PR, comment:

schemabot apply -e production
Targets diverging: after

Schema Change Plan — Production

Database: testapp | Type: MySQL | Schema Name: testapp

Requested by @jackjackbits at 2026-01-01 00:00:00 UTC · planned from abcdef1

Planned separately for all 3 targets (primary/testapp_1, primary/testapp_2, primary/testapp_3) — 2 distinct plans. Each target applies its own.

`primary/testapp_1` (primary), `primary/testapp_2` — 1 DDL statement
ALTER TABLE `users` ADD COLUMN `email` varchar(255);
`primary/testapp_3` — 2 DDL statements
ALTER TABLE `users` ADD COLUMN `email` varchar(255);

ALTER TABLE `users` ADD INDEX `idx_email`(`email`);

⚠️ Applying runs each target's own plan, including the ones collapsed above.

📋 Plan: 2 distinct plans on 3 targets


▶️ To apply all schema changes from this PR, comment:

schemabot apply -e production

Opened by Claude (Claude Opus 5).

Targets under a `targets:` list are planned each and converge on their own,
so they are free to hold different schemas and usually do. The plan comment
named that divergence but still rendered only the reviewed plan's DDL, which
left an operator authorizing work the comment never showed them.

Each distinct plan now renders under the members that would run it. The
reviewed plan's block stays open, the rest collapse behind a consent line
saying the apply runs them too, and a member group already at the desired
schema is named rather than hidden. The summary line counts the rollout
instead of the reviewed plan alone.

A primary already at the desired schema no longer short-circuits the comment
to "no schema changes detected" when its siblings still have work to apply,
which upholds UX-3: the comment describes the apply an operator would
authorize, not one member of it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@aparajon
aparajon marked this pull request as ready for review September 17, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant