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

Error due to SFDX deprecation #904

Closed
1 task
bmehtawebsummit opened this issue Aug 30, 2024 · 17 comments
Closed
1 task

Error due to SFDX deprecation #904

bmehtawebsummit opened this issue Aug 30, 2024 · 17 comments
Assignees
Labels
bug Something isn't working

Comments

@bmehtawebsummit
Copy link

bmehtawebsummit commented Aug 30, 2024

Issue verification check:

  • is the current repository fully deployable at the commit SHA provided with the 'from' parameter of the command?

What is the problem?

sfdx sgd:source:delta  --from $(git describe --match "${ORG_NAME}-*" --abbrev=0 --tags HEAD) --to HEAD --output . --ignore .forceignore --api-version "${API_VERSION}"

Error while using the above command : 
_(node:167) Warning: Deprecated environment variable: SFDX_LAZY_LOAD_MODULES. Please use SF_LAZY_LOAD_MODULES instead.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:167) Warning: Deprecated environment variable: SFDX_AUTOUPDATE_DISABLE. Please use SF_AUTOUPDATE_DISABLE instead.
(node:167) Warning: Deprecated environment variable: SFDX_DISABLE_AUTOUPDATE. Please use SF_DISABLE_AUTOUPDATE instead.
(node:167) Warning: Deprecated config name: apiVersion. Please use org-api-version instead._


What is the parameter and the value you used with it?

What is the expected result?

What is the actual result?

Steps to reproduce


Execution context


Operating System: … Docker

yarn version:

node version: …v20.17.0

git version: …git version 2.45.2

sfdx version: …sfdx-cli/47.15.1 linux-x64 node-v20.17.0

sgd plugin version: … should be the latest

More information (optional)


@bmehtawebsummit bmehtawebsummit added the bug Something isn't working label Aug 30, 2024
@scolladon
Copy link
Owner

Hi @bmehtawebsummit!

Thanks for raising this issue and thanks for contributing in making this project better!

I can see warnings but no errors.
And the only warning that I could address is the one referring to the api version parameter ((node:167) Warning: Deprecated config name: apiVersion. Please use org-api-version instead._).
This issue with the api version parameter is tracked in the issue #619 (maybe it is a duplicate)

Could you provide more information please ?
What is the actual error ?
How can I reproduce ?

@bmehtawebsummit
Copy link
Author

HI @scolladon ,

Thanks for giving reference of the issue. So what I understood is the warning can be ignored ? for the warning below

_((node:167) Warning: Deprecated config name: apiVersion. Please use org-api-version instead._)._

I am not using apiVersion config name in my entire script anywhere, I have double checked SGD command, putting below for your reference.

sfdx sgd:source:delta --from $(git describe --match "${ORG_NAME}-*" --abbrev=0 --tags HEAD) --to HEAD --output . --ignore .forceignore --api-version "${API_VERSION}"

If the warning can be ignored then I have a real issue that after sfdx sgd:source:delta command a package xml is generated but

sfdx force:source:deploy -x ${PACKAGE_XML_PATH} -w 30 -u ${SF_USERNAME}

command right after that is deploying more than specific in the package/package.xml. So I was wondering if this has something to do with the warning I am seeing. This mainly happens when I am trying to create/update a field. It tried to deploy the entire object where previously it use to deploy just a field.

@scolladon
Copy link
Owner

Hum...

I think the plugin may have added the SObject in the package.xml, this is why then it could try to deploy the full object.
The plugin add the parent SObject when a master detail fields is added/modified and also add the master detail field when the parent SObject is modified. This is because of this known issue

Could you show the diff (git diff --name-status --no-renames <from> <to>) and the content of the package.xml please ?

@bmehtawebsummit
Copy link
Author

HI @scolladon

Sorry for the delay.

For eg : I made a description adjustment on a field Cost__c on account object

the output of
git --no-pager diff --name-status HEAD prod-20240905110838 is
M force-app/main/default/objects/Account/fields/Cost__c.field-meta.xml

Package XML is

Account.Cost__c CustomField 58.0

It is still attempting to deploy the entire object

@scolladon
Copy link
Owner

That is weird...

Based on those new information I would say the plugin as done its job correctly.

The package.xml generated is expected.

What is concerning is the deploy command is deploying the whole object when asking to only deploy a field.

What is the command used to deploy ?

@bmehtawebsummit
Copy link
Author

sfdx force:source:deploy -x package/package.xml -w 30 -u ************************** -c -l RunSpecifiedTests -r NoTestRun

@scolladon
Copy link
Owner

sfdx force:source:deploy -x package/package.xml -w 30 -u ************************** -c -l RunSpecifiedTests -r NoTestRun

I think this bug is located on the sfdx cli itself then...
I think the plugin has done its job and you would experience the same result if you build the package.xml by hand and try to deploy it.

If you agree I'll close this one
if you can drop the issue created on the cli I'll follow it

@bmehtawebsummit
Copy link
Author

Hi @scolladon

I am raising ticket with salesforce cli but I wanted to confirm if my understanding is correct that SGD is still working on SFDX command? sfdx commands have been deprecated and will be removed on Nov 2024 as per this link forcedotcom/cli#2974

Please advise what is your plan on migration and what would you advise to me that should I check for SFDX or try changing to sf command ?

@scolladon
Copy link
Owner

Hi @bmehtawebsummit,

We are migrating soon to the new plugin v2 architecture.
The actual command line is both compatible with sfdx cli and sf cli.
After migrating it will still be the case as well.

I think you should migrate to sf command 👍

@bmehtawebsummit
Copy link
Author

I tried
sf sgd source delta --from $(git describe --match "${ORG_NAME}-*" --abbrev=0 --tags HEAD) --to HEAD --output . --ignore .forceignore --api-version "${API_VERSION}"

and getting following error

› Warning: sgd source delta is not a sf command.
Did you mean force source delete? (Y/n)
› Error: Run sf help for a list of available commands.

@scolladon
Copy link
Owner

Have you tried sf sgd:source:delta ... ?

@bmehtawebsummit
Copy link
Author

yes, I tried that too. 

@bmehtawebsummit
Copy link
Author

I tried this command
sf sgd:source:delta --help

and that also did not work

@scolladon
Copy link
Owner

What you can do is:

  • install sf cli
  • use the sfdx compatibility command shipped with sf cli installation

We are currently working on migrating to the plugin v2 architecture.
It will work with sf command soon

@bmehtawebsummit
Copy link
Author

Hi,

I have written following in my docker file :

RUN npm install @salesforce/cli --global
RUN sf --version
RUN sf plugins install sfdx-git-delta
RUN sf plugins

Please let me know what should I change here?

@scolladon
Copy link
Owner

Nothing to change here

When you install @salesforce/cli you have both sf and sfdx compatibility command
Then you can use sgd with the sfdx command

@bmehtawebsummit
Copy link
Author

thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants