scolladon / sfdx-git-delta

Generate the sfdx content in source format from two git commits
Other
441 stars 115 forks source link

Error due to SFDX deprecation #904

Closed bmehtawebsummit closed 1 month ago

bmehtawebsummit commented 2 months ago

Issue verification check:

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)


scolladon commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 1 month ago

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 <?xml version="1.0" encoding="UTF-8"?>

Account.Cost__c CustomField 58.0

It is still attempting to deploy the entire object

scolladon commented 1 month ago

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 commented 1 month ago

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

scolladon commented 1 month ago

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 commented 1 month ago

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 https://github.com/forcedotcom/cli/issues/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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

bmehtawebsummit commented 1 month ago

yes, I tried that too. 

bmehtawebsummit commented 1 month ago

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

and that also did not work

scolladon commented 1 month ago

What you can do is:

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

bmehtawebsummit commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

thanks for your help