Skip to content

feat(apps): reclaim a deleted app ID from bl apps create - #49

Draft
nandiheath wants to merge 1 commit into
block:mainfrom
nandiheath:nandi/reclaim-deleted-app-id
Draft

nandiheath wants to merge 1 commit into
block:mainfrom
nandiheath:nandi/reclaim-deleted-app-id

Conversation

@nandiheath

Copy link
Copy Markdown
Contributor

Summary

After bl apps delete, there was no way to create the same app ID again through bl:

  • bl apps create stopped at reserve with app_id_collision.
  • bl apps initialize refused any app with deleted_at on the client side.

So a deleted static site could not be re-created, for example as fetch-js with MySQL, under the same URL. People created -v2 IDs instead.

The control plane already reclaims a deleted app ID through initialize, as a fresh lifecycle. squareup/blockplat-compose#667 makes plan and reserve lead clients to that path.

Changes

  • bl apps create: when reserve fails with app_deleted (newer servers) or app_id_collision (older servers), create already inspects the app. If the app is deleted, create now reclaims it through initialize with the planned runtime profile and persistence, and the output reports reclaimed: true.
    • Initialize runs even when the plan is static. Only initialize reclaims a deleted ID; deploy refuses it.
    • While the deleted app's cleanup is still finishing, the server answers app_deleted. The error says to wait a few minutes and retry the same command.
  • --private on a reclaim: visibility is applied after initialize, because a deleted app has no live route to change and the reclaimed route publishes no version. If that step fails, the recovery message points to bl apps visibility <id> private only. Retrying create cannot resume a reclaimed app.
  • bl apps initialize: still refuses deleted apps. The message now points to bl apps create.
  • Docs: help text and README.md explain how to reuse a deleted app's ID. Sharing, publishers, versions and data are not carried over.

Verification

  • New process tests:
    • Reclaim as fetch-js+mysql via app_deleted.
    • Static reclaim from an older server's app_id_collision with a no-initialize plan.
    • Cleanup still running.
    • --private ordering on reclaim.
    • Visibility failure after a reclaim.
  • just check (fmt, clippy -D warnings, all tests) passes.

Rollout

The full flow (re-creating a deleted static site as fetch-js+mysql) needs squareup/blockplat-compose#667 deployed: older servers still reject that plan with mysql_profile_unsupported. With an older server, same-profile reclaims already work through the app_id_collision fallback.

bl apps create stopped at reserve for a deleted app's ID, and
bl apps initialize refused it client-side, so a deleted static site could
not be re-created, e.g. as fetch-js with MySQL, under the same URL.

When reserve fails and the app turns out to be deleted (newer servers
answer app_deleted, older ones app_id_collision), create now reclaims it
through initialize, even for a static plan, and reports reclaimed: true.
--private is applied after the reclaim because a deleted app has no live
route to change. initialize keeps refusing deleted apps and points to
create.
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