You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): app remove --branch and branch remove --cascade
Review feedback from #110:
- app remove now accepts --branch, honored as-is like the other
read-branch commands, so branch cleanup can target apps on branches
that are not checked out locally. The BRANCH_NOT_EMPTY recovery
command previously pointed at this flag before it existed, which was
a dead end.
- branch remove --cascade removes the branch's apps, then its
databases, then the branch, for preview branches only: production
and default branches stay refused before any member resource is
touched. The result lists every removed resource (human output and
result.removed in JSON) so the blast radius is explicit. Cascade is
client-orchestrated because the platform's branch delete refuses
non-empty branches; a mid-cascade failure stops immediately with
BRANCH_CASCADE_INCOMPLETE, whose meta lists what was already removed.
- BRANCH_NOT_EMPTY recovery steps now offer the cascade rerun first,
then individual app/database cleanup.
- requires auth and resolved project context; accepts `--project <id-or-name>` as an explicit fallback
877
877
- resolves `<branch>` by exact Branch id or exact git name within the resolved project
878
878
- requires `--confirm <branch-id>` where the value exactly matches the resolved Branch id; `--yes` does not satisfy this confirmation
879
-
- production Branches and the project's default Branch are protected: removal fails with `BRANCH_PROTECTED`
880
-
- a Branch that still has live Apps or databases fails with `BRANCH_NOT_EMPTY`; branch removal never deletes member resources, so remove the Branch's apps and databases first
881
-
- removal is a platform soft-delete: the Branch disappears from `branch list`, and the platform owns retention of soft-deleted Branches
879
+
- production Branches and the project's default Branch are protected: removal fails with `BRANCH_PROTECTED`, and `--cascade` never widens that; the protection check runs before any member resource is touched
880
+
- without `--cascade`, a Branch that still has live Apps or databases fails with `BRANCH_NOT_EMPTY`; plain removal never deletes member resources, and the recovery steps offer both the cascade rerun and individual `app remove --branch` / `database` cleanup
881
+
- with `--cascade`, the CLI removes the Branch's Apps, then its databases, then the Branch itself; the result lists every removed resource so the blast radius is explicit, in human output and in `result.removed` for `--json`
882
+
- cascade is client-orchestrated because the platform's branch delete refuses non-empty Branches; a mid-cascade failure stops immediately and fails with `BRANCH_CASCADE_INCOMPLETE`, whose `meta` lists what was already removed (removed resources are not restored, and the Branch itself remains)
883
+
- removal is a platform soft-delete: the Branch disappears from `branch list`, and the platform owns retention of soft-deleted Branches; cascaded member resources are removed through their own APIs
882
884
- Branch creation stays implicit (git-push automation and `app deploy`); there is deliberately no `branch create`
883
885
- never touches local Git branches
884
886
- fails with `BRANCH_NOT_FOUND` when no Branch matches
- resolves the branch it reads like the other management commands: explicit `--branch` honored as-is, then the active Git branch when it exists in the project, then the project's default branch
1870
+
-`--branch <name>` makes branch cleanup possible for branches that are not checked out locally, such as a teammate's preview branch
1871
+
- resolves the selected app within that branch
1867
1872
- requires confirmation unless `-y` or `--yes` is passed
1868
1873
- clears local selected app state when the removed app was selected
0 commit comments