Open parkerbrown11 opened 1 week 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.
How was that decomposed folder created? What are the contents of your sfdx-project.json file?
Hi @shetzel thanks for the quick reply.
The decomposed folder is created for this custom plugin: @rdietrick/sfdx-profile-decompose 1.0.2
Specifically, when you run this command, the profile and permission set files are split into separate but organized files for easier maintenance. They are held under the decomposed
folder.
The full contents of the sfdx-project.json file
"name": "ghsf",
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"name": "ghsf",
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "60.0",
"plugins": {
"sfdx-plugin-prettier": {
"enabled": true
}
}
}
I've never used that plugin, but based on the plugin docs you would need to run the aggregate command before any sf project deploy/retrieve
command. That plugin changes the metadata on the local file system in a way that is not understood by the core CLI plugins and will cause problems like you're seeing.
You can continue using that plugin and its commands and dealing with decompose/aggregate and the source tracking issues that can occur, or you can use the new "source behavior" features recently added to the core CLI plugins that handle these things for you. I don't believe Profiles are one of the metadata types supported by the "source behavior" feature though.
Reference these release notes: https://github.com/forcedotcom/cli/blob/main/releasenotes/README.md#2448-jun-5-2024 Reference this discussion: https://github.com/forcedotcom/cli/discussions/2544
Please reopen if this does not solve your issue.
Yes, I've been using that plugin for some time now and my retrieves have been working great up until I upgraded to the @salesforce/cli latest from 2.27.6 the other day. Since that upgrade it's been giving the error.
When I go back to @salesforce/cli version 2.27.6 it does a retrieve successfully without having to aggregate first with the decompose plugin. Is there something that changed with the way the retrieve command works between 2.27.6 and the latest?
Is there something that changed with the way the retrieve command works between 2.27.6 and the latest?
Possibly, but that file structure shouldn't work with any CLI version. Not sure why it wasn't throwing the same error with 2.27.6 but that plugin manipulates metadata in a way that the core CLI plugin (deploy-retrieve
) can't work with unless (per the docs) you run that aggregate command.
We can look into it a bit further, but the answer will likely be the same.
Yes, when we run a retrieve
on our full project, we have to run the aggregate command before it is successful, even with the 2.27.6 CLI version. If I'm retrieving a single CustomField file with the below command, unrelated to any profiles or permission sets, it works with the 2.27.6 version even without running the aggregate command. It doesn't work with the latest version of the sf CLI.
Does that change things at all from your end? Or would the answer still be the same?
sf project retrieve start -m CustomField:pse__Project_Task__c.Product_SKU__c
Hey @parkerbrown11 -
I'm surprised this was working in previous versions given that the file is in the project, have you been able to narrow down it down to what version of the CLI this behavior began in? That would be very useful
have you looked at adding these files to your .forceignore
- There's a chance that will cause this directory/file to be skipped now
Hi @WillieRuemmele I'll try to narrow things down to the exact version when this behavior began and let you know. I'll also try out adding the files to the .forceignore
Summary
When I run the
project retrieve start
on a new CustomField, the error message in theActual Result
section below occurs. I recently updated sf cli to the latest version. The /decomposed folder in our project contains broken down profile and permission set metadata.Steps To Reproduce
sf project retrieve start -m CustomField:pse__Project_Task__c.Product_SKU__c
Expected result
Clean retrieve of the new custom field into project source
Actual result
System Information
using zsh
Additional information