Open stafik opened 1 month ago
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
Hi @stafik - thanks for reporting this. We're looking into it, and agree that it's a little weird. We're looking at how to make it work more like org create scratch
where the flags can override what's in the file, or updating how the --clone
flag works, but this could also be a breaking change.
W-16883274
this was fixed (and added 2 new source flags) in RC if you want to give it a try: https://github.com/forcedotcom/cli/tree/main/releasenotes/#2667-november-13-2024-stable-rc
will be promoted to stable next Wednesday.
Summary
Cloning developer sandboxes using SF CLI and the
--definition-file
flag still creates a sandbox from production org.Steps To Reproduce
Prerequisite: having a developer sandbox (sandbox name:
dev1
)sf org create sandbox --definition-file config/developer-sandbox-def.json --alias dev1clone --target-org productionAlias --no-prompt
I generated a new project using
sf project generate
and committed here - link. There's actually only thedeveloper-sandbox-def.json
file committed and relevant.Expected result
A new sandbox (name:
dev1clone
) is being created and it's a copy ofdev1
existing sandbox.Actual result
A new sandbox (name:
dev1clone
) is being created and it's a copy of production.Additional information
I fiddled around with different combinations of developer-sandbox-def.json settings and
sf org create sandbox
flags. ThesourceSandboxName
json setting seemed to be always ignored, no matter what. On the other hand, when I runsf org create sandbox --definition-file config/developer-sandbox-def.json --alias dev1clone --target-org productionAlias --no-prompt --clone dev1
(I added the-clone dev1
flag), it resulted in creating a cloned sandbox correctly. No matter if thesourceSandboxName
was present in developer-sandbox-def.json or not.To sum up, I got to the conclusion that
--clone
flag has always worked well butsourceSandboxName
setting in developer-sandbox-def.json file has had totally no effect.Here are two more SF CLI output examples. In both cases developer-sandbox-def.json looks like described in the Steps To Reproduce section above (it includes
"sourceSandboxName": "dev1"
). The only difference between them is that there's aSourceId 0GQ1i000000TQESGA4
line when I used the--clone dev1
flag.System Information
I've noticed the issue using Windows 10 & Powershell 7, as well as in cloud GitLab pipelines using Bash.
Thank you very much for your help!