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

[Labels Directory] CustomLabel file doesn't contains label changes #47

Closed
1 task done
arafesthain opened this issue Jul 29, 2020 · 55 comments · Fixed by #48, #110, #114 or #161
Closed
1 task done

[Labels Directory] CustomLabel file doesn't contains label changes #47

arafesthain opened this issue Jul 29, 2020 · 55 comments · Fixed by #48, #110, #114 or #161
Assignees
Labels
bug Something isn't working

Comments

@arafesthain
Copy link
Contributor

arafesthain commented Jul 29, 2020

Issue verification check :

  • does the current repository is fully deployable at the commit sha given to the from parameter of the command ?

What is the problem

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&apos;opération est impossible car le compte n&apos;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&apos;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&apos;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&apos;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&apos;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&apos;insertion ligne travaux statut devis</shortDescription>
-        <value>Vous ne pouvez pas ajouter cette ligne de travaux car le devis associé à l&apos;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&apos;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&apos;envoi du devis</shortDescription>
-        <value>You can&apos;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&apos;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&apos;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&apos;t Find</shortDescription>
-        <value>Source record wasn&apos;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&apos;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&apos;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&apos;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&apos;emplacement sélectionné</shortDescription>
-        <value>Vous ne pouvez pas utiliser ce produit pour l&apos;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&apos;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&apos;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&apos;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&apos;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&apos;emplacement sélectionné n&apos;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>

What is parameter and their value you used

sgd -d -t HEAD -f origin/master -r . -o output/
and for git :
git diff --no-renames origin/master HEAD

What is the expected result

Custom labels file contains all diff.

What is the actual result

Custom labels file is empty

Steps to reproduce

Make change in customLabels file and see empty sgd output file

Execution context

Operating System:
Windows 10
NPM version:
6.14.5
Node version:
v13.12.0
sgd version:
3.3.0

@arafesthain arafesthain added the bug Something isn't working label Jul 29, 2020
@scolladon
Copy link
Owner

Hi @arafesthain

Thanks for this issue !
Is it reproducible with the version 3.2.0 ?

@arafesthain
Copy link
Contributor Author

Hi @scolladon
Same error in 3.2 :)

@osieckiAdam
Copy link

hey, it seems like this issue came back, steps to reproduce are exactly the same

@scolladon
Copy link
Owner

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

@osieckiAdam
Copy link

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

@scolladon
Copy link
Owner

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.

@osieckiAdam
Copy link

osieckiAdam commented Feb 18, 2021

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

@scolladon
Copy link
Owner

@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.

@scolladon scolladon added the reproduction steps needed Need reproduction steps to further with the analysis label Feb 22, 2021
@mehdicherf
Copy link
Collaborator

@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?

@alexmodis
Copy link

Hi there @mehdisfdc
I didnt tried to reproduce yet but dont see any error here.

@osieckiAdam
Copy link

osieckiAdam commented Feb 22, 2021

Repo:
https://github.com/osieckiAdam/sgd-dummy
We have 2 branches here. The only difference between branches is CustomLabel file (osieckiAdam/sgd-dummy@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

@scolladon
Copy link
Owner

scolladon commented Feb 23, 2021

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&apos;s rating:</shortDescription>
-        <value>Average user&apos;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 ?

@osieckiAdam
Copy link

osieckiAdam commented Feb 23, 2021

@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

@alexmodis
Copy link

alexmodis commented Feb 23, 2021

Hi @osieckiAdam can you add -d option?
Also can you try with sgd version 4.2.1?

@osieckiAdam
Copy link

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

@alexmodis
Copy link

alexmodis commented Feb 23, 2021

@scolladon @mehdisfdc reproduced here

commit bf040662ccad2e0a8c874322f5b57858068382ba (HEAD -> sgd-test, origin/sgd-test, origin/HEAD)
Author: Adam Osiecki <[email protected]>
Date:   Mon Feb 22 23:32:05 2021 +0100

    testing sgd plugin

commit 009bc9ad048cd7a2997d92c22f47cb4ce148863d (origin/master)
Author: Adam Osiecki <[email protected]>
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
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <version>50.0</version>
</Package>
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
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <version>50.0</version>
</Package>

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

@alexmodis
Copy link

alexmodis commented Feb 23, 2021

@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

@scolladon
Copy link
Owner

@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

@alexmodis
Copy link

@scolladon yes I'm all fetched, I retried this morning and I confirm I didn't get anything in destructive changes too

@scolladon
Copy link
Owner

scolladon commented Feb 24, 2021

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

@bakilasek
Copy link

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:

  1. In master branch I have \main\default\labels\CustomLabels.labels-meta.xml file with custom labels.
  2. I create branch from master, let's call it develop.
  3. While in develop branch, I change the value of some existing custom label and commit this change.
  4. git diff master...develop shows accurately the change from step 3.
  5. sfdx sgd:source:delta -t develop -f master ends with success message
  6. generated package.xml is empty :(

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.

@scolladon
Copy link
Owner

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

@scolladon scolladon removed the reproduction steps needed Need reproduction steps to further with the analysis label Mar 12, 2021
@scolladon
Copy link
Owner

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.

@osieckiAdam
Copy link

@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!

@scolladon
Copy link
Owner

You're right, the issue is here for every "inFile" metadata types.
Hence the fix will apply to all of them :)

@nickytorstensson
Copy link

nickytorstensson commented Apr 9, 2021

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:
image

The difference between two commits is:

  • Added new file: Custom Labels file, which contains 1 label
  • Changed existing file: Existing flow.

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.

@scolladon
Copy link
Owner

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

@scolladon scolladon reopened this Apr 11, 2021
@scolladon
Copy link
Owner

Hi !

I tried to reproduce the issues in the reproduction playground branch issue/47 from the description.
But I did not reproduce the behaviour.

@nickytorstensson Is there anything I miss? Could help me reproduce either by driving me to the right set up or by creating another PR on the reproduction playground to isolate the issue so I can debug it, please?

My architecture

$ 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
v14.16.0
git version 2.31.1
sfdx-cli/7.94.3 darwin-x64 node-v14.16.0
sfdx-git-delta 4.3.1

@nickytorstensson
Copy link

Hi @scolladon
I tried to replicate my issue, but I found that I have other own issues with getting the right commit hash to compare with (which of course is a prerequisite).
I did succeed a few times in getting the Custom Label included in the package.xml, so I presume it is working as expected. As I am unable to replicate my issue consistently, do go ahead again and close off the bug.

I apologize for the inconvenience. Again, great plugin, keep up the good work.

@scolladon
Copy link
Owner

Hi @nickytorstensson!

No problem at all! Thank you for your contribution and your time spent to make this plugin better!
Feel free to raise any concern/issue/question/enhancement request :)

Thanks for your appreciation of the plugin!

@AltiusRupert
Copy link

You're right, the issue is here for every "inFile" metadata types.
Hence the fix will apply to all of them :)

Hi @scolladon , could you define an "inFile metadata type", please ?

@scolladon
Copy link
Owner

Hi @AltiusRupert !

Sure, inFile metadata type are metadata type which are contained in a file and do not have their own file.

Per exemple WorkflowFieldUpdate metadata type do not have its own file, it is contained in the Workflow file in a dedicated xml element.

There are a few other element like this one (CustomLabel, SharingRule, Workflow, PermissionSet and Profile)

@AltiusRupert
Copy link

@scolladon Is there any way to find/query a complete list of these ?
It would make browsing the Metadata Coverage Report easier for beginners on this subject ...

@scolladon
Copy link
Owner

I think it is in the Metadata API documentation, meaning when you browse to workflow per example you will see the definition of contained metadata element.
But not sure it is referenced as "inFile" element in the documentation.

"inFile" is more a category we created in this plugin to treat those element the same way.

@welhorr
Copy link

welhorr commented Jun 30, 2021

@scolladon , we are facing the same issue, but only when adding new custom labels (not editing existing ones) to the file CustomLabels.labels-meta.xml.

This is working fine:

  1. Create a new branch from Master. Let's call it develop.
  2. Checkout branch develop.
  3. Edit the sfdx/main/default/labels/CustomLabels.labels-meta.xml file by only editing the description of an existing customer label named LABEL1
  4. Commit changes.
  5. In Jenskins run: sfdx sgd:source:delta -t LASTCOMMITIDINDEVELOPER -f PREVIOUSSUCCESSCOMMITID creates the below package.xml and deployment happens without any issue.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>LABEL1</members>
        <name>CustomLabel</name>
    </types>
    <version>50.0</version>
</Package>

Now, if we add a new custom label to the file sfdx/main/default/labels/CustomLabels.labels-meta.xml, for example:

<labels>
        <fullName>WALTEST</fullName>
        <language>en_US</language>
        <protected>false</protected>
        <shortDescription>WALTEST</shortDescription>
        <value>WALTEST</value>
</labels>

And then we do the exact same step above, we get an empty package.xml file and the deployment fails.

Note that the customLabels file has more than 40k lines.

Thanks.

@scolladon
Copy link
Owner

Hi @welhorr !

Let's reopen the issue !

Could you provide more information about the context of the issue :

# execute this command
$ uname -v ; yarn -v ; node -v ; git --version ; sfdx --version ; sfdx plugins

Operating System:
yarn version:
node version:
git version:
sfdx version:
sgd plugin version:

Then would it be possible to create a reproduction branch with the minimum content (obfuscated/anonymised) required to reproduce, in the reproduction playground repository so we can work in the same condition ?

@scolladon scolladon reopened this Jul 1, 2021
@welhorr
Copy link

welhorr commented Jul 1, 2021

Thanks a lot @scolladon,
Please find the output below:

Operating System: #49~18.04.1-Ubuntu SMP Thu Apr 22 21:28:54 UTC 2021
yarn version: 1.22.5
node version: v14.14.0
git version: git version 2.24.4
sfdx version: sfdx-cli/7.103.0 linux-x64 node-v14.14.0
sgd plugin version: 4.5.0

I could not create a branch from the reproduction playground repository. Can you please let me know how to do so?

@scolladon
Copy link
Owner

@welhorr you should be able to create branch by forking the repository.

Also you should retry using the latest version of the plug-in (4.6.1), just to be sure

@welhorr
Copy link

welhorr commented Jul 1, 2021

Will do thanks @scolladon .
How do we update the plugin?

@scolladon
Copy link
Owner

Using sfdx command:

$ sfdx plugins:update

@welhorr
Copy link

welhorr commented Jul 1, 2021

Thanks @scolladon , we will try to update and get back to you.
I created the branch with the label folder and the CustomLabels.labels-meta.xml file in it. Please let me know if you can see it.

@welhorr
Copy link

welhorr commented Jul 5, 2021

@scolladon is this a known issue now? When do you think it will get fixed?

@scolladon
Copy link
Owner

@welhorr yes, thanks to your reproduction scenario we have been able to identify the root cause.

There is a pull request related to this issue. It will be reviewed this week and included in the next release.

We will keep you posted !

@scolladon
Copy link
Owner

Hi @welhorr !

New version 4.7 (released today) is more robust to large files !
Let us know if everything run smoother now.

And feel free to raise any other issue and contribute to make this plugin better

Repository owner locked as resolved and limited conversation to collaborators Jul 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.