-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sandbox Refreshes Not Possible through CLI #2627
Comments
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. |
Unrelated to this bug, but I also created this discussion based on my experience testing sandbox refreshes through the CLI. I have a workaround for this discussion, but it would be nice to address this as well for sandbox creations/refreshes using the CLI. Please let me know if I should create a separate bug for this discussion or leave it as-is. |
I would love to see this feature implemented. My team and I always use the Salesforce UI for all our sandbox creation/refreshes, partly because there is no option in the CLI to refresh them and we are mostly refreshing sandboxes rather than creating new sandboxes. We have a bunch of predefined sandbox names that we reuse and they are configured with various jobs in our CI/CD for running tests, validating deployments, etc... Having sandbox refresh support in the CLI would also be benefical for automating the entire sandbox refresh process with CI/CD systems. Currently we have team members manually performing refreshes, this occurs during common work hours and can lead to some false-postive build failures as the environments get activated and replaced. So being able to schedule a refresh to occur during the night when it is less likely to conflict with others would be ideal. |
@alan-morey - Feel free to take a look at my Python scripts which creates and refreshes sandboxes using the Tooling API (Simple Salesforce library) while we await a new Salesforce CLI release that addresses this bug. My team is using these scripts for now while we wait for a CLI release to allow this. |
The CLI team agrees, but you should post in this discussion: #2511 Anything we implement should cover the usecases the community wants so we're gathering all the data and will then prioritize the work. Feel free to be opinionated with the expected command parameters as well. |
Summary
New sandboxes can be created using the CLI, but existing sandboxes cannot be refreshed using the CLI.
I understand this issue has been around for years at this point based on some searches. I don't see any active GitHub issues for this so I decided to open this one to re-spark this topic.
Here's the terminal output when trying to refresh an existing sandbox.
To create and refresh sandboxes programmatically at the moment, I have to use the Tooling API.
Steps To Reproduce
sf org create sandbox
command with an existing sandbox nameExpected result
Creation of new sandboxes and refreshes of existing sandboxes are initiated.
Actual result
The creation of a new sandbox is initiated.
Sandbox refresh of an existing sandbox fails to initialize due to a duplicate value error.
System Information
PowerShell on Windows 11
The text was updated successfully, but these errors were encountered: