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

Migrate opens prefilled from a link, so the owner's import is one click a run can hand him #1382

Closed opened this
Closed without merging

/migrate?from= / / &crew= now opens the form with that source and agent selected, and starts nothing. I couldn't run bun test here: the sandbox blocks the unix socket the test harness listens on. I traced the failing test by reading the code instead, so the fix is unverified until the forge's check runs.

Notes

stopped closed without shipping deploy 98dd875

opened this

/migrate?from=<host>/<owner>/<name>&crew=<agent> now opens the form with that source and agent selected, and starts nothing. I couldn't run bun test here: the sandbox blocks the unix socket the test harness listens on. I traced the failing test by reading the code instead, so the fix is unverified until the forge's check runs.

The failure: the link's from host was matched against the origin's display label. That label is only the first DNS label of the host, with no port (from hostLabel in src/origins/mirror.ts). A link naming 127.0.0.1:PORT/... or any host with a port could never match, so "a link prefills the form and starts nothing" found no selected option.

The fix: each origin choice now carries its real web host, port included, taken from the origin's URL, and the link is matched against that case-insensitively. The change is in src/web/pages/migrate.ts.

Behaviour unchanged from the first attempt:

  • A from or crew that matches nothing gets a notice and the form stays unselected.
  • A malformed value is never echoed back.
  • Values are capped at 200 characters and escaped.
  • GET /migrate never creates a job.

What I left out: no auto-submit, since the link only chooses.

To try it: open /migrate?from=<origin web host>/<owner>/<repo>&crew=<agent> signed in. The source and agent are preselected, and nothing starts until you press Migrate. docs/ORIGINS.md documents the link form.

Closes #1078

commented

This pull now merges into main again. I haven't confirmed the migrate tests pass, because the sandbox here blocks the unix sockets they listen on. The merge conflict was in test/migrate.test.ts, which I fixed and pushed.

  • The conflict: the private-host test. My branch's side called migrateRepo(strict, b.value, …), but strict is never defined in that test. I took main's version, which uses the existing app and bob.
  • What I couldn't run: bun test test/migrate.test.ts fails here with EPERM on listen on a unix socket, so it never reaches the test bodies. I also couldn't type-check, since tsc can't find the bun type definitions in this sandbox. The full bun test was started but ran past the shell timeout, and I didn't wait for it.
  • What I checked: the conflict markers are gone from test/migrate.test.ts. The forge's check runs on this push, so its verdict will show whether the tests pass.

The change itself is unchanged: Migrate opens prefilled from ?from= and ?crew= links, with the origin matched by its web host, port included.

commented

Parked by the crew: the check failed ("migrate > a link prefills the form and starts nothing") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs