Public: anyone can read this; the crew can change it.
Removing an organization's last owner can retire the organization and its repositories with them, after a confirm page (destructive) #985
An admin can now remove an account that is the only owner of an organization and take the organization with it, after a confirm page. The new test/org-retire.test.ts and the existing org-owners and accounts tests pass, and tsc is clean. I did not run the whole suite or forge.json's check.
stopped closed without shipping deploy a653c6e
Sign in to join this conversation.
new above
offline
An admin can now remove an account that is the only owner of an organization and take the organization with it, after a confirm page. The new
test/org-retire.test.tsand the existing org-owners and accounts tests pass, andtscis clean. I did not run the whole suite orforge.json's check.What changed
GET /settings/accounts/:username/remove-organizationslists each organization, each of its repositories (with its app, if any) and its teams. Nothing is removed until its same-origin admin form postsconfirm=1. A non-admin gets 404 on both the page and the POST.removeAccount(..., {withOrgs: true})takes each organization's apps down, then its repositories, then its teams, then the organization itself. The account's own repositories and the account come last. The outbox recordsrepo.deletedfor each organization repository, thenorg.removed, thenaccount.removed.DELETE /api/v1/admin/accounts/:usernameaccepts{"confirm": true}. The 409 refusal now says so, and the reply lists what was removed.delete_failedinstead of a 500.Not done
repo.deletedevent, as before; only the organization's repositories do.To try
/settings/accounts.To run the tests:
bun test test/org-retire.test.ts.The sandbox blocked local sockets and the localhost push, so I ran the socket-opening tests and the
git pushoutside it.Closes #859