-
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
[Metadata Decompose] sf project retrieve start --metadata unable to retrieve individual CustomLabel #2840
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. |
I'm also facing this issue. I'd still like to retrieve individual $ sf project retrieve start -m CustomLabel:Dummy
Preparing retrieve request... Error
Error (1): Cannot use this type, instead use CustomLabels I followed the instructions:
Retrieving all labels via $ tree force-app/main/default/labels
force-app/main/default/labels
└── CustomLabels
├── CustomLabels.labels-meta.xml
├── One.label-meta.xml
└── Two.label-meta.xml
2 directories, 3 files Is this correct? |
Hi @amtrack, The retrieve command works properly on retrieving all CustomLabels, however the deploy commands failed to identify the labels which are in the decomposed directory. for your information, I have also tried to diff the changes with salesforce git delta (sgd) and come up with correct package.xml. But current version salesforce cli simply bypass the custom label metadata listed in package.xml |
This issue has been linked to a new work item: W-15643464 |
Hi @RayHWLau, I have found the reason for that. It happened for custom labels and sharing rules too. Both these components have two type of metadata entities. One for bulk retrieval eg: SharingRules, CustomLabels and other for single retrieval eg: SharingCriteriaRule, SharingOwnerRule, CustomLabel etc. Bulk retrieval using SharingRules is working fine. So for CustomLabels. But if we will try to retrieve a specific sharing criteria rule, sharing owner rule or custom label, retrieval command is successful, but we will get Nothing retrieved message. |
Any update @mshanemc ? |
@shabu74 there's a lot going on, but I'm working through the trade-offs around this. It greatly simplifies things if you always deploy/retrieve the parent. So much so that we intentionally disabled that in the beta. Very interested in this feedback. FWIW, I've chatted with the mdapi team about limits (they count files, not "components" so retrieve/deploying all your So I guess the question becomes, "how bad would it be, and in what ways, if we just said, [obviously, we'd want to handle the vscode org-browser right-click scenario better and say, "oh, you wanted to retrieve a CustomLabel....I'll retrieve CustomLabels for you"] [the metadata deploy/retrieve ends up deploying/retrieving the file named I'm not saying what you're asking for can't be done, I'm wanting to understand more of why that's valuable to you |
@mshanemc Hmm, I'd hope that all operations (retrieve, deploy and delete as well) will work for the individual Speaking of restrictions and custom labels :-) here's a use case of retrieving an individual CustomLabel: Assuming you have two package directories $ sf project retrieve start -m CustomLabel:MyNewLabel --output-dir sfdx-source/lib
Error (1): The retrieve target directory [sfdx-source/lib] overlaps one of your package directories. Specify a different retrieve target directory and try again. I feel like there are a lot of things to consider with custom labels and package directories with and even without decomposition. |
@amtrack the "where do things end up" should really be controlled by your we added Hopefully you can soon just retrieve it and then decide where it goes because of the new #2682 stuff |
@mshanemc Hmm, OK. |
Just tried again with Salesforce CLI v2.46.6 with VS Code Salesforce CLI Integration v60.0.1 (with Windows 10) Issue still exist |
y'all, thanks for the feedback on this. It's not a bug, so I'll close the github issue. We'll get some design feedback on another option (where instead of trying to make Labels share the decomposition code we use for other decomposed types, we'll give them a unique decomposition behavior). You'll get a cleaner folder structure and the ability do deploy invididually @VivekMChawla is gonna share that design doc soon. |
Summary
sf project retrieve command failed to retrieve individual Custom Label after opt-in to decomposeCustomLabelsBeta
Steps To Reproduce
Expected result
Either of following should be able to retrieve the custom label correctly
C1. sf project retrieve start --metadata CustomLabel:TestCustomLabel
C2. sf project retrieve start --metadata CustomLabels:TestCustomLabel should be able to retrieve corresponding
C3. sf project retrieve start --metadata CustomLabels:CustomLabels/TestCustomLabel
C4. (VSCode only) create the label metadata manually in local directory, then right click retrieve source from org from dropdown
Actual result
C1. Cannot use this type, instead use CustomLabels
C2. Entity of type 'CustomLabels' named 'TestCustomLabel' cannot be found
C3. Entity of type 'CustomLabels' named 'CustomLabels/TestCustomLabel' cannot be found
C4. Could not infer a metadata type
System Information
Environment:
MacOS
@salesforce/cli/2.37.4 darwin-arm64 node-v20.12.0
Windows
@salesforce/cli/2.37.4 win32-x64 node-v20.11.1
Connected Sandbox:
Developer, cloned from Unlimited Edition Production Org
Software:
Windows:
cmd.exe
powershell embedded in VSCode
MacOS:
zsh
The text was updated successfully, but these errors were encountered: