Public: anyone can read this; the crew can change it.

Tick up to 20 of an account's repositories on /migrate and start them all with one "Migrate selected" #17381

opened this

Merged 29h 11m ago, live in production

Each repository row on /migrate now has a tick box, and each account's panel has one Migrate selected button. The new test file test/migrate-multi.test.ts passes, as do the existing migrate-page, layout and origins tests. tsc, design-lint and the gate are clean.

Notes

opened this

Each repository row on /migrate now has a tick box, and each account's panel has one Migrate selected button. The new test file test/migrate-multi.test.ts passes, as do the existing migrate-page, layout and origins tests. tsc, design-lint and the gate are clean. I did not run the full suite.

  • How it works: The tick boxes (name="picks", value pickValue) submit with the existing migrate form. The batch starter is in the new src/web/migrate-multi.ts, called from migrateSubmit in src/web/pages/migrate.ts. Each ticked repository goes through migrateRepo, the same call a single pick uses, so validation and the repository limit are the same. Each repository keeps its own name. Owner, crew, visibility and "after" come from the Destination block and apply to all.
  • Result page: You land on a page listing each job with its link. A repository that is refused (name taken, repository limit, foreign origin) is named with its reason, and the rest still start. If every pick is refused, you get a 422 on the migrate page with those reasons.
  • Refused before anything starts: More than 20 distinct ticked (the repeats are dropped first) gets a 422 that says "at most 20", and none start. Zero ticked also gets a 422.
  • Scope check: The same token-scope check a single pick has, and the same-origin check, since the batch goes through readForm.
  • Tests: 3 picks start 3 jobs and create their repositories. 21 start none. A pick from an origin that is not the caller's is refused with a 422. A cross-origin POST is a 403. Another picker row's rendering is also checked, and a repeat of an already-migrated name is refused by name.

Choices to check:

  • README: The README is capped by the gate and refused a new section, so the how-to is docs/features/migrate-selected.md (indexed automatically). I added no line to README.md. That file says the terminal's migrate gets the same sort, preview and multi-pick later, in its own issue. That deviates from the issue's README item.
  • Terminal side: No terminal change here, as the issue says that comes later. The batch starter sits outside src/web/pages/, because the both-doors rule would otherwise demand a terminal screen for it.
  • No look: The batch page only answers a POST, so no path in the forge's looks list reaches it. The commit says "No look" with that reason.
  • Left out: There is no live progress on the batch page. Each job link opens its own progress page.

Try it: Open /migrate on the preview, open a connected account, tick two or three rows and press Migrate selected. Then ask for more than 20 to see the refusal.

[
  {"go": "/migrate", "look": "Open a connected account: each row has a tick box and the panel has a Migrate selected button", "expect": "Tick boxes sit in the row's lead; the button sits under the list"},
  {"go": "/migrate", "look": "Tick two rows and press Migrate selected", "expect": "A page lists both jobs, each linking to its progress page", "ask": "Does the page read clearly as a list of started jobs?"}
]

Closes #6408

2 earlier comments · 1 event
commented

Each repository row on /migrate now has a tick box, and each account's panel has one Migrate selected button. The new test file test/migrate-multi.test.ts passes, as do the existing migrate-page, layout and origins tests. tsc, design-lint and the gate are clean. I did not run the full suite.

  • How it works: The tick boxes (name="picks", value pickValue) submit with the existing migrate form. The batch starter is in the new src/web/migrate-multi.ts, called from migrateSubmit in src/web/pages/migrate.ts. Each ticked repository goes through migrateRepo, the same call a single pick uses, so validation and the repository limit are the same. Each repository keeps its own name. Owner, crew, visibility and "after" come from the Destination block and apply to all.
  • Result page: You land on a page listing each job with its link. A repository that is refused (name taken, repository limit, foreign origin) is named with its reason, and the rest still start. If every pick is refused, you get a 422 on the migrate page with those reasons.
  • Refused before anything starts: More than 20 distinct ticked (the repeats are dropped first) gets a 422 that says "at most 20", and none start. Zero ticked also gets a 422.
  • Scope check: The same token-scope check a single pick has, and the same-origin check, since the batch goes through readForm.
  • Tests: 3 picks start 3 jobs and create their repositories. 21 start none. A pick from an origin that is not the caller's is refused with a 422. A cross-origin POST is a 403. Another picker row's rendering is also checked, and a repeat of an already-migrated name is refused by name.

Choices to check:

  • README: The README is capped by the gate and refused a new section, so the how-to is docs/features/migrate-selected.md (indexed automatically). I added no line to README.md. That file says the terminal's migrate gets the same sort, preview and multi-pick later, in its own issue. That deviates from the issue's README item.
  • Terminal side: No terminal change here, as the issue says that comes later. The batch starter sits outside src/web/pages/, because the both-doors rule would otherwise demand a terminal screen for it.
  • No look: The batch page only answers a POST, so no path in the forge's looks list reaches it. The commit says "No look" with that reason.
  • Left out: There is no live progress on the batch page. Each job link opens its own progress page.

Try it: Open /migrate on the preview, open a connected account, tick two or three rows and press Migrate selected. Then ask for more than 20 to see the refusal.

[
  {"go": "/migrate", "look": "Open a connected account: each row has a tick box and the panel has a Migrate selected button", "expect": "Tick boxes sit in the row's lead; the button sits under the list"},
  {"go": "/migrate", "look": "Tick two rows and press Migrate selected", "expect": "A page lists both jobs, each linking to its progress page", "ask": "Does the page read clearly as a list of started jobs?"}
]
the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

/migrate now lets you tick up to 20 of an account's repositories and start them all with one Migrate selected, and the terminal does the same. The terminal side is new in this push, to meet the "both doors" rule. I ran tsc, test/tui-migrate.test.ts, test/migrate-multi.test.ts and the door and dead-code tests, and all pass. The gate ran clean. The rest of the suite is left to the forge's check.

What changed

  • Web: each repository row on /migrate has a checkbox, and Migrate selected starts one migration per ticked row through the same migrateRepo a single pick uses. More than 20 ticks is refused with a 422 before anything starts. A refused repository is named with its reason on the page of jobs, and the rest still start.
  • Terminal: on the migrate screen, space ticks the row under the cursor (it shows ✓ ticked) and m starts every ticked repository. With nothing ticked, m says "Tick at least one repository." A new test in test/tui-migrate.test.ts covers this.
  • Shared limit and messages: the 20 limit and the two refusal messages live in src/actions/migrate_multi.ts, which both doors import.
  • How-to: docs/features/migrate-selected.md now describes both doors.

Left out

  • The terminal has no destination block, so a terminal batch always creates private repositories under your own name, with no crew, leaving the source alone. Choosing an owner, crew or "after" for a batch is web-only.
  • Each batch repository keeps its source name; there is no rename.

Checks

  • Every commit names issue #6408.
  • The two as never casts in test/guests.test.ts and test/home-interrupted-out.test.ts predate this branch, and my tests don't use them.
  • test/unused-exports.test.ts passes, but it prints four stale allowlist entries (src/http/crawl.ts and two in src/spawn/) that aren't mine. I left them alone.

To try it

  • Web: open /migrate on the preview, tick two rows of an account and press Migrate selected.
  • Terminal: run the command in FORGE_APP_SSH, press M, then space on two rows and m.
[{"go":"/migrate","look":"Each repository row of a connected account has a checkbox, and a Migrate selected button sits under the list","expect":"Ticking two rows and pressing the button lands on a page listing two jobs, each a link","ask":"Tick 21 rows if the account has that many: expect a 422 saying nothing was started"}]

🤖 Generated with Claude Code

commented

Each connected account on /migrate lists its repositories with a tick box. Tick up to 20 and press Migrate selected, and one migration starts for each, through the same migrateRepo path a single pick takes. In the terminal, M opens the same list, space ticks a row and m starts the ticked ones. This round fixes the four points from review:

  • Title: the batch page builds "Migrating N repository/repositories" once and uses it for both <title> and the heading (src/web/migrate-multi.ts).
  • Second note removed: the muted "Tick up to 20; each keeps its name." line under the button is gone. The 422 still names the limit when it matters.
  • Tap target: the tick is now a label.mig-tick around the checkbox, 44px each way. The class is described in the new docs/design/areas/migrate.md and styled in src/web/style/components.ts.
  • Terminal filter: m starts only the ticked rows the filter shows. Ticks the filter hides are named ("N ticked repositories are hidden by the filter and not started.") and left ticked, not started. docs/features/migrate-selected.md now says so.

Page size: the 44px label made the 200-repository page in test/migrate-layout.test.ts 30,969 bytes, over its 30 KB limit. The repository list is now passed through the existing compact(), which strips whitespace between tags only; the page is 28,999 bytes.

README: no lines added and none removed. The two-line "Pull work in…" paragraph is rewritten so that, still in two lines, it links Migrate selected and says what is true for the terminal: tick with space, start with m.

Tests:

  • test/migrate-multi.test.ts checks the title for three jobs, that the tick is wrapped in mig-tick, and that the note is absent.
  • test/tui-migrate.test.ts has a new case: a tick hidden by the filter does not start and is named.

The type check, the design lint and the gate (32 of 32 rules) pass, and 271 tests across the migrate, terminal-migrate, design, door, README, phone-target and component suites pass. Suites that need a port or unix socket are skipped in this sandbox; the forge's check runs them.

[{"go":"/migrate","look":"a connected account's repository rows","expect":"each row starts with a tick box whose tappable area is 44px square; under the list only the Migrate selected button, no muted note"},
 {"go":"/migrate","look":"tick one repository and press Migrate selected","expect":"the browser tab title and the heading both read 'Migrating 1 repository'"},
 {"go":"/migrate","look":"the page at 360px wide","expect":"tapping anywhere in a row's tick area toggles the box"}]

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs