Skip to content

Fix Cloud API mismatches found in a live deployment - #2

Merged
simonhamp merged 1 commit into
mainfrom
cloud-api-fixes
Jul 14, 2026
Merged

simonhamp merged 1 commit into
mainfrom
cloud-api-fixes

Conversation

@simonhamp

Copy link
Copy Markdown
Member

Three fixes from wiring this SDK into a real end-to-end deployment (the Boop! badge service) and hitting the live API:

1. deleteApplication() was missing

The client had delete methods for environments, instances, processes, domains, and database clusters — but not applications, so there was no way to tear down an app you created. DELETE /applications/{id} works on the live API.

2. waitForDeployment() hung on build failures

The API reports stage-dotted statuses: build.failed, deployment.failed, deployment.succeeded, … The terminal-status check only knew deployment.failed, so a failed build (verified live) polled until the timeout instead of returning. Any *.failed status is now terminal; intermediate stage successes (build.succeeded) keep polling.

3. Config example used size slugs the API rejects

flex.g-1vcpu-512mb / flex.c-1vcpu-512mb aren't real — the live API reports slugs like flex-512mb. Also documented a gotcha that produces a very misleading error: Cloud auto-provisions a default app instance ("App", flex-512mb) with every new environment, and creating a second app-type instance fails with 422 "The type value is invalid".

Verification

  • All behaviors confirmed against the live Cloud API on 2026-07-14 (deployed a real app end-to-end)
  • 8 new Pest tests for deleteApplication and the waitForDeployment status handling; suite: 19 passed, Pint clean

🤖 Generated with Claude Code

- Add deleteApplication() — the API supports DELETE /applications/{id}
  but the client never exposed it, leaving no way to tear down an app.
- waitForDeployment() now treats every stage-dotted failure (build.failed,
  release.failed, ...) as terminal; previously a failed build polled until
  the timeout.
- Config example used size slugs the API rejects (flex.g-1vcpu-512mb);
  real slugs are flex-512mb etc. Also documents that Cloud auto-provisions
  a default app instance per environment and only one app instance is
  allowed — creating a second fails 422.

All verified against the live API (2026-07-14).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@simonhamp
simonhamp merged commit ae1b42f into main Jul 14, 2026
4 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