Skip to content

feat: add GetStatus and Delete for ephemeral environments - #489

Open
justin-newman wants to merge 2 commits into
OctopusDeploy:mainfrom
justin-newman:feat/ephemeral-environment-status-and-delete
Open

justin-newman wants to merge 2 commits into
OctopusDeploy:mainfrom
justin-newman:feat/ephemeral-environment-status-and-delete

Conversation

@justin-newman

@justin-newman justin-newman commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Background

The CLI needs to read the provisioning status of an ephemeral environment and to delete one that cannot be deprovisioned, for example when provisioning failed. See OctopusDeploy/cli#753. The client exposes neither today.

Changes

  • GetStatus(client, spaceID, environmentId, projectId) calls GET /api/{spaceId}/projects/{projectId}/environments/ephemeral/{id}/status and returns an EphemeralEnvironmentStatus with Status.
  • Delete(client, spaceID, environmentId) calls DELETE /api/{spaceId}/environments/{id}, removing the environment without running its deprovisioning runbook.
  • Unit tests using httptest cover the request method and URL, response decoding, and error cases. E2E tests cover both functions against a server.

Delete uses the standard environments route; the e2e test checks the environment is gone afterwards.

Follow-up

OctopusDeploy/cli#754 uses these and is a draft until this is merged and released and the go.mod bump is made there.

@justin-newman

Copy link
Copy Markdown
Contributor Author

@NickJosevski for your consideration

@justin-newman
justin-newman force-pushed the feat/ephemeral-environment-status-and-delete branch from d864e5c to d44f6be Compare October 15, 2026 16:53
GetStatus reads the per-project provisioning status of an ephemeral environment. Delete removes an ephemeral environment without running its deprovisioning runbook, for environments that cannot be deprovisioned, for example when provisioning failed.
GetStatus sent a request with an empty path segment when the environment or project id was empty. It now returns an error, as Delete does.
@justin-newman
justin-newman force-pushed the feat/ephemeral-environment-status-and-delete branch from 0f30e7b to ed78b93 Compare October 21, 2026 05:46
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