scolladon / sfdx-git-delta

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

package.xml is generated empty #878

Closed jdkgabri closed 3 months ago

jdkgabri commented 4 months ago

What is the problem?

version 5.38.1 works fine, however, starting 5.38.2 (I believe a926a881818f01d85f21246bac4e5f9b7b5062a2 introduced the issue), when I try to generate the deltas, the result package.xml is empty.


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

I face it with --to HEAD , and several variations of the --from flag.

What is the expected result?

The expected result, as it happens i 5.38.1 is the following package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>ShowRegistrationDetailsCtrl</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>Mulesoft</members>
        <name>ExternalCredential</name>
    </types>
    <types>
        <members>Mulesoft</members>
        <name>ExternalServiceRegistration</name>
    </types>
    <types>
        <members>Lite_Person_Account_Record_Page</members>
        <name>FlexiPage</name>
    </types>
    <types>
        <members>showRegistrationDetails</members>
        <name>LightningComponentBundle</name>
    </types>
    <types>
        <members>Mulesoft</members>
        <name>NamedCredential</name>
    </types>
    <types>
        <members>ShowRegistrationDetails</members>
        <name>PermissionSet</name>
    </types>
    <version>60.0</version>
</Package>

What is the actual result?

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
     <version>60.0</version>
</Package>

Steps to reproduce

I am not sure to be honest. I do not do anything special to reproduce, and I guess this was tested and worked when the changes were done, however, the issue happens to me at least.


Execution context


$ uname -v ; yarn -v ; node -v ; git --version ; sfdx --version ; sfdx plugins

2023-07-05 12:05 UTC
1.22.22
v20.9.0
git version 2.42.0.windows.1
 »   Warning: plugin-nakama is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.
@salesforce/cli/2.44.8 win32-x64 node-v20.9.0
 »   Warning: plugin-nakama is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.
@salesforce/sfdx-scanner 3.25.0
dev 2.0.4 (2.0.4)
lightning-flow-scanner 2.26.0
plugin-nakama 0.0.9 (link) C:\Users\gabri\Desktop\Projects\Nakama\plugin-nakama
sfdmu 4.33.17
sfdx-git-delta 5.38.1 (5.38.1)

Uninstalled JIT Plugins:
community 3.2.14
custom-metadata 3.3.10
devops-center 1.2.13
env 3.0.30
functions 1.23.0
signups 2.3.5
@salesforce/sfdx-plugin-lwc-test 1.2.0

scolladon commented 4 months ago

Hi @jdkgabri !

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

Sorry to ear it is hard to reproduce and thanks for the bisect analysis, looking at the commit helps a lot to give some context.

Could you tell the context of execution please ?

$ uname -v ; yarn -v ; node -v ; git --version ; sfdx --version ; sfdx plugins

And also, does the --repo parameter is the current folder (.) or do you execute the plugin from different folder (other than .) ?

jdkgabri commented 4 months ago

Hi @jdkgabri !

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

Sorry to ear it is hard to reproduce and thanks for the bisect analysis, looking at the commit helps a lot to give some context.

Could you tell the context of execution please ?

$ uname -v ; yarn -v ; node -v ; git --version ; sfdx --version ; sfdx plugins

And also, does the --repo parameter is the current folder (.) or do you execute the plugin from different folder (other than .) ?

I have just added the execution context to the description.

The --repo parameter I have not been using it,, so it runs with the default value, in the current repository always.

Couple of examples of the commands I tried:

sfdx sgd:source:delta --from HEAD^ --to HEAD --output deltas

sf sgd source delta --from origin/main --to HEAD --output deltas --source . --ignore .forceignore --ignore-destructive .forceignore --generate-delta
scolladon commented 4 months ago

Ok great, I see the issue occurs in Windows Any chance you could run that on unixlike os and see if it has the same issue please ? (it would help a lot)

jdkgabri commented 4 months ago

Ok great, I see the issue occurs in Windows Any chance you could run that on unixlike os and see if it has the same issue please ? (it would help a lot)

In a unix system it also happened, however, I managed to discovered that the issues happens when the --source flag has the value "."

scolladon commented 4 months ago

Thank you very much for your analysis here @jdkgabri, it is greatly helpful I'm able to reproduce the issue and I'll try to fix it asap

Stay tuned

github-actions[bot] commented 3 months ago

Shipped in release v5.40.1. You can install the new version using the version number or the latest-rc channel

$ sfdx plugins:install sfdx-git-delta@latest-rc
$ sfdx plugins:install sfdx-git-delta@v5.40.1

Happy incremental deployment!