Closed DilipJainFL closed 2 months 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.
Hello @DilipJainFL :wave: It looks like you didn't include the full Salesforce CLI version information in your issue.
Please provide the output of version --verbose --json
for the CLI you're using (sf
or sfdx
).
A few more things to check:
rc
or nightly
versions. (docs)doctor
command to diagnose common issues.Thank you!
Updated the description -
here is the version - @salesforce/cli/2.42.6 wsl-x64 node-v20.14.0
--purge-on-delete
requires --manifest
.
You can pass a manifest or a zip file, but not both.
If you check the first message I have tried to use the only with zip but then it was asking for the --purge-on-delete requires manifest file.
If you check the first message I have tried to use the only with zip but then it was asking for the --purge-on-delete requires manifest file.
that's what I mentioned above, you can pass a manifest or a zip file but not both.
--purge-on-delete
only works when deploying with--manifest
.
Thanks for the Reply.
But When I am trying with the similar SFDX command It is working fine -
sfdx force:mdapi:deploy -u username -f ${buildZip} -g -w 1665 -s -l NoTestRun --purgeondelete --verbose
This issue has been linked to a new work item: W-16010166
Looks like a bug. We'll change the command so that --purge-on-delete
does not require --manifest
.
@shetzel, I agree this seems to be a bug. My thoughts:
--purgeondelete works with METADATA API FORMAT using sfdx force:mdapi:deploy. --purge-on-delete does not work with METADATA API FORMAT using sf project deploy start. --metadata-dir flag is used with sf-style command to deploy with METADATA API FORMAT. --purge-on-delete flag should not require --manifest. This is a SOURCE FORMAT FLAGS that doesn't apply to METADATA API FORMAT deployments. --purge-on-delete flag should not require --pre-destructive-changes or --post-destructive-changes either if --metadata-dir includes a zip file of metadata formatted files to deploy. This zip file should include a package.xml file, and any destructiveChangesPre.xml or destructiveChangesPost.xml files.
@mshanemc Could you please share details about the completions for this ticket and what is solution to resolve the issue.
I'm able to use the below command
sf project deploy start -o username --metadata-dir build_1.zip -g -w 35791 --single-package --purge-on-delete --verbose
but It's not throwing any error but It's not deleting the components from the org.
Please share the details about this. Thanks!
Does your zip file include at least one destructiveChangesPre|Post file? Want to provide a sample project that replicates your issue?
docs now say
Deploy all metadata formatted files in the "MDAPI" directory; items listed in the MDAPI/destructiveChangesPre.xml and MDAPI/destructiveChangesPost.xml manifests are immediately eligible for deletion rather than stored in the Recycle Bin:
Yes It have the post file.
@mshanemc Could you please share any general example that worked for you in the dev environment.
* Now When adding the --manifiest to handle the above error receving one more error that can not use the manifest with --metadata dir
sf project deploy start -o ${env.bamboo_sf_username} --metadata-dir ${buildZip} -g -w ${env.bamboo_sf_maxWaitMillis} --single-package --manifest package.xml --post-destructive-changes build/destructiveChangesPost.xml --verbose --purge-on-delete
Summary
In summarizaed words would like to deploy a zip with purge on delete using the SF CLI with metdata dir tag. leveraging the first command added above.