Skip to content

Create projects and delete empty ones - #19

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

lnsp merged 1 commit into
masterfrom
projects-create-delete

Conversation

@lnsp

@lnsp lnsp commented Nov 20, 2026

Copy link
Copy Markdown
Member

Implements the two project commands the README listed as not implemented, against the endpoints in valar/platform#241 (platform 2.11.0).

  • valar projects create [--public] name sends POST /projects and prints the project's name, creator and access. API errors come back as they are, for example Conflict: project name is taken or Forbidden: a user can create at most 3 projects.
  • valar projects delete [--yes|-y] name sends DELETE /projects/{name}. Unless --yes is given, it warns that the name is retired for good and asks you to type the project name. Anything else aborts without a request. The name is checked against the existing project-name pattern before it goes into the request path.
  • api.Client.request now treats any 2xx as success, because POST /projects answers 201.
  • README: drops "[not implemented]" and the "deletes all services and configuration" wording. It documents the name rules, the limit of 3 projects, that --public allows anonymous invocation, that only empty projects can be deleted, that deleted names are retired, and the minimum platform version.

The command is project with the alias projects, matching service/services and domain/domains.

Testing

  • go test ./...: new API client tests cover the 201 decode, the request body and error surfacing. New command tests cover the confirmation (match, mismatch, no input), --yes, and rejecting a name like demo/services/api without sending a request.
  • Ran the built binary against a local fake API: create (public, and a taken name), delete with the typed name, a wrong name (no request sent), and -y on a non-empty project (409 message shown).

No release tag: this waits until platform 2.11.0 is in production.

`valar projects create [--public] name` and `valar projects delete [--yes] name`
call the platform's POST /projects and DELETE /projects/{project}, which need
Valar platform 2.11.0. Delete asks for the project name unless --yes is given,
and says the name is retired for good.

The client now takes any 2xx as success, since POST /projects answers 201.
@lnsp
lnsp merged commit a095c02 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