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

force:source:pull fails because of custom labels #1317

Closed
fenixjke opened this issue Dec 9, 2021 · 7 comments
Closed

force:source:pull fails because of custom labels #1317

fenixjke opened this issue Dec 9, 2021 · 7 comments
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue

Comments

@fenixjke
Copy link

fenixjke commented Dec 9, 2021

Summary

sfdx force:source:pull works incorrectly because of custom labels, fullName of whose can be treated as booleans

Prerequisites

  1. Dev Hub created
  2. Standard sfdx project created without metadata
  3. Scratch org created

Steps To Reproduce

  1. Open scratch org
  2. Create custom label and populate "true" value in the required fields
  3. Create custom label and populate "false" value in the required fields
  4. Perform sfdx force:source:pull in sfdx project
  5. Validate the custom labels are retrieved
  6. Open scratch org
  7. Create custom label and populate "another" value in the required fields
  8. Perform sfdx force:source:pull in sfdx project

Expected result

Pull should retrieve metadata

Actual result

Exception occurs "ERROR running force:source:pull: fullName.trim is not a function"

System Information

CLI Version :
sfdx-cli/7.129.0

Architecture:
darwin-x64

Node Version :
node-v16.13.0

Plugin Version:
@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.3 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.1 (core)
@oclif/plugin-update 1.5.0 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
@salesforce/sfdx-scanner 2.12.0
alias 1.1.22 (core)
apex 0.3.0 (core)
auth 1.7.6 (core)
config 1.2.48 (core)
custom-metadata 1.0.12 (core)
data 0.6.5 (core)
generator 1.2.1 (core)
limits 1.2.3 (core)
org 1.9.2 (core)
salesforce-alm 53.4.5 (core)
schema 1.0.10 (core)
sfdx-cli 7.129.0 (core)
source 1.5.3 (core)
telemetry 1.3.0 (core)
templates 52.6.0 (core)
trust 1.0.10 (core)
user 1.5.3 (core)

OS and Version:
Darwin 20.6.0

Additional information

Exception:
image_1340291505

It seems like the issue is in the nonDecomposedElementsIndex.json file
Other fullNames of custom labels has string type, but the custom label with fullName "true" becomes boolean in that file
The custom label with fullName equals to "false" isn't reflected in that file at all
image_1340291506

@fenixjke fenixjke added the investigating We're actively investigating this issue label Dec 9, 2021
@github-actions
Copy link

github-actions bot commented Dec 9, 2021

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@mshanemc
Copy link
Contributor

mshanemc commented Dec 9, 2021

We're replacing all of that code for pull with what's in the new source:beta

Can you try using that to see if the error is the same?

@mshanemc mshanemc added the more information required Issue requires more information or a response from the customer label Dec 9, 2021
@fenixjke
Copy link
Author

source:beta:pull retrieved such custom labels without errors. However it's not something which is ready to be used in production workflows, is it correct?

@no-response no-response bot removed the more information required Issue requires more information or a response from the customer label Dec 14, 2021
@fenixjke
Copy link
Author

One observation. If I repeat source:beta:pull after it's already executed the result of the command execution still says the metadata is created. Using source:pull version it says that there is nothing to retrieve. Is this behavior expected?
n

@mshanemc
Copy link
Contributor

Oh, nice catch on source:beta.

Did you change the label on the server in between, then pull again, and you're saying it should say Updated? OR did it pull the change the first time, and then think the change needed to be pulled again.

@mshanemc mshanemc added the more information required Issue requires more information or a response from the customer label Dec 14, 2021
@fenixjke
Copy link
Author

In the previous example I executed the command sequentially, without making changes in the custom labels in my scratch
In this situation I expected that CustomLabels should be considered as unchanged and should be skipped in "pull" call

I made one more test when I changed custom labels between the source:pull executions and the information in the console for the second execution still says Created but I expected Updated.

@no-response no-response bot removed the more information required Issue requires more information or a response from the customer label Dec 14, 2021
@WillieRuemmele WillieRuemmele added the bug Issue or pull request that identifies or fixes a bug label Dec 16, 2021
@uip-robot-zz
Copy link

This issue has been linked to a new work item: W-10322335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

4 participants