Add stripe sandbox delete to close a sandbox by its account id#1782
Open
shashwat-stripe wants to merge 1 commit into
Open
Add stripe sandbox delete to close a sandbox by its account id#1782shashwat-stripe wants to merge 1 commit into
stripe sandbox delete to close a sandbox by its account id#1782shashwat-stripe wants to merge 1 commit into
Conversation
Rounds out the sandbox CRUD story (new/list/delete). Takes the sandbox's acct_ (the ACCOUNT shown by `sandbox list`), resolves it to the sandbox's testmode workspace under the caller's accessible live parents, and closes it via the same compartment endpoint the dashboard's delete action uses. The call is self-scoped by the UAT, no backend or permission changes needed; verified end-to-end on QA (new -> list -> delete -> list). Committed-By-Agent: claude
| return err | ||
| } | ||
| // Guard: only ever close a sandbox (testmode) workspace, never something else. | ||
| if !strings.HasPrefix(sandboxWorkspace, "wksp_") { |
There was a problem hiding this comment.
`!strings.HasPrefix(sandboxWorkspace, "wksp_test")
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.
Reviewers
r? @
cc @stripe/developer-products
Summary
Adds
stripe sandbox delete, rounding out the sandbox CRUD story (new/list/delete).You pass the sandbox's own account via
--stripe-account acct_...(the ACCOUNT shown bystripe sandbox list). The command resolves that account to the sandbox's testmode workspace by searching your accessible live parents' sandboxes, then closes it viaPOST /v2/workspaces/undocumented/testmode/:id/close, the same compartment endpoint the dashboard's delete action uses. "delete" here is a soft compartment close, testmode only, and never touches your live account. Org ids are rejected client-side, consistent withnew/list. The call is self-scoped by the UAT (noStripe-Context) and needs no backend or permission changes. Hidden subcommand, matchingnew/list.Test plan
pkg/cmd/sandbox_test.go): success (asserts only the targeted sandbox's workspace is closed), not-found, org rejection, missing-account, no-UAT. FullTestSandboxsuite passes;go vetandgolangci-lintclean.sandbox new --copy-live-account->sandbox list(sandbox shown) ->sandbox delete --stripe-account acct_...(Deleted sandbox ...) ->sandbox list(No sandboxes found.).Rollout / revert plan
Safe to revert. Additive, hidden CLI subcommand; no backend, schema, or flag changes.