Add environment fork / deploy / decommission, instance copy/promote#238
Merged
Conversation
624e261 to
ba1a53d
Compare
This was referenced May 15, 2026
ca72412 to
d9e9340
Compare
chrisghill
approved these changes
May 15, 2026
200ab04 to
6f8b795
Compare
…`promote`) Three thin wrappers around SDK primitives that the preview command already composes: - `mass environment fork <parent> <new-ID>` — exposes Environments.Fork with --copy-environment-defaults, --copy-secrets, --copy-remote-references, and --attributes. Idempotent against the same parent. - `mass environment deploy <env>` — exposes Environments.Deploy; cancels any in-flight environment deployment and schedules a fresh provision wave. - `mass instance copy <source> <destination>` (alias `promote`) — exposes Instances.Copy with --overrides (path to JSON/YAML), --copy-secrets, --copy-remote-references, and --message. Components must match. Helpdocs and generated docs included. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reuses the FollowEnvironment helper landed with the preview --follow flag. Behavior is identical: tail every deployment's logs, prefix each line with the instance id, exit once the rollout reaches a quiet steady state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`mass instance promote ecomm-staging-db ecomm-production-db` reads
ambiguously — easy to land on the wrong side at the end of a long
day. Promote (and copy) now take the destination through a required
`--to` flag:
mass instance promote ecomm-staging-db --to ecomm-production-db
Same for copy. Helpdoc and generated docs follow the new shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CopyInstanceInput.Message was removed from the V2 schema — copy is pure config staging, not deployment. SDK v0.2.2 dropped Message from the public CopyInput type. Drop the corresponding CLI flag and update the helpdoc to point users at `mass instance deploy` for the follow-up deployment.
NewCmdEnvironment was 110 lines and NewCmdInstance was 111 lines after the new commands landed (preview/fork/deploy on environment; copy on instance) — over golangci-lint's 100-line funlen cap. Each new command's construction now lives in its own `new*Cmd` builder; the parents just AddCommand them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wires the new V2 `decommissionEnvironment` mutation (platform PR #3259) through `Environments.Decommission` (SDK v0.2.4) so a fan-out teardown is a single CLI call. Mirrors `environment deploy`: - Reverse-dependency-order tear-down across every instance. - `--follow` streams interleaved per-instance logs. - Async — returns once the wave is enqueued. The environment shell stays put; run `mass environment delete` after to remove the empty environment. Decommissioning is rejected when `decommissionProtection` is on; disable via `updateEnvironment` first. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
environment fork, environment deploy, instance copy / promote
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four CLI wrappers around the V2 primitives the
previewcommand already composes — useful on their own when you want to drive a fork, a promote, a deploy, or a teardown without a YAML config.mass environment fork <parent> <new-id>forkEnvironment--copy-environment-defaults,--copy-secrets,--copy-remote-references, plus the usual--name/--description/--attributes. Idempotent re-fork against the same parent.mass environment deploy <env>deployEnvironment--followstreams interleaved per-instance logs, padded so the prefix column stays aligned.mass environment decommission <env>decommissionEnvironment--followsame asdeploy. Blocked whendecommissionProtectionis on. Env shell stays; chain withmass environment deleteto remove the empty env.mass instance copy <src> --to <dst>(aliaspromote)copyInstance--overrides <path>(JSON/YAML deep-merged),--copy-secrets,--copy-remote-references. Components must match; destination ends up with a plan deployment for review.Helpdocs, generated docs, and unit tests included. SDK pinned at
v0.2.4.Test plan
go build ./...make test(per repo convention)🤖 Generated with Claude Code