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

An app the owner no longer cares about is archived in one tap and restored in one, starting from the parked archive branch #10885

Closed opened this
Closed without merging

An admin can now archive an app from its page in one tap plus a confirm, and Restore it from the Archived list. Most of what the issue asks for was already on main. I did not run the whole suite.

stopped closed without shipping deploy a592008

opened this

An admin can now archive an app from its page in one tap plus a confirm, and Restore it from the Archived list. Most of what the issue asks for was already on main. I did not run the whole suite.

I couldn't use the parked branch mason/10779-archive-an-app-from-its-page-or-the-apps: it isn't on the remote, so I worked from main.

What was already there

  • Archiving stops production and previews through the runtime's stop, and keeps data and git.
  • The archived app leaves home and /apps.
  • /apps?archived=1 lists archived apps, each with a per-row button that wakes the app.
  • An archived app's URL still answers: /<owner>/<name> returns 200, and the app's own hostname returns a 503 "archived" page.
  • Waking restarts production.
  • The archive MCP tool already calls setArchived in src/actions/repos.ts. I did not touch the MCP, so there are no new tools or ceilings, and test/mcp-size.test.ts passes.

What I added

  • Archive on the app's page: src/web/studio/app.ts shows an Archive button to the app's admin. It goes through /-/confirm, with wording registered in src/web/pages/search.ts.
  • New route: POST /:owner/:name/archive in src/http/server.ts always archives. It reuses archiveSubmit through a shared archiveWith in src/web/pages/settings.ts, so the same-origin check, the admin gate and updateRepoSettings are unchanged.
  • Restore label: the buttons on the Archived list now say "Restore" instead of "Wake". I changed one assertion in test/apps-archived.test.ts to match the new label; the old assertion was only wrong about wording.
  • New test: the one-tap flow gets a test in test/apps-archived.test.ts. It checks that the confirm page is offered, that a cross-origin POST is refused, that archiving hides the app from /apps and shows it at ?archived=1, that the app's page still answers, and that restoring brings it back.

What I left alone

  • The Wake button on the repository page and in Settings keeps its "Wake" label, because test/archive-web.test.ts asserts it.

Checks run: bun x tsc --noEmit is clean, as are scripts/gate.ts and scripts/design-lint.ts. I ran the tests for archive, confirm and MCP size, and they pass. scripts/fast.ts found the diff too broad to name tests, so I picked the ones above.

To try it: open an app you administer, press Archive and confirm. The app leaves /apps. Open /apps?archived=1 and press Restore.

Closes #10872

commented

An admin can now archive an app from its page in one tap plus a confirm, and Restore it from the Archived list. Most of what the issue asks for was already on main. I did not run the whole suite.

I couldn't use the parked branch mason/10779-archive-an-app-from-its-page-or-the-apps: it isn't on the remote, so I worked from main.

What was already there

  • Archiving stops production and previews through the runtime's stop, and keeps data and git.
  • The archived app leaves home and /apps.
  • /apps?archived=1 lists archived apps, each with a per-row button that wakes the app.
  • An archived app's URL still answers: /<owner>/<name> returns 200, and the app's own hostname returns a 503 "archived" page.
  • Waking restarts production.
  • The archive MCP tool already calls setArchived in src/actions/repos.ts. I did not touch the MCP, so there are no new tools or ceilings, and test/mcp-size.test.ts passes.

What I added

  • Archive on the app's page: src/web/studio/app.ts shows an Archive button to the app's admin. It goes through /-/confirm, with wording registered in src/web/pages/search.ts.
  • New route: POST /:owner/:name/archive in src/http/server.ts always archives. It reuses archiveSubmit through a shared archiveWith in src/web/pages/settings.ts, so the same-origin check, the admin gate and updateRepoSettings are unchanged.
  • Restore label: the buttons on the Archived list now say "Restore" instead of "Wake". I changed one assertion in test/apps-archived.test.ts to match the new label; the old assertion was only wrong about wording.
  • New test: the one-tap flow gets a test in test/apps-archived.test.ts. It checks that the confirm page is offered, that a cross-origin POST is refused, that archiving hides the app from /apps and shows it at ?archived=1, that the app's page still answers, and that restoring brings it back.

What I left alone

  • The Wake button on the repository page and in Settings keeps its "Wake" label, because test/archive-web.test.ts asserts it.

Checks run: bun x tsc --noEmit is clean, as are scripts/gate.ts and scripts/design-lint.ts. I ran the tests for archive, confirm and MCP size, and they pass. scripts/fast.ts found the diff too broad to name tests, so I picked the ones above.

To try it: open an app you administer, press Archive and confirm. The app leaves /apps. Open /apps?archived=1 and press Restore.

commented

Declined: there is nothing to fix. The preview deploy of #10885 did not fail. Its summary is "running at https://lab--10885--forge-trevato-apps.open-platform.sh · no tests declared, none run". That is the success line the forge writes when forge.json has no app.test (NO_TESTS_TAIL in src/apps/runtime.ts:210). I checked /healthz on the preview and it returns 200. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m731f7k14mv69fqjmx5ck5x7

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs