@W-22255905: Add clone sandbox option on VS Code#389
Open
amit-kumar8-sf wants to merge 3 commits intomainfrom
Open
@W-22255905: Add clone sandbox option on VS Code#389amit-kumar8-sf wants to merge 3 commits intomainfrom
amit-kumar8-sf wants to merge 3 commits intomainfrom
Conversation
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
Adds Clone Sandbox and View Clone Details actions to the Realm Explorer sandbox context
menu, with full lifecycle visibility:
medium/large/xlarge/xxlarge,or "same as source"), and optional comma-separated notification emails; calls
POST /sandboxes/{id}/clonesand polls/clones/{cloneId}with a progress notification reportingstatus,progressPercentage, andlastKnownStateuntilCOMPLETED/FAILED.clonedFrom; opensGET /sandboxes/{id}?expand=clonedetailsas a preview JSON document.cloningwith theclonecodicon (warning-yellow) via a client-side tracking flag onSandboxTreeDataProvider(markSourceCloning/unmarkSourceCloning), independent of whatever theAPI reports.
failed(the API's interim state duringclone setup) is rendered as
setting upwithserver-process~spin.cloningAPI state — registered inSTATE_ICONSandTRANSITIONAL_STATESso realmauto-polling continues through it.
Clone Sandboxonly shows forstarted/stoppedsandboxes;Open Business Manager,Extend Expiration, andDelete Sandboxare hidden duringcloning/setting up;Start/Stop/Restartmatch both plain and-clonedcontext-value variants.COMPLETED/FAILED, the handler keeps the source markedand refreshes the realm for 3 additional poll intervals (30s) so the list endpoint has time to
propagate final states before the
cloninglabel clears, then re-armsstartPollingRealmfor thenew target sandbox's transitional states.
clonedFromandsourceInstanceIdentifierto theSandboxInfointerface.src/sandbox-tree/sandbox-clone-helpers.tsfor testability.Testing
src/test/sandbox-clone-helpers.test.ts— coversgetRealmInstanceId,getActiveCloneSourceIds(target states, empty strings, missing fields),computeSandboxDisplay(all branches: plain, cloned, source, cloned+failed precedence, case normalization), and state-set
membership.
src/test/sandbox-menu.test.ts— loadspackage.jsonand asserts visibility contracts forevery sandbox command against synthetic
viewItemcontext values, including-clonedsuffixbehavior and the hide-during-
cloning/settinguprules for Open BM / Extend / Delete.pnpm run typecheck:agent,pnpm run lint:agent, andpnpm run pretestall clean.startedsandbox, verified progressnotification (name on line 1, id + status % on line 2), source row transitioning to
cloning,target row appearing as
setting up, and both rows converging to their final states after clonecompletion.
Dependencies
3pl-approvedis set by a maintainerpnpm test)pnpm run format)