Skip to content

Add service delete and project delete --cascade - #23

Merged
lnsp merged 1 commit into
masterfrom
cli-delete
Nov 20, 2026
Merged

lnsp merged 1 commit into
masterfrom
cli-delete

Conversation

@lnsp

@lnsp lnsp commented Nov 20, 2026

Copy link
Copy Markdown
Member

Adds deletion of services, and of non-empty projects.

  • valar service delete [--yes] [service] deletes a service with its builds, deployments, batch executions, environment, secrets, schedules and permission rules. The service defaults to the one in .valar.yml.
  • valar project delete --cascade name deletes the project's services and domain claims, then the project. Without --cascade the command behaves as before.

Both ask for the name to confirm unless --yes is given. With no terminal on standard input they refuse with exit code 2 instead of waiting; plain project delete still accepts the name from piped input, as it did.

A 409 or 5xx answer is retried up to three times with a 1s/2s/4s backoff, since repeating a failed deletion finishes it. A 404 on a retry means an earlier attempt completed, so it counts as success; a 404 on the first attempt exits with code 3. Project deletion without --cascade is not retried: a 409 there means the project isn't empty.

With --json the commands print {"service": "...", "deleted": true} or {"project": "...", "deleted": true}. The project result key changes from name to project; JSON output has not been released yet.

Tests cover confirmation, --yes, the refusal without a terminal, 404, retry-then-404, 409 retries, and JSON output through the root command.

valar service delete [--yes] [service] deletes a service with everything
it holds, defaulting to the service in .valar.yml. valar project delete
--cascade deletes a project's services and domain claims before the
project itself.

Both ask for the name to confirm unless --yes is given, and refuse with
exit code 2 when standard input is not a terminal. Plain project delete
still accepts the name from piped input. A 409 or 5xx answer is retried
with a short backoff; a 404 on a retry counts as done, while a 404 on the
first attempt exits with 3. With --json they print
{"service": ..., "deleted": true} or {"project": ..., "deleted": true}.
@lnsp
lnsp merged commit 0509213 into master Nov 20, 2026
3 checks passed
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