cli icon indicating copy to clipboard operation
cli copied to clipboard

Labels are out of the default folder

Open antonsatskyi opened this issue 3 years ago • 11 comments

Summary

for some reason, labels are out of the default folder

on a simple retrieve sfdx force:source:retrieve -n W-001022 -u DEV

sfdx-cli/7.180.0 darwin-x64 node-v18.12.1

Steps To Reproduce:

  1. This is step 1. sfdx force:source:retrieve -n W-001022 -u DEV

Expected result

all items are in project folder

Actual result

labels folder is outside of main project folder

System Information

MACOS

  • Which shell/terminal are you using? (e.g. bash, zsh, powershell 5, powershell 7, cmd.exe, etc.) SHELL=/bin/zsh
  • If you are using sfdx
    • Run sfdx version --verbose --json { "cliVersion": "sfdx-cli/7.180.0", "architecture": "darwin-x64", "nodeVersion": "node-v18.12.1", "pluginVersions": [ "@oclif/plugin-autocomplete 1.3.7 (user)", "@oclif/plugin-commands 2.2.1 (user)", "@oclif/plugin-help 5.1.20 (user)", "@oclif/plugin-not-found 2.3.9 (user)", "@oclif/plugin-plugins 2.1.8 (user)", "@oclif/plugin-search 0.0.4 (user)", "@oclif/plugin-update 3.0.8 (user)", "@oclif/plugin-version 1.1.3 (user)", "@oclif/plugin-warn-if-update-available 2.0.16 (user)", "@oclif/plugin-which 2.2.3 (user)", "@salesforce/cli 1.58.1 (user)", "alias 2.1.10 (core)", "apex 1.3.0 (core)", "auth 2.3.0 (core)", "community 2.0.18 (core)", "config 1.4.22 (core)", "custom-metadata 2.0.5 (core)", "data 2.1.13 (core)", "deploy-retrieve 1.6.16 (user)", "env 1.5.14 (user)", "functions 1.16.1 (user)", "generate 1.0.33 (user)", "generator 2.0.12 (core)", "info 2.2.11 (user)", "limits 2.1.2 (core)", "login 1.1.12 (user)", "org 2.2.15 (core)", "packaging 1.10.9 (core)", "schema 2.1.17 (core)", "settings 1.1.10 (user)", "signups 1.2.12 (core)", "sobject 0.0.33 (user)", "source 2.3.7 (core)", "telemetry 2.0.5 (user)", "templates 55.1.0 (core)", "trust 2.1.0 (user)", "user 2.1.21 (core)", "@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)", "@salesforce/sfdx-scanner 3.7.1 (user)", "salesforce-alm 54.8.4 (core)", "sfdx-git-delta 5.8.0 (user)" ], "osVersion": "Darwin 22.1.0", "shell": "zsh", "rootPath": "/Users/Anton_Satskyi/.local/share/sfdx/client/7.180.0-d902059" }
  • If you are using sf
    • Run sf version --verbose --json
  • Paste the output here

Additional information

Feel free to attach a screenshot. image

antonsatskyi avatar Dec 14 '22 14:12 antonsatskyi

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.

github-actions[bot] avatar Dec 14 '22 14:12 github-actions[bot]

Hello, Same issue in different project/company/SF instance.

for some reason command(retrieve permissionSet with sfdx) sfdx force:source:retrieve -n testchangesetvs -u company--dev is creating additional/reduntant testchangesetvs/testchangesetvs/ directory for CustomLabels metadata type.

user@COMPUTER company % sfdx force:source:retrieve -n testchangesetvs -u company--dev
Preparing retrieve request... done
=== Retrieved Source

 FULL NAME                              TYPE          PROJECT PATH                                                                                      
 ────────────────────────────────────── ───────────── ───────────────────────────────────────────────────────────────────────────────────────────────── 
 Account.Broadband_Contract_End_Date__c CustomField   testchangesetvs/main/default/objects/Account/fields/Broadband_Contract_End_Date__c.field-meta.xml 
 Account.Broadband_Current_Supplier__c  CustomField   testchangesetvs/main/default/objects/Account/fields/Broadband_Current_Supplier__c.field-meta.xml  
 Account.Fibre_Current_Supplier__c      CustomField   testchangesetvs/main/default/objects/Account/fields/Fibre_Current_Supplier__c.field-meta.xml      
 Account.Fibre_Interest__c              CustomField   testchangesetvs/main/default/objects/Account/fields/Fibre_Interest__c.field-meta.xml              
 CustomLabels                           CustomLabels  testchangesetvs/testchangesetvs/main/default/labels/CustomLabels.labels-meta.xml                  
 VS_Admin                               PermissionSet testchangesetvs/main/default/permissionsets/Admin.permissionset-meta.xml                       

=== Retrieved Packages

testchangesetvs package converted and retrieved to: /Users/kamilentsua-mensah/Desktop/Repo/company/companyr--sfdx/companyr/testchangesetvs

user@COMPUTER company % tree testchangesetvs                                                 
testchangesetvs
├── main
│   └── default
│       ├── objects
│       │   └── Account
│       │       └── fields
│       │           ├── Broadband_Contract_End_Date__c.field-meta.xml
│       │           ├── Broadband_Current_Supplier__c.field-meta.xml
│       │           ├── Fibre_Current_Supplier__c.field-meta.xml
│       │           └── Fibre_Interest__c.field-meta.xml
│       └── permissionsets
│           └── Admin.permissionset-meta.xml
└── testchangesetvs
    └── main
        └── default
            └── labels
                └── CustomLabels.labels-meta.xml

10 directories, 6 files

Enszula avatar Dec 14 '22 14:12 Enszula

Hey all, thanks for reporting the issue! Did this just start happening on a recent version of the CLI?

iowillhoit avatar Dec 14 '22 22:12 iowillhoit

Hi,

Hello we 'discovered' it today in CICD scripted pipeline which is always updating sfdx to newest version. it's appearing on version: sfdx-cli/7.180.0 i also tried In my local machine and on seconds project/client.

Thanks, Kamil

Enszula avatar Dec 14 '22 22:12 Enszula

Thanks for that info, I will try to replicate it and get back to you.

iowillhoit avatar Dec 14 '22 23:12 iowillhoit

Thank You.

Enszula avatar Dec 14 '22 23:12 Enszula

I am not seeing this locally with 7.180.0. I notice that you are both retrieving with -n (--packagenames). I can do some testing with packages in the morning, but I am curious if either of you able to reproduce this using --sourcepath, --manifest, or --metadata? Thanks!

iowillhoit avatar Dec 14 '22 23:12 iowillhoit

Hello,

  • Yes main issues is it is not working with changeSets (-n option) ((may be related to source format or something? Since this converts changeSet- 'package converted and retrieved' )). It is important because most of ours admins/consultans use change sets(they don't know how to use sfdx, git ...)
  • With manifest(package.xml) and -m metadata worked fine as far as I remember.

Thanks, Kamil

Enszula avatar Dec 14 '22 23:12 Enszula

Thanks for that info, I will try to replicate it and get back to you.

no, it was on 7.17X ver also

antonsatskyi avatar Dec 15 '22 10:12 antonsatskyi

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

git2gus[bot] avatar Jan 01 '23 18:01 git2gus[bot]

Followup: have been working a lot on SDR and how decomposition/recomposition happens.

I'm not confident that we can fix this bug without causing some other problems. I'm going to use this as a test case for the custom-registry work--and you'd end up having each label in its own file like https://github.com/forcedotcom/cli/discussions/2635

mshanemc avatar Feb 22 '24 18:02 mshanemc

Hi @antonsatskyi @Enszula -

I've just confirmed that this is fixed by adding "registryPresets": ["decomposeCustomLabelsBeta"] to your sfdx-project.json. This is using the custom registry presets we just released today. There is a bit of a transition to use them (delete your files locally, re-retrieve them) - but I hope you will do that 😄.

Proof:

using

@salesforce/cli/2.36.7 darwin-arm64 node-v18.18.2

without registry change

  ➜  sf project retrieve start --package-name CL                  
Retrieving v60.0 metadata from [email protected] using the v60.0 SOAP API
Preparing retrieve request... Succeeded

Retrieved Source
========================================================================================================================================================================
| State   Name                                Type                     Path                                                                                              
| ─────── ─────────────────────────────────── ──────────────────────── ─────────────────────────────────────────────────────────────────────────────────────────────────                         
| Created CustomLabels                        CustomLabels             CL/CL/main/default/labels/CustomLabels.labels-meta.xml 

Notice the CL/CL/main

and now

 ➜  sf project retrieve start --package-name CL
Retrieving v60.0 metadata from [email protected] using the v60.0 SOAP API
Preparing retrieve request... Succeeded

Retrieved Source
========================================================================================================================================================================
| State   Name                                Type                     Path                                                                                              
| ─────── ─────────────────────────────────── ──────────────────────── ───────────────────────────────────────────────────────────────────────────────────────────────── 
                    
| Created CustomLabels                        CustomLabels             CL/main/default/labels/CustomLabels/CustomLabels.labels-meta.xml   

it's placed in the correct package path

WillieRuemmele avatar Apr 03 '24 20:04 WillieRuemmele