Skip to content

Add environments.Decommission for decommissionEnvironment#27

Merged
coryodaniel merged 1 commit into
mainfrom
feat-decommission-environment
May 18, 2026
Merged

Add environments.Decommission for decommissionEnvironment#27
coryodaniel merged 1 commit into
mainfrom
feat-decommission-environment

Conversation

@coryodaniel
Copy link
Copy Markdown
Member

Summary

  • Wraps the new V2 decommissionEnvironment mutation (landed in platform PR #3259) so callers like mass can drive env-level teardowns through the SDK.
  • Mirrors the existing Service.Deploy shape — same auth context, async semantics, and EnvironmentPayload decode path.
  • Regenerates schema.graphql from the live V2 endpoint and re-runs genqlient.

What you get

env, err := client.Environments.Decommission(ctx, "ecomm-pr-123")

Returns as soon as the wave is enqueued; the per-instance decommissions happen asynchronously in reverse dependency order. Returns a *gql.MutationFailedError when the environment has decommissionProtection: true so callers can surface that distinctly from transport errors.

Test plan

  • go test ./massdriver/platform/environments/...
  • Happy-path unit test (TestDecommission)
  • decommissionProtection failure path unit test (TestDecommissionProtected)
  • Integration test (optional — schedule alongside next make test-integration pass)

🤖 Generated with Claude Code

Mirrors the existing Deploy method — wraps the new V2
`decommissionEnvironment` mutation. Tears down every instance in the
environment in reverse dependency order while leaving the environment
shell in place so it can be redeployed; Delete cleans up the empty env.

- Regenerate schema + genqlient against current V2 endpoint.
- Add `Service.Decommission(ctx, id)`.
- Add unit tests covering the happy path and the
  `decommissionProtection` validation failure mode.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coryodaniel coryodaniel merged commit 68a41f3 into main May 18, 2026
3 checks passed
@coryodaniel coryodaniel deleted the feat-decommission-environment branch May 18, 2026 18:43
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.

2 participants