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

A migrated app's crew says what happens to its old database's rows, and ships the one-shot import to bring them #1035

Closed opened this
Closed without merging

scout/forge:scout/1007-a-migrated-app-s-crew-says-what-happens → main 2 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
3 files changed +11 −1
docs/ORIGINS.md +5 −1
@@ -388,7 +388,11 @@ importer's — adapt, don't rewrite: declare `run` and `health` in
388388 `forge.json` (and `install`/`test` when the repository has them), listen on
389389 `PORT`, keep persistent state under `FORGE_APP_DATA`, keep behaviour, no
390390 Dockerfile and no compose file (the forge runs processes), and write down
391 what could not fit. The crew proposes; a person lands — autonomy included,
391 what could not fit. An old database server (Postgres, MySQL) is left
392 untouched and never read at boot; the app's state moves under
393 `FORGE_APP_DATA`, and when rows exist the pull ships a one-shot import script
394 (dump file in, `FORGE_APP_DATA` out) with the steps to make the dump and run
395 it on purpose. The crew proposes; a person lands — autonomy included,
392396 exactly as for any app (docs/APPS.md).
393397
394398 The clone runs as a job in the mirror's registry (`origins/jobs.ts`, kind
src/actions/migrate.ts +1
@@ -565,6 +565,7 @@ Adapt, don't rewrite:
565565 - Listen on the port in \`PORT\`, on \`HOST\`. A hard-coded port becomes the fallback, not the rule.
566566 - Keep every piece of persistent state — a SQLite file, uploads, a data folder — under \`FORGE_APP_DATA\`. It must start on an empty one and restart on a full one.
567567 - The forge runs processes, not containers: no Dockerfile, no compose file. Read those only to learn what the app needs. A second service it cannot do without (a database server, a queue) becomes the app's embedded or file mode where it has one.
568 - Its old database server (Postgres, MySQL) is left untouched, and the app never reaches back to it: no connection string to it is committed or read at boot. The app's state moves under \`FORGE_APP_DATA\` (bun:sqlite, or the app's embedded mode). When rows exist there, ship a one-shot import script in the pull (dump file in, \`FORGE_APP_DATA\` out) that a person runs on purpose, and say in the pull how to make the dump (for example \`pg_dump\` or \`mysqldump\`) and the exact command to run the import.
568569 - Keep its routes, pages and behaviour as they were. The smallest diff a person can review quickly — no refactors, no restyling, no dependency churn beyond what running here needs.
569570 - Write down what could not fit — a service the forge cannot run, a secret you do not have — plainly, in the pull, so a person can decide. An honest blocker beats a broken deploy.
570571
test/migrate.test.ts +5
@@ -453,6 +453,11 @@ describe("migrate", () => {
453453 "FORGE_APP_DATA",
454454 "no Dockerfile, no compose",
455455 "could not fit",
456 "left untouched",
457 "never reaches back",
458 "one-shot import script in the pull (dump file in, `FORGE_APP_DATA` out)",
459 "how to make the dump",
460 "read at boot",
456461 fixtureUrl,
457462 ])
458463 expect(issue.body).toContain(words);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs