salesforcedx-vscode icon indicating copy to clipboard operation
salesforcedx-vscode copied to clipboard

SFDX Retrieve/Deploy doesn't use SF CLI?

Open perryton opened this issue 2 years ago • 8 comments

If I recall correctly, years ago, the SF CLI Integration extension used to use/run SF CLI command when right-clicking on a file and selecting SFDX: Retrieve Source from Org in VS Code. What does the current version do/use now when retrieving? Can I configure it to use SF CLI again?

perryton avatar May 27 '22 15:05 perryton

bump

prateekamana avatar May 31 '22 07:05 prateekamana

Hi @perryton, deploy and retrieve now are calling the library instead of CLI. We had removed the experimental setting #3580. If you find any perform regression related to the current deploy and retrieve, we'd appreciate your feedback.

floralan avatar Jun 03 '22 21:06 floralan

I'm sorry but what exactly is "Library" and how is it a substitute to the CLI? 🤔

prateekamana avatar Jun 03 '22 23:06 prateekamana

We've been moving to using shared libraries instead of utilizing the cli directly in the vscode extensions for a while as there is a performance cost to starting the cli process (also we hope to one day make the extensions install not depend on having the cli installed).

The shared library in this case is the source-deploy-retrieve library. It is used by both the vscode extensions and cli to do the deploy/retrieve operations.

There is currently no option to use the CLI for doing sync operations.
Is there functionality that is impacted for you b/c of this decision? What's missing that you'd like to get from using the CLI under the hood instead of the shared lib code?

gbockus-sf avatar Jun 06 '22 20:06 gbockus-sf

Hi @floralan. I also would like to understand what "the library" is and how it can be configured.

My issue is I don't know how to configure the latest extension to trust/use my internal organization's CA certificates on Windows 10.

I am able to configure SF CLI to trust/use our CA certs by creating a system variable, NODE_EXTRA_CA_CERTS, and pointing it to a file containing the certs in PEM format. So, when downgrading the extension to 53.0.1 and unchecking that experimental setting, a retrieve works through the VS Code GUI (right-clicking on a file and selecting SFDX: Retrieve Source from Org).

However, with the experimental setting checked on, it doesn't work. I get an "unable to verify first certificate" error.

Please advise. Thanks.

perryton avatar Jun 06 '22 20:06 perryton

@perryton When floralan said, "the library", she was referring to the Source deploy Retrieve library, located at https://github.com/forcedotcom/source-deploy-retrieve.

Q: "Can I configure it to use SF CLI again?" A: No, this is not configurable. We've been migrating away from spawning a CLI process and running sfdx commands, and using the Source-Deploy-Retrieve library.

jeffb-sfdc avatar Jun 14 '22 21:06 jeffb-sfdc

Thanks for the responses. @gbockus-sf and @jeffb-sfdc

So, I guess I'm wondering now, why it appears that the NODE_EXTRA_CA_CERTS variable doesn't work with the latest extension, when it works with the SF CLI?

Is there a different method of extending the list of trusted CA certs that I need to use with the latest extension?

perryton avatar Jun 15 '22 14:06 perryton

@perryton my apologies on the slow response. This is not something we were tracking on the vscode side. I'll mark this as a bug so it's raised up internally as something we need to address. FYI @AnanyaJha

gbockus-sf avatar Jul 05 '22 16:07 gbockus-sf

Hi @perryton, sorry for the long waiting. Could you please install these vsixes VS Code Extensions, open vscode settings, set the new setting salesforcedx-vscode-core: NODE_EXTRA_CA_CERTS and check if it works for you? image Thanks in advance!

CristiCanizales avatar Nov 28 '23 18:11 CristiCanizales