cli icon indicating copy to clipboard operation
cli copied to clipboard

Add option to force:source:retrieve to exclude Managed Package's components

Open maaaaarco opened this issue 6 years ago • 5 comments
trafficstars

I'd like to have an option on the force:source:retrieve command that allows me to include/excludes Managed Pakage's components automatically. For example, in case I installed a Managed Package that adds some fields on the Account object, when running this command sfdx force:source:retrieve -m CustomObject:Account I'll also retrieve all the fields created by the Managed Package.

Describe the solution you'd like An option that could look like this: sfdx force:source:retrieve -m CustomObject:Account --exclude-managed-components In this case all the fields that are part of a Managed Package won't be retrieved.

maaaaarco avatar May 09 '19 14:05 maaaaarco

@maaaaarco do you want this to work as a blanket exclusion of all managed package components or can you forsee ever wanting to pick and choose components to exclude?

clairebianchi avatar May 21 '19 22:05 clairebianchi

Mmmmm no at the moment I cannot forsee any reason why I might want to retrieve only some Managed components. In that case I might configure which components to exclude and which to include inside my .forceignore file.

maaaaarco avatar May 22 '19 07:05 maaaaarco

the inverse of this might also be considered, currently if you retrieve all custom objects, i'd expect get unmanaged fields on managed objects, but i get nothing

seems like the default behavior should be

  • don't retrieve managed metadata (listviews, customfields, buttons, etc.) that's part of unmanaged metadata (mainly custom objects)
  • retrieve unmanaged metadata (listviews, custom fields, etc.) that are part of managed metadata (mainly custom object)

right now you get managed metadata you don't want, and you don't get unmanaged metadata you would, makes CI difficult due to errors about not being able to modify managed metadata, or having to manually specify unmanaged metadata

ralphcallaway avatar Apr 17 '20 20:04 ralphcallaway

This would be very helpful for my initial migrations... Just retrieve what is not managed package (this is already installed in source and target), fetch just the delta, and deploy this into the target environment. Would make my life so much easier.

gunes-consulting avatar May 17 '21 14:05 gunes-consulting

This is so incredibly crucial. Why would I want to check managed elements into my source control? All it does is cause deployment errors and I'm having to write scripting to clean specific XML files matching name patterns when Salesforce already knows what's managed or not.

Honestly, this should exclude all packaged components including unmanaged packages. Same deal for managed only even more reasoning: packages are meant to be using push and pull so the ability to exclude them has to be present (if not the default).

goto-dev-null avatar Jun 14 '21 20:06 goto-dev-null