Skip to content
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

Required --manifest Parameter with the metadata dir tag #2909

Closed
DilipJainFL opened this issue Jun 7, 2024 · 14 comments
Closed

Required --manifest Parameter with the metadata dir tag #2909

DilipJainFL opened this issue Jun 7, 2024 · 14 comments
Labels
bug Issue or pull request that identifies or fixes a bug more information required Issue requires more information or a response from the customer

Comments

@DilipJainFL
Copy link

DilipJainFL commented Jun 7, 2024

Note
Currently I am using the Latest SF CLI V2 - @salesforce/cli/2.42.6 wsl-x64 node-v20.14.0 , and facing one issue with the deployment when utilizing the --metdata dir tag to deploy a single package (Zip) file.
** I have use case to use the metadata dir only with the project***
** Also I am using the purge on delete tag to delete data from Recycle bin as well.**
But when I am passing the parameters and tags using the below command
sf project deploy start -o username --metadata-dir ${buildZip} -g -w 1665 --single-package --post-destructive-changes build/destructiveChangesPost.xml --verbose --purge-on-delete
image

*** 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

image

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.

@DilipJainFL DilipJainFL added the investigating We're actively investigating this issue label Jun 7, 2024
Copy link

github-actions bot commented Jun 7, 2024

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.

Copy link

github-actions bot commented Jun 7, 2024

Hello @DilipJainFL 👋 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:

  • Make sure you've provided detailed steps to reproduce your issue.
    • A repository that clearly demonstrates the bug is ideal.
  • Make sure you've installed the latest version of Salesforce CLI. (docs)
    • Better yet, try the rc or nightly versions. (docs)
  • Try running the doctor command to diagnose common issues.
  • Search GitHub for existing related issues.

Thank you!

@github-actions github-actions bot added more information required Issue requires more information or a response from the customer and removed investigating We're actively investigating this issue labels Jun 7, 2024
@DilipJainFL
Copy link
Author

Updated the description -
here is the version - @salesforce/cli/2.42.6 wsl-x64 node-v20.14.0

@cristiand391
Copy link
Member

--purge-on-delete requires --manifest.

You can pass a manifest or a zip file, but not both.

@DilipJainFL
Copy link
Author

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.
image

@cristiand391
Copy link
Member

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.

@DilipJainFL
Copy link
Author

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

@shetzel shetzel added the bug Issue or pull request that identifies or fixes a bug label Jun 14, 2024
Copy link

git2gus bot commented Jun 14, 2024

This issue has been linked to a new work item: W-16010166

@shetzel
Copy link
Contributor

shetzel commented Jun 14, 2024

Looks like a bug. We'll change the command so that --purge-on-delete does not require --manifest.

@chulai
Copy link

chulai commented Jun 14, 2024

@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.

@DilipJainFL
Copy link
Author

@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!

@mshanemc
Copy link
Contributor

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:

@DilipJainFL
Copy link
Author

Yes It have the post file.
image

@DilipJainFL
Copy link
Author

@mshanemc Could you please share any general example that worked for you in the dev environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug more information required Issue requires more information or a response from the customer
Projects
None yet
Development

No branches or pull requests

5 participants