Issue verification check :
Git diff is containing CustomLabels file modification but sgd output contains an empty customLabel file
git output:
diff --git a/force-app/main/default/labels/CustomLabels.labels-meta.xml b/force-app/main/default/labels/CustomLabels.labels-meta.xml
index 7a2dffde..a491a871 100644
--- a/force-app/main/default/labels/CustomLabels.labels-meta.xml
+++ b/force-app/main/default/labels/CustomLabels.labels-meta.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata">
+<?xml version="1.0" encoding="utf-8"?><CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata">
<labels>
<fullName>DWIN2_Account_AccountWithInActivePriceBook</fullName>
<language>en_US</language>
@@ -12,7 +11,7 @@
<language>en_US</language>
<protected>false</protected>
<shortDescription>DWIN2 - Compte - Compte sans catalogue de prix</shortDescription>
- <value>L'opération est impossible car le compte n'a pas de Catalogue de prix.</value>
+ <value>L'opération est impossible car le compte n'a pas de Catalogue de prix.</value>
</labels>
<labels>
<fullName>DWIN2_Account_HasAlreadyPrincipalContract</fullName>
@@ -21,6 +20,60 @@
<shortDescription>DWIN2 - Account - Possède déjà un Contrat principal</shortDescription>
<value>The Account already have a principal Contract.</value>
</labels>
+ <labels>
+ <fullName>DWIN2_Alert_Lead_VQ_NeedPicture_Relaunch</fullName>
+ <language>en_US</language>
+ <protected>false</protected>
+ <shortDescription>DWIN2_Alert_Lead_VQ_NeedPicture_Relaunch</shortDescription>
+ <value>Hello,
+
+This request need to relaunch</value>
+ </labels>
+ <labels>
+ <fullName>DWIN2_Alert_Lead_VQ_New_Relaunch1h</fullName>
+ <language>en_US</language>
+ <protected>false</protected>
+ <shortDescription>DWIN2_Alert_Lead_VQ_New_Relaunch1h</shortDescription>
+ <value>Hello,
+
+This new request wait to be qualified</value>
+ </labels>
+ <labels>
+ <fullName>DWIN2_Alert_Opportunity_VQ_Draft_Relaunch1h</fullName>
+ <language>en_US</language>
+ <protected>false</protected>
+ <shortDescription>DWIN2_Alert_Opportunity_VQ_Draft_Relaunch1h</shortDescription>
+ <value>Hello,
+
+This quote wait to pricing</value>
+ </labels>
+ <labels>
+ <fullName>DWIN2_Alert_Opportunity_VQ_Nego_Relaunch24h</fullName>
+ <language>en_US</language>
+ <protected>false</protected>
+ <shortDescription>DWIN2_Alert_Opportunity_VQ_Nego_Relaunch24h</shortDescription>
+ <value>Hello,
+
+This quote need to princing new</value>
+ </labels>
+ <labels>
+ <fullName>DWIN2_Alert_Opportunity_VQ_Sent_Relaunch</fullName>
+ <language>en_US</language>
+ <protected>false</protected>
+ <shortDescription>DWIN2_Alert_Opportunity_VQ_Sent_Relaunch</shortDescription>
+ <value>Hello,
+
+This quote need to phone relaunch</value>
+ </labels>
+ <labels>
+ <fullName>DWIN2_Alert_Opportunity_VQ_Won_Relaunch24h</fullName>
+ <language>en_US</language>
+ <protected>false</protected>
+ <shortDescription>DWIN2_Alert_Opportunity_VQ_Won_Relaunch24h</shortDescription>
+ <value>Hello,
+
+This quote is won, it's time to plan work order</value>
+ </labels>
<labels>
<fullName>DWIN2_Cancel</fullName>
<language>en_US</language>
@@ -47,63 +100,63 @@
<language>en_US</language>
<protected>false</protected>
<shortDescription>DWIN2 - Prix contracté - Produit non saisissable</shortDescription>
- <value>Vous ne pouvez pas utiliser ce produit car il n'est pas dans le Catalogue de prix du compte.</value>
+ <value>Vous ne pouvez pas utiliser ce produit car il n'est pas dans le Catalogue de prix du compte.</value>
</labels>
<labels>
<fullName>DWIN2_ContractedPrice_NoPricebook</fullName>
<language>en_US</language>
<protected>false</protected>
<shortDescription>DWIN2 - Prix contracté - Pas de pricebook</shortDescription>
- <value>Vous ne pouvez pas saisir de prix contractés pour ce dernier car le compte n'a pas de Catalogue de prix.</value>
+ <value>Vous ne pouvez pas saisir de prix contractés pour ce dernier car le compte n'a pas de Catalogue de prix.</value>
</labels>
<labels>
<fullName>DWIN2_Error_DeleteWoliStageQuotation</fullName>
<language>fr</language>
<protected>false</protected>
<shortDescription>DWIN2 - Erreur à la suppression ligne travaux statut devis</shortDescription>
- <value>Vous ne pouvez pas supprimer cette ligne de travaux car le devis associé à l'intervention est validé.</value>
+ <value>Vous ne pouvez pas supprimer cette ligne de travaux car le devis associé à l'intervention est validé.</value>
</labels>
<labels>
<fullName>DWIN2_Error_DeleteWoliWorkOrderStatus</fullName>
<language>fr</language>
<protected>false</protected>
<shortDescription>DWIN2 - Erreur à suppression ligne travaux statut intervention</shortDescription>
- <value>Vous ne pouvez pas supprimer cette ligne de travaux car l'intervention est au statut Finalisé.</value>
+ <value>Vous ne pouvez pas supprimer cette ligne de travaux car l'intervention est au statut Finalisé.</value>
</labels>
<labels>
<fullName>DWIN2_Error_InsertWoliStageQuotation</fullName>
<language>fr</language>
<protected>false</protected>
- <shortDescription>DWIN2 - Erreur à l'insertion ligne travaux statut devis</shortDescription>
- <value>Vous ne pouvez pas ajouter cette ligne de travaux car le devis associé à l'intervention est validé.</value>
+ <shortDescription>DWIN2 - Erreur à l'insertion ligne travaux statut devis</shortDescription>
+ <value>Vous ne pouvez pas ajouter cette ligne de travaux car le devis associé à l'intervention est validé.</value>
</labels>
<labels>
<fullName>DWIN2_Error_InsertWoliWorkOrderStatus</fullName>
<language>fr</language>
<protected>false</protected>
<shortDescription>DWIN2 - Erreur à insertion ligne travaux statut intervention</shortDescription>
- <value>Vous ne pouvez pas insérer cette ligne de travaux car l'intervention est au statut Finalisé.</value>
+ <value>Vous ne pouvez pas insérer cette ligne de travaux car l'intervention est au statut Finalisé.</value>
</labels>
<labels>
<fullName>DWIN2_Error_OpportunitySendToCustomer</fullName>
<language>en_US</language>
<protected>false</protected>
- <shortDescription>DWIN2 - Erreur à l'envoi du devis</shortDescription>
- <value>You can't send an opportunity whitout lines</value>
+ <shortDescription>DWIN2 - Erreur à l'envoi du devis</shortDescription>
+ <value>You can't send an opportunity whitout lines</value>
</labels>
<labels>
<fullName>DWIN2_Error_UpdateWoliStageQuotation</fullName>
<language>fr</language>
<protected>false</protected>
<shortDescription>DWIN2 - Erreur à modification ligne travaux statut devis</shortDescription>
- <value>Vous ne pouvez pas modifier cette ligne de travaux car le devis associé à l'intervention est validé.</value>
+ <value>Vous ne pouvez pas modifier cette ligne de travaux car le devis associé à l'intervention est validé.</value>
</labels>
<labels>
<fullName>DWIN2_Error_UpdateWoliWorkOrderStatus</fullName>
<language>fr</language>
<protected>false</protected>
<shortDescription>DWIN2 - Erreur à modification ligne travaux statut intervention</shortDescription>
- <value>Vous ne pouvez pas modifier cette ligne de travaux car l'intervention est au statut Finalisé.</value>
+ <value>Vous ne pouvez pas modifier cette ligne de travaux car l'intervention est au statut Finalisé.</value>
</labels>
<labels>
<fullName>DWIN2_Error_UpdateWorkOrder_Status</fullName>
@@ -137,43 +190,43 @@
<fullName>DWIN2_General_SourceRecordWasntFind</fullName>
<language>en_US</language>
<protected>false</protected>
- <shortDescription>DWIN2 - General - Source Record Wasn't Find</shortDescription>
- <value>Source record wasn't find.</value>
+ <shortDescription>DWIN2 - General - Source Record Wasn't Find</shortDescription>
+ <value>Source record wasn't find.</value>
</labels>
<labels>
<fullName>DWIN2_Lead_LeadWithoutPricebook</fullName>
<language>en_US</language>
<protected>false</protected>
<shortDescription>DWIN2 - Lead - Lead whitout pricebook</shortDescription>
- <value>Operation unvailable because the lead isn't linked to a pricebook.</value>
+ <value>Operation unvailable because the lead isn't linked to a pricebook.</value>
</labels>
<labels>
<fullName>DWIN2_Lead_NoOpportunityWhileConversion</fullName>
<language>en_US</language>
<protected>false</protected>
<shortDescription>DWIN2 - Lead - No Opportunity While Conversion</shortDescription>
- <value>You can't convert this lead whitout creating or assigning an Opportunity.</value>
+ <value>You can't convert this lead whitout creating or assigning an Opportunity.</value>
</labels>
<labels>
<fullName>DWIN2_OpportunityProduct_CantUseProduct</fullName>
<language>fr</language>
<protected>false</protected>
<shortDescription>DWIN2 - Ligne de travaux - Produit non saisissable</shortDescription>
- <value>Vous ne pouvez pas utiliser ce produit car il n'est pas dans le Catalogue de prix du compte.</value>
+ <value>Vous ne pouvez pas utiliser ce produit car il n'est pas dans le Catalogue de prix du compte.</value>
</labels>
<labels>
<fullName>DWIN2_OpportunityProduct_CantUseProductCauseOfLocation</fullName>
<language>fr</language>
<protected>false</protected>
- <shortDescription>DWIN2 - Ligne de travaux - Produit non valide dû à l'emplacement sélectionné</shortDescription>
- <value>Vous ne pouvez pas utiliser ce produit pour l'emplacement sélectionné.</value>
+ <shortDescription>DWIN2 - Ligne de travaux - Produit non valide dû à l'emplacement sélectionné</shortDescription>
+ <value>Vous ne pouvez pas utiliser ce produit pour l'emplacement sélectionné.</value>
</labels>
<labels>
<fullName>DWIN2_OpportunityProduct_NoPriceBookOnAccount</fullName>
<language>fr</language>
<protected>false</protected>
<shortDescription>DWIN2 - Ligne de travaux - Aucun catalogue de prix sur le compte</shortDescription>
- <value>Vous ne pouvez pas saisir de ligne de travaux pour ce dernier car le compte n'a pas de Catalogue de prix.</value>
+ <value>Vous ne pouvez pas saisir de ligne de travaux pour ce dernier car le compte n'a pas de Catalogue de prix.</value>
</labels>
<labels>
<fullName>DWIN2_OpportunityProduct_QuantityIsMandatory</fullName>
@@ -187,21 +240,21 @@
<language>fr</language>
<protected>false</protected>
<shortDescription>DWIN2 - Ligne de travaux - Véhicule non trouvé</shortDescription>
- <value>Le véhicule n'a pas pu être récupéré de la cotation.</value>
+ <value>Le véhicule n'a pas pu être récupéré de la cotation.</value>
</labels>
<labels>
<fullName>DWIN2_Opportunity_OpportunityWithoutProducts</fullName>
<language>en_US</language>
<protected>false</protected>
<shortDescription>DWIN2 - Opportunite - Opportunité sans Produit</shortDescription>
- <value>You can't do this action whitout any lines.</value>
+ <value>You can't do this action whitout any lines.</value>
</labels>
<labels>
<fullName>DWIN2_PriceBookEntry_ProductNotConfigured</fullName>
<language>en_US</language>
<protected>false</protected>
<shortDescription>DWIN2 - Entrée de catalogue de prix - Produit non configuré</shortDescription>
- <value>Le produit sélectionné n'est pas configuré dans le Catalogue de prix</value>
+ <value>Le produit sélectionné n'est pas configuré dans le Catalogue de prix</value>
</labels>
<labels>
<fullName>DWIN2_PriceBook_PDF</fullName>
@@ -237,7 +290,7 @@
<language>en_US</language>
<protected>false</protected>
<shortDescription>DWIN2 - Emplacement de prestation - Produit et emplacement sont incompatibles</shortDescription>
- <value>L'emplacement sélectionné n'est pas configuré pour ce produit.</value>
+ <value>L'emplacement sélectionné n'est pas configuré pour ce produit.</value>
</labels>
<labels>
<fullName>DWIN2_Product_QuantityIsMandatory</fullName>
@@ -471,7 +524,7 @@
<categories>dwin2</categories>
<language>en_US</language>
<protected>false</protected>
- <shortDescription>DWIN2 - RelatedView_Damage</shortDescription>
+ <shortDescription>DWIN2_RelatedView_Damage</shortDescription>
<value>Damages</value>
</labels>
<labels>
sgd output :
<?xml version="1.0" encoding="utf-8"?>
<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata"></CustomLabels>
sgd -d -t HEAD -f origin/master -r . -o output/
and for git :
git diff --no-renames origin/master HEAD
Custom labels file contains all diff.
Custom labels file is empty
Make change in customLabels file and see empty sgd output file
Operating System: …
Windows 10
NPM version: …
6.14.5
Node version: …
v13.12.0
sgd version: …
3.3.0
Hi @arafesthain
Thanks for this issue !
Is it reproducible with the version 3.2.0 ?
Hi @scolladon
Same error in 3.2 :)
hey, it seems like this issue came back, steps to reproduce are exactly the same
Hi @osieckiAdam,
Thanks for raising this issue back.
I tried locally, with the latest version of the plugin, to change the API Name of a CustomLabel in the CustomLabels.labels-meta.xml file and the result was fine in the package.xml, the destructiveChanges.xml and in the delta file.
With which version of the plugin are you able to reproduce ?
And how to reproduce ?
Thanks in advance
Hey all I did is that I created delta from two different branches, and the only difference was custom label file. Generated package.xml was empty, I also checked destructive changes just to be sure that it was not a matter of mistake with parameters but it is also empty
Hi @osieckiAdam,
I currently do not reproduce it, it is working fine on my laptop.
Could you create a repository where the issue is reproducible, describe the steps to reproduce the issue using the repo and expose the repo on github please ?
Give me an access also so I can see by myself.
I guess that this is not related to repository, because I tried on few different projects, and I also created dummy customLabel file with only few labels and it didn't work too. Maybe its because of node version? I had to update node to be able to use this plugin, so I installed sfdx cli using npm and updated node to version v15.8.0 I'm not sure what else could have impact on this functionality, let me know if any other data from my env would be helpful
@osieckiAdam separating the cli from npm is a good thing. The sfdx CLI comes with its own npm install if no install are available, which is not convenient for plugin developed using a more recent version of npm.
My point here is to be able to reproduce it on my laptop using a repository you could build just to isolate the issue you are experiencing.
If I reproduce it using the repository and the steps provided then I'll be able to see the issue.
If I do not reproduce it then maybe there is something in the environment of execution.
@osieckiAdam @arafesthain I've tried to reproduce the issue with @scolladon and did not manage to.
Would you be able to provide us with detailed repro steps on a sample github repo?
Hi there @mehdisfdc
I didnt tried to reproduce yet but dont see any error here.
Repo:
https://github.com/osieckiAdam/sgd-dummy
We have 2 branches here. The only difference between branches is CustomLabel file (https://github.com/osieckiAdam/sgd-dummy/compare/master...sgd-test)
I'm using command:
sfdx sgd:source:delta -f master -t sgd-test
package.xml file in output folder looks like:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>50.0</version>
</Package>
node:
v15.8.0
Hi @osieckiAdam !
Thanks for the repro repos and steps
Context :
$ uname -v ; yarn -v ; node -v ; git --version ; sfdx --version ; sfdx plugins
Darwin Kernel Version 18.7.0: Tue Jan 12 22:04:47 PST 2021; root:xnu-4903.278.56~1/RELEASE_X86_64
1.22.10
v15.9.0
git version 2.30.1
sfdx-cli/7.86.3 darwin-x64 node-v15.9.0
sfdx-git-delta 4.2.1
Repro steps :
$ mkdir temp && cd $_
$ git clone https://github.com/osieckiAdam/sgd-dummy.git sgd-dummy && cd $_
$ git fetch -pPt
$ git check sgd-test
$ git checkout master
$ git diff master sgd-test
diff --git a/force-app/main/default/labels/CustomLabels.labels-meta.xml b/force-app/main/default/labels/CustomLabels.labels-meta.xml
index a221b20..60f5918 100644
--- a/force-app/main/default/labels/CustomLabels.labels-meta.xml
+++ b/force-app/main/default/labels/CustomLabels.labels-meta.xml
@@ -1,110 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata">
- <labels>
- <fullName>AddToCart</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Add to cart</shortDescription>
- <value>Add to cart CHANGED</value>
- </labels>
- <labels>
- <fullName>Asterisk</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Asterisk</shortDescription>
- <value>*</value>
- </labels>
- <labels>
- <fullName>Asterisk2</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Asterisk2</shortDescription>
- <value>*2</value>
- </labels>
- <labels>
- <fullName>Asterisk3</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Asterisk2</shortDescription>
- <value>*3</value>
- </labels>
- <labels>
- <fullName>Available_Items</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Available Items</shortDescription>
- <value>available Items</value>
- </labels>
- <labels>
- <fullName>AverageUsersRating</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Average user's rating:</shortDescription>
- <value>Average user's rating:</value>
- </labels>
- <labels>
- <fullName>BasedOn</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>(based on</shortDescription>
- <value>/5 (based on</value>
- </labels>
- <labels>
- <fullName>BuyNow</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Buy now</shortDescription>
- <value>Buy now</value>
- </labels>
- <labels>
- <fullName>By_clicking_on_icon_below</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>By clicking on icon below:</shortDescription>
- <value>By clicking on icon below:</value>
- </labels>
- <labels>
- <fullName>Cancel</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Cancel</shortDescription>
- <value>Cancel</value>
- </labels>
- <labels>
- <fullName>Close</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Close</shortDescription>
- <value>Close</value>
- </labels>
- <labels>
- <fullName>Close_window</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Close window</shortDescription>
- <value>Close window</value>
- </labels>
- <labels>
- <fullName>CompanyName</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>CompanyName</shortDescription>
- <value>Company Name</value>
- </labels>
- <labels>
- <fullName>Contact</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Contact</shortDescription>
- <value>Contact</value>
- </labels>
- <labels>
- <fullName>ContactMeIfAvailable</fullName>
- <language>en_US</language>
- <protected>true</protected>
- <shortDescription>Contact me if available</shortDescription>
- <value>Contact me if available</value>
- </labels>
<labels>
<fullName>Contact_Us</fullName>
<language>en_US</language>
$ mkdir output
$ sfdx sgd:source:delta -f master -t sgd-test
{
"error": null,
"output": "./output",
"success": true,
"warnings": []
}
$ cat output/package/package.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>50.0</version>
</Package>%
$ cat output/destructiveChanges/destructiveChanges.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>AddToCart</members>
<members>Asterisk</members>
<members>Asterisk2</members>
<members>Asterisk3</members>
<members>Available_Items</members>
<members>AverageUsersRating</members>
<members>BasedOn</members>
<members>BuyNow</members>
<members>By_clicking_on_icon_below</members>
<members>Cancel</members>
<members>Close</members>
<members>Close_window</members>
<members>CompanyName</members>
<members>Contact</members>
<members>ContactMeIfAvailable</members>
<name>CustomLabel</name>
</types>
<version>50.0</version>
</Package>%
$ cat output/destructiveChanges/package.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>50.0</version>
</Package>%
The force-app/main/default/labels/CustomLabels.labels-meta.xml file is changed
The diff shows deletion of custom Label xml entry in the file
So there is nothing to deploy using the package.xml, hence this is why the output/package/package.xml is empty
The output/destructiveChanges/destructiveChanges.xml is populated because it will be used to delete those CustomLabels.
The output/destructiveChanges/package.xml is empty because it is required to deploy the destructiveChanges using sfdx force:mdapi:deploy.
To me it is working as designed, is there an issue somewhere else ? Or maybe I have misunderstood something ?
@scolladon thanks for taking care of it
This is exactly what I want to achieve, steps are totally correct, and Your output is exacly what is expected.
The point is that on my environment the output file ( output/destructiveChanges/destructiveChanges.xml ) is empty:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>50.0</version>
</Package>
This is also true for regular changes (I mean non-destructive), please see following example (I updated repo)
C:\Users\osiec\PERSONAL\PERSONAL>git diff master sgd-test2
diff --git a/force-app/main/default/labels/CustomLabels.labels-meta.xml b/force-app/main/default/labels/CustomLabels.labels-meta.xml
index a221b20..cd3b601 100644
--- a/force-app/main/default/labels/CustomLabels.labels-meta.xml
+++ b/force-app/main/default/labels/CustomLabels.labels-meta.xml
@@ -7,6 +7,13 @@
<shortDescription>Add to cart</shortDescription>
<value>Add to cart CHANGED</value>
</labels>
+ <labels>
+ <fullName>NEW_LABEL</fullName>
+ <language>en_US</language>
+ <protected>true</protected>
+ <shortDescription>NEW LABEL</shortDescription>
+ <value>NEW LABEL</value>
+ </labels>
<labels>
<fullName>Asterisk</fullName>
<language>en_US</language>
C:\Users\osiec\PERSONAL\PERSONAL>mkdir output
C:\Users\osiec\PERSONAL\PERSONAL>sfdx sgd:source:delta -f master -t sgd-test2
{
"error": null,
"output": "./output",
"success": true,
"warnings": []
}
C:\Users\osiec\PERSONAL\PERSONAL>more output\package\package.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>50.0</version>
</Package>
Operating System:
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.19041 N/A Build 19041
Yarn version: 1.22.10
Node version: v15.8.0
sgd version: sfdx-git-delta 4.2.0
git version: 2.28.0.windows.1
Hi @osieckiAdam can you add -d option?
Also can you try with sgd version 4.2.1?
Sure,
this is on 4.2.0:
C:\Users\osiec\PERSONAL\PERSONAL>sfdx sgd:source:delta -f master -t sgd-test2 -d
{
"error": null,
"output": "./output",
"success": true,
"warnings": []
}
C:\Users\osiec\PERSONAL\PERSONAL>more output\force-app\main\default\labels\CustomLabels.labels-meta.xml
<?xml version="1.0" encoding="utf-8"?>
<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata"></CustomLabels>
I updated plugin I tried again:
C:\Users\osiec\PERSONAL\PERSONAL>sfdx plugins:update
warning ..\..\..\package.json: No license field
sfdx-cli: Updating plugins... done
C:\Users\osiec\PERSONAL\PERSONAL>sfdx plugins
osiecki-sfdx-plugins 0.3.0 (link) C:\Users\osiec\Documents\GitHub\osiecki-sfdx-plugins
sfdx-git-delta 4.2.1
C:\Users\osiec\PERSONAL\PERSONAL>sfdx sgd:source:delta -f master -t sgd-test2 -d
{
"error": null,
"output": "./output",
"success": true,
"warnings": []
}
C:\Users\osiec\PERSONAL\PERSONAL>more output\force-app\main\default\labels\CustomLabels.labels-meta.xml
<?xml version="1.0" encoding="utf-8"?>
<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata"></CustomLabels>
Unfortunately result is the same
@scolladon @mehdisfdc reproduced here
```$ git log
commit bf040662ccad2e0a8c874322f5b57858068382ba (HEAD -> sgd-test, origin/sgd-test, origin/HEAD)
Author: Adam Osiecki adam.osiecki@rb.com
Date: Mon Feb 22 23:32:05 2021 +0100
testing sgd plugin
commit 009bc9ad048cd7a2997d92c22f47cb4ce148863d (origin/master)
Author: Adam Osiecki adam.osiecki@rb.com
Date: Mon Feb 22 23:31:15 2021 +0100
init commit
alexis.rafesthain@LYN-L083 MINGW64 ~/Documents/projets/temp (sgd-test)
$ mkdir output
alexis.rafesthain@LYN-L083 MINGW64 ~/Documents/projets/temp (sgd-test)
$ sfdx sgd:source:delta -f master -t sgd-test
{
"error": null,
"output": "./output",
"success": true,
"warnings": []
}
alexis.rafesthain@LYN-L083 MINGW64 ~/Documents/projets/temp (sgd-test)
$ cat output/
destructiveChanges/ package/
alexis.rafesthain@LYN-L083 MINGW64 ~/Documents/projets/temp (sgd-test)
$ cat output/package/package.xml
alexis.rafesthain@LYN-L083 MINGW64 ~/Documents/projets/temp (sgd-test)
$ cat output/destructiveChanges/
destructiveChanges.xml package.xml
alexis.rafesthain@LYN-L083 MINGW64 ~/Documents/projets/temp (sgd-test)
$ cat output/destructiveChanges/destructiveChanges.xml
Version:
$ uname -v ; yarn -v ; node -v ; git --version ; sfdx --version ; sfdx plugins
Windows 10 Professional N 2020-10-23 13:08 UTC
1.22.5
v14.15.0
git version 2.30.0.windows.1
sfdx-cli/7.86.3 win32-x64 node-v14.15.0
@salesforce/sfdx-diff 0.0.6
sfdx-git-delta 4.2.0
```
Also reproduced on 4.2.1
@scolladon the bug is larger than destructive change.
I just commited a diff in a label and there is no label in package.xml and generated output files.
The problem has also been declared by an other project at Modis.
FYI, the environment is different (Ubuntu 18.04 on Azure Pipeline).
I also reproduced on Windows 10
2021-02-23T10:29:58.8079106Z Node version :
2021-02-23T10:29:58.8080544Z + echo 'Node version : '
2021-02-23T10:29:58.8081280Z + node --version
2021-02-23T10:29:59.5241612Z v14.15.5
2021-02-23T10:29:59.5257075Z + echo 'Npm version : '
2021-02-23T10:29:59.5258660Z + npm --version
2021-02-23T10:29:59.5260001Z Npm version :
2021-02-23T10:30:01.6059639Z 6.14.11
2021-02-23T10:30:40.9613006Z You acknowledge and agree that the CLI tool may collect usage information, user environment, and crash reports for the purposes of providing services or functions that are relevant to use of the CLI tool and product improvements.
2021-02-23T10:30:40.9614264Z
2021-02-23T10:30:41.0743470Z This plugin is not digitally signed and its authenticity cannot be verified. Continue installation y/n?: Finished digital signature check.
2021-02-23T10:30:41.4186182Z Installing plugin sfdx-git-delta... yarn add v1.22.10
2021-02-23T10:30:49.1707500Z Installing plugin sfdx-git-delta... info No lockfile found.Installing plugin sfdx-git-delta... [1/4] Resolving packages...Installing plugin sfdx-git-delta... [2/4] Fetching packages...Installing plugin sfdx-git-delta... [3/4] Linking dependencies...Installing plugin sfdx-git-delta... [4/4] Rebuilding all packages...Installing plugin sfdx-git-delta... success Saved lockfile.Installing plugin sfdx-git-delta... success Saved 190 new dependencies.Installing plugin sfdx-git-delta... info Direct dependenciesInstalling plugin sfdx-git-delta... └─ [email protected] plugin sfdx-git-delta... info All dependenciesInstalling plugin sfdx-git-delta... ├─ @oclif/[email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... ├─ [email protected] plugin sfdx-git-delta... └─ [email protected] plugin sfdx-git-delta... Done in 7.73s.Installing plugin sfdx-git-delta... installed v4.2.1
2021-02-23T10:30:49.1712133Z warning sfdx-git-delta > @salesforce/core > jsforce > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
2021-02-23T10:30:49.1713868Z warning sfdx-git-delta > @salesforce/core > jsforce > request > [email protected]: this library is no longer supported
2021-02-23T10:30:50.0462108Z sfdx-git-delta 4.2.1
2021-02-23T10:30:50.1221084Z ##[section]Finishing: Install SGD plugin
@alexmodis when reproducing, are you sure to have pulled the branches master and sgd-test
=>
$ git checkout sgd-test
$ git checkout master
$ git branch
sgd-test
* master
@scolladon yes I'm all fetched, I retried this morning and I confirm I didn't get anything in destructive changes too
Thanks guys, I guess it is somehow related to the running architecture.
We need to keep track of working running environment and non working running environment in order to isolate the root cause of the issue.
My architecture is working :
$ uname -v ; yarn -v ; node -v ; git --version ; sfdx --version ; sfdx plugins
Darwin Kernel Version 18.7.0: Tue Jan 12 22:04:47 PST 2021; root:xnu-4903.278.56~1/RELEASE_X86_64
1.22.10
v15.9.0
git version 2.30.1
sfdx-cli/7.86.3 darwin-x64 node-v15.9.0
sfdx-git-delta 4.2.1
Maybe we will need in the future to have a matrice of non regression testing for OS/npm version/sfdx version at least for the last 2 version for sfdx and npm
We plan to start using delta deployments since our project grew big and I recommended SGD to my team. Unfortunately, I also encountered the same problem reported by people in this thread.
Steps to reproduce are simple:
OS: Windows 10
Node: v14.15.5
sfdx-cli/7.89.2 win32-x64 node-v14.15.5
sfdx-git-delta 4.2.2
@scolladon do you expect to have this issue resolved anytime soon? Can we do anything to help in the process? Thanks.
Hi @bakilasek !
Currently I cannot reproduce on my laptop.
But your message makes me think the issue occurs on Windows architecture.
I'll try to reproduce it on a windows machine asap
Hi @bakilasek
Could you detail the command lines executed exactly ?
And also what is the shell you are using to execute those commands ?
@scolladon I see that this is exactly the same issue as we already managed to reproduce, You can check commands in my and @alexmodis comments
Thanks @osieckiAdam ! You're right.
I would like to know what kind of shell on windows is used to generate this issue ? Is it Powershell ? Git bash ? Commands ? Cygwin ? Other ?
I wonder if there is different result depending the shell executing the command 🤔
I currently cannot test it because I do not have access to Windows machine and I need to have access in order to debug the issue in order to fine the root cause.
@scolladon nice catch ! :) 🍾
Thanks !
A new patch is just release ! 🍾 🎊
v4.2.3
Guys I don't want to be a wet blanket here, but it is still failing for me :/ I get the 4.2.3 version. There is no CustomLabel markup in package.xml and CustomLabels.labels-meta.xml is empty as it used to be:
I tried in Powershell, Cygwin and Windows Command Line
Hi @osieckiAdam !
I'm very sad to ear that...
Are you able to reproduce using the branch issue/47 of this repository : https://github.com/scolladon/sfdx-git-delta-reproduction-playground/tree/issue/47 ?
$ mkdir myoutput
$ sfdx sgd:source:delta -f "HEAD~1" -d -o myoutput
$ sfdx sgd:source:delta -f "HEAD~2" -t "HEAD~1" -d -o myoutput
@scolladon sorry, but I'm not able to clone this repo, GithubDesktop is showing following message:
Cloning into 'C:\Users\osiec\Downloads\sfdx-git-delta-reproduction-playground-master\sfdx-git-delta-reproduction-playground-master\sgd\sfdx-git-delta-reproduction-playground'...
remote: Enumerating objects: 51, done.
remote: Counting objects: 100% (51/51), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 51 (delta 7), reused 50 (delta 6), pack-reused 0
Receiving objects: 100% (51/51), 5.35 KiB | 1.07 MiB/s, done.
Resolving deltas: 100% (7/7), done.
error: invalid path '.gitattributes '
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
I sucessfully clone the repository using git command line directly.
Could you test it using the command line ?
If it does not work I will remove the gitattributes file
Hi @scolladon. Unfortunately, I can confirm what @osieckiAdam already reported. This bug still persists in 4.2.3 :/
I cloned the repository mentioned by you Sebastien using Sourcetree and I know why you can't reproduce this issue using that repository.
In order to reproduce the issue you need to have already that file "\sgd\reproduction\playground\labels\CustomLabels.labels-meta.xml" in master branch. Please make sure both branches you use to generate delta have that file already. And only then in one branch change content of the file modifying the value of existing label.
/EDIT
Sorry Sebastien, I just read your previous comment where you explained that you were using only issue/47 and commits from that branch to reproduce, so please ignore my paragraph above where I was talking about comparing to master. Nonetheless, I can attest that I was able to reproduce the issue on Windows using your repository.
/EDIT
Steps to reproduce using your repository:
Hope these steps will help you pinpoint the problem. Thanks!
@scolladon Excuse me using commit hash, but I want to be precise. Using only that branch issue/47 from your repository I have noticed the following issue:

But running sgd with the exact same SHA...
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Test</members>
<members>OtherTest</members>
<name>CustomLabel</name>
</types>
<version>50.0</version>
</Package>
But in reality there was only one custom label at that point in time (SHA). There couldn't be "OtherTest" yet at that time (SHA=c582996623b97d1e16c77c9c45dd751a4ed71174) because it was added later with another/future commit.
I took SHA from this page: https://github.com/scolladon/sfdx-git-delta-reproduction-playground/commits/issue/47
Isn't that strange? Do you observe similar issue on your machine?
Hi @bakilasek !
Thanks for the very precise investigation.
It helped me a lot to investigate.
I think I see the root cause of the issue now.
When the --to parameter git commit pointer (SHA, tag, branch, git formula, etc) is not the HEAD, well... the files in the file system and in the --to SHA are not the same right 😄
So all the parsing of the file in the addition case was done using the current file in the repository... Not the one in the referred commit...
To fix it I apply the same method as for the "Modification".
We may have lost a little bit of performance because now instead of converting a file to json we call git and parse its output using regex.
If this is an issue later for very big file we can have another approach using git revert before converting the file into a json and git checkout after to put the previous version of the file back.
@scolladon It seems like we have exactly the same issue with Sharing Rules, keeping my fingers crossed so that this fix will also work for them!
You're right, the issue is here for every "inFile" metadata types.
Hence the fix will apply to all of them :)
Hi @scolladon
First and foremost thanks for an awesome plugin!
With the newest version 4.3.1 it seems like the issue still persists.
My architecture is the following, very simiarly built from a Dockerfile by medhi, which you reference in the sgd documentation:
uname -v ; yarn -v : node -v ; git --version ; sfdx --version ; sfdx plugins
1 SMP Wed Oct 28 23:40:43 UTC 2020
1.22.5
git version 2.24.4
sfdx-cli/7.96.0 linux-x64 node-v15.12.0
sfdx-git-delta 4.3.1
My project content is this:

The difference between two commits is:
When I use the sfdx sgd:source:delta --to $latestCommitHashOfDevelopmentBranch --from $latestCommitHashOfCurrentBranch, the resulting package.xml file is the following:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Set_Description_on_New_Cases</members>
<name>Flow</name>
</types>
<version>51.0</version>
</Package>
It doesn't contain the custom label file, which I had hoped for.
Hi @nickytorstensson
Thanks for reopening it as it is not fixed yet. Sorry for the inconvenience.
Thanks also for the detailed steps. It is weird, I thought this use case was handled by the fix...
I'll try find times this week-end to look at it
Most helpful comment
hey, it seems like this issue came back, steps to reproduce are exactly the same