Skip to content

Commit 90c68f6

Browse files
Merge branch 'main' into feature-W-21207882-add-scapi-cors-support
2 parents b165e7f + 5a3b351 commit 90c68f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+13627
-73
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@salesforce/b2c-dx-mcp': patch
3+
---
4+
5+
cartridge_deploy now reminds users to update the site cartridge path in Business Manager (Sites → Manage Sites → [site] → Settings tab → Cartridges) after deploy.

.changeset/flat-dogs-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@salesforce/mrt-utilities': patch
3+
---
4+
5+
Initial release

docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const guidesSidebar = [
4949
{text: 'Scaffolding', link: '/guide/scaffolding'},
5050
{text: 'Security', link: '/guide/security'},
5151
{text: 'Storefront Next', link: '/guide/storefront-next'},
52+
{text: 'MRT Utilities', link: '/guide/mrt-utilities'},
5253
],
5354
},
5455
{

docs/cli/sandbox.md

Lines changed: 250 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ b2c sandbox list
9292

9393
### Available Columns
9494

95-
`realm`, `instance`, `state`, `profile`, `created`, `eol`, `id`, `hostname`, `createdBy`, `autoScheduled`
95+
`realm`, `instance`, `state`, `profile`, `created`, `eol`, `id`, `hostname`, `createdBy`, `autoScheduled`, `isCloned`
9696

9797
### Examples
9898

@@ -119,14 +119,16 @@ b2c sandbox list --json
119119
### Output
120120

121121
```
122-
Realm Instance State Profile Created EOL
123-
─────────────────────────────────────────────────────────────────────────
124-
abcd 001 started medium 2024-12-20 2024-12-21
125-
abcd 002 stopped large 2024-12-19 2024-12-20 22:30
122+
Realm Instance State Profile Created EOL Cloned
123+
─────────────────────────────────────────────────────────────────────────
124+
abcd 001 started medium 2024-12-20 2024-12-21 No
125+
abcd 002 stopped large 2024-12-19 2024-12-20 22:30 Yes
126126
```
127127

128128
The `EOL` column displays `YYYY-MM-DD` normally. When a sandbox expires within 24 hours (or is already expired), the time is also shown as `YYYY-MM-DD HH:mm` (UTC).
129129

130+
The `isCloned` column indicates whether a sandbox was created by cloning another sandbox (`Yes`) or not (`No`).
131+
130132
---
131133

132134
## b2c sandbox create
@@ -216,6 +218,12 @@ b2c sandbox get <SANDBOXID>
216218
|----------|-------------|----------|
217219
| `SANDBOXID` | Sandbox ID (UUID or realm-instance, e.g., `zzzv-123`) | Yes |
218220

221+
### Flags
222+
223+
| Flag | Description | Default |
224+
|------|-------------|---------|
225+
| `--clone-details` | Include detailed clone information if the sandbox was created by cloning | `false` |
226+
219227
### Examples
220228

221229
```bash
@@ -225,6 +233,9 @@ b2c sandbox get abc12345-1234-1234-1234-abc123456789
225233
# Get sandbox details using realm-instance format
226234
b2c sandbox get zzzv-123
227235

236+
# Get sandbox details with clone information
237+
b2c sandbox get zzzv-123 --clone-details
238+
228239
# Output as JSON
229240
b2c sandbox get zzzv_123 --json
230241
```
@@ -239,6 +250,19 @@ Displays detailed information about the sandbox including:
239250
- Creation time and end-of-life
240251
- Links to BM and storefront
241252

253+
If the sandbox was created by cloning another sandbox, a "Clone Details" section is displayed showing:
254+
- Cloned From (realm-instance identifier)
255+
- Source Instance ID (UUID)
256+
257+
When the `--clone-details` flag is used, additional clone metadata is included:
258+
- Clone ID
259+
- Status
260+
- Target Profile
261+
- Progress Percentage
262+
- Elapsed Time
263+
- Custom Code Version
264+
- Storefront Count
265+
242266
---
243267

244268
## b2c sandbox info
@@ -647,6 +671,225 @@ b2c sandbox alias delete zzzv-123 alias-uuid-here --json
647671

648672
---
649673

674+
## Sandbox Cloning
675+
676+
On-demand sandbox cloning enables you to create replicas of existing sandboxes in minutes, not hours. It helps teams move faster while reducing risk by providing fully isolated environments for development, testing, and operational workflows.
677+
678+
With a single API call, you can provision a fully isolated replica of your sandbox that includes your database, application code, platform configurations, and all configured feature toggles.
679+
680+
**Important:** To ensure a consistent and reliable clone, the source sandbox is automatically placed in a protected **Stopped** state during the cloning process. This safeguard guarantees data integrity and configuration consistency. Once cloning is complete, the source sandbox resumes normal operation.
681+
682+
Each cloned sandbox is fully isolated, with dedicated compute, storage, and database resources.
683+
684+
Clone commands are available both under the `sandbox` topic and the legacy `ods` aliases:
685+
686+
- `b2c sandbox clone list` (`b2c ods clone:list`)
687+
- `b2c sandbox clone create` (`b2c ods clone:create`)
688+
- `b2c sandbox clone get` (`b2c ods clone:get`)
689+
690+
### Clone ID Format
691+
692+
Clone IDs follow a specific pattern: `realm-instance-timestamp`
693+
694+
- Example: `aaaa-002-1642780893121`
695+
- Pattern: 4-letter realm code, followed by 3-digit instance number, followed by 13-digit timestamp
696+
697+
### b2c sandbox clone list
698+
699+
List all clones for a specific sandbox.
700+
701+
#### Usage
702+
703+
```bash
704+
b2c sandbox clone list <SANDBOXID>
705+
```
706+
707+
#### Arguments
708+
709+
| Argument | Description | Required |
710+
|----------|-------------|----------|
711+
| `SANDBOXID` | Sandbox ID (UUID or realm-instance, e.g., `zzzv-123`) | Yes |
712+
713+
#### Flags
714+
715+
| Flag | Description |
716+
|------|-------------|
717+
| `--from` | Filter clones created on or after this date (ISO 8601 date format, e.g., `2024-01-01`) |
718+
| `--to` | Filter clones created on or before this date (ISO 8601 date format, e.g., `2024-12-31`) |
719+
| `--status` | Filter clones by status (`Pending`, `InProgress`, `Failed`, `Completed`) |
720+
| `--columns`, `-c` | Columns to display (comma-separated) |
721+
| `--extended`, `-x` | Show all columns |
722+
723+
#### Available Columns
724+
725+
`cloneId`, `sourceInstance`, `targetInstance`, `status`, `progressPercentage`, `createdAt`, `lastUpdated`, `elapsedTimeInSec`, `customCodeVersion`
726+
727+
**Default columns:** `cloneId`, `sourceInstance`, `targetInstance`, `status`, `progressPercentage`, `createdAt`
728+
729+
#### Examples
730+
731+
```bash
732+
# List all clones for a sandbox
733+
b2c sandbox clone list zzzv-123
734+
735+
# Filter by status
736+
b2c sandbox clone list zzzv-123 --status Completed
737+
738+
# Filter by date range
739+
b2c sandbox clone list zzzv-123 --from 2024-01-01 --to 2024-12-31
740+
741+
# Show all columns
742+
b2c sandbox clone list zzzv-123 --extended
743+
744+
# Custom columns
745+
b2c sandbox clone list zzzv-123 --columns cloneId,status,progressPercentage
746+
747+
# Output as JSON
748+
b2c sandbox clone list zzzv-123 --json
749+
```
750+
751+
#### Output
752+
753+
```
754+
Clone ID Source Instance Target Instance Status Progress % Created At
755+
──────────────────────────────────────────────────────────────────────────────────────────────
756+
aaaa-001-1642780893121 aaaa-000 aaaa-001 COMPLETED 100% 2024-02-27 10:00
757+
aaaa-002-1642780893122 aaaa-000 aaaa-002 IN_PROGRESS 75% 2024-02-27
758+
```
759+
760+
The `Created At` column displays `YYYY-MM-DD HH:mm` when the clone was created within the last 24 hours, otherwise just `YYYY-MM-DD` (all times in UTC).
761+
762+
### b2c sandbox clone create
763+
764+
Create a new sandbox clone from an existing sandbox. This creates a complete copy of the source sandbox including all data, configuration, and custom code.
765+
766+
#### Usage
767+
768+
```bash
769+
b2c sandbox clone create <SANDBOXID>
770+
```
771+
772+
#### Arguments
773+
774+
| Argument | Description | Required |
775+
|----------|-------------|----------|
776+
| `SANDBOXID` | Sandbox ID (UUID or realm-instance, e.g., `zzzv-123`) to clone from | Yes |
777+
778+
#### Flags
779+
780+
| Flag | Description | Default |
781+
|------|-------------|---------|
782+
| `--target-profile` | Resource profile for the cloned sandbox (`medium`, `large`, `xlarge`, `xxlarge`). Optional. | Source sandbox profile |
783+
| `--ttl` | Time to live in hours (0 or negative = infinite, minimum 24 hours). Values between 1-23 are not allowed. | `24` |
784+
| `--emails` | Comma-separated list of notification email addresses | |
785+
786+
#### Examples
787+
788+
```bash
789+
# Create a clone with same profile as source sandbox
790+
b2c sandbox clone create zzzv-123
791+
792+
# Create a clone with custom TTL (uses source profile)
793+
b2c sandbox clone create zzzv-123 --ttl 48
794+
795+
# Create a clone with a different profile
796+
b2c sandbox clone create zzzv-123 --target-profile large
797+
798+
# Create a clone with large profile and extended TTL
799+
b2c sandbox clone create zzzv-123 --target-profile large --ttl 48
800+
801+
# Create a clone with notification emails
802+
b2c sandbox clone create zzzv-123 --emails dev@example.com,qa@example.com
803+
804+
# Create a clone with infinite TTL
805+
b2c sandbox clone create zzzv-123 --ttl 0
806+
807+
# Output as JSON
808+
b2c sandbox clone create zzzv-123 --json
809+
```
810+
811+
#### Output
812+
813+
```
814+
✓ Sandbox clone creation started successfully
815+
Clone ID: aaaa-002-1642780893121
816+
817+
To check the clone status, run:
818+
b2c sandbox clone get zzzv-123 aaaa-002-1642780893121
819+
```
820+
821+
#### Notes
822+
823+
- **Source sandbox will be stopped:** The source sandbox is automatically placed in a **Stopped** state during cloning to ensure data integrity and configuration consistency. It resumes normal operation once cloning is complete.
824+
- Cloning typically completes in minutes, though duration depends on sandbox size and data volume
825+
- The cloned sandbox is fully isolated with dedicated compute, storage, and database resources
826+
- When `--target-profile` is not specified, the API automatically uses the source sandbox's resource profile (no additional API call is made)
827+
- The TTL must be 0 or negative (infinite), or 24 hours or greater. Values between 1-23 are rejected
828+
- The clone will be created as a new sandbox instance in the same realm
829+
830+
### b2c sandbox clone get
831+
832+
Retrieve detailed information about a specific sandbox clone, including status, progress, and metadata.
833+
834+
#### Usage
835+
836+
```bash
837+
b2c sandbox clone get <SANDBOXID> <CLONEID>
838+
```
839+
840+
#### Arguments
841+
842+
| Argument | Description | Required |
843+
|----------|-------------|----------|
844+
| `SANDBOXID` | Sandbox ID (UUID or realm-instance, e.g., `zzzv-123`) | Yes |
845+
| `CLONEID` | Clone ID (e.g., `aaaa-002-1642780893121`) | Yes |
846+
847+
#### Examples
848+
849+
```bash
850+
# Get clone details
851+
b2c sandbox clone get zzzv-123 aaaa-002-1642780893121
852+
853+
# Output as JSON
854+
b2c sandbox clone get zzzv-123 aaaa-002-1642780893121 --json
855+
```
856+
857+
#### Output
858+
859+
Displays comprehensive clone information in a formatted table:
860+
861+
```
862+
Clone Details
863+
──────────────────────────────────────────────────
864+
Clone ID: aaaa-002-1642780893121
865+
Source Instance: aaaa-000
866+
Source Instance ID: 11111111-2222-3333-4444-555555555555
867+
Target Instance: aaaa-002
868+
Target Instance ID: 66666666-7777-8888-9999-000000000000
869+
Realm: aaaa
870+
Status: IN_PROGRESS
871+
Progress: 75%
872+
Created At: 2/27/2025, 10:00:00 AM
873+
Last Known State: Finalizing Clone
874+
Custom Code Version: version1
875+
Storefront Count: 0
876+
Filesystem Usage Size: 1073741824
877+
Database Transfer Size: 2147483648
878+
```
879+
880+
For the complete response including all metadata, use the `--json` flag.
881+
882+
#### Clone Status Values
883+
884+
| Status | Description |
885+
|--------|-------------|
886+
| `PENDING` | Clone is queued and waiting to start |
887+
| `IN_PROGRESS` | Clone operation is currently running |
888+
| `COMPLETED` | Clone finished successfully |
889+
| `FAILED` | Clone operation failed |
890+
891+
---
892+
650893
## Realm-Level Commands
651894

652895
Realm commands operate at the **realm** level rather than on an individual sandbox. They are available as both `realm` topic commands and as `sandbox realm` subcommands:
@@ -662,12 +905,12 @@ To run `b2c realm` commands, your user or API client must have **realm‑level a
662905

663906
### b2c realm list
664907

665-
List realms eligible for sandbox management, optionally including a simple usage summary.
908+
List realms eligible for sandbox management.
666909

667910
#### Usage
668911

669912
```bash
670-
b2c realm list [REALM] [--show-usage]
913+
b2c realm list [REALM]
671914
```
672915

673916
#### Arguments

0 commit comments

Comments
 (0)