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

Separate each Custom Label entry on its own file when working with the "Source" format #1159

Closed
AllanOricil opened this issue Aug 30, 2021 · 5 comments
Labels
custom-registry feature Issue or pull request for a new feature

Comments

@AllanOricil
Copy link

AllanOricil commented Aug 30, 2021

Is your feature request related to a problem? Please describe.
Yes, it is really hard to track changes in the Custom Labels metadata file while reviewing PRs in any Git tool. It is hard to read changes in XML files in general.

What are you trying to do
Achieve better DX by improving the way we track changes to Custom Labels in GIT tools. This will reduce errors and will cut down time while reviewing PRs with Custom Labels changes.

Describe the solution you'd like
Separate each Custom Label entry on its own file when working with the "Source" format

This

<?xml version="1.0" encoding="UTF-8"?>
<CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata">     
    <labels>
        <fullName>MyLabelApiName1</fullName>
        <categories>Community</categories>
        <language>en_US</language>
        <protected>false</protected>
        <shortDescription>MyLabelApiName1</shortDescription>
        <value>MyLabelApiName1</value>
    </labels>
    <labels>
        <fullName>MyLabelApiName2</fullName>
        <categories>Community</categories>
        <language>en_US</language>
        <protected>false</protected>
        <shortDescription>MyLabelApiName2</shortDescription>
        <value>MyLabelApiName2</value>
    </labels>
</CustomLabels>

Would become something like this

image

Describe alternatives you've considered

Right now every developer is appending new labels to the end of the file to make PR reviews easier and faster. This way we can clearly see what has been changed while reviewing PRs.

Additional context
It is impossible to review PRs when working with packages, such as Vlocity, that creates an enourmous number of Custom Labels. Git shows some labels were removed just because they moved down some lines, which is not true. This can lead to lots of errors.

image

@AllanOricil AllanOricil added the feature Issue or pull request for a new feature label Aug 30, 2021
@github-actions
Copy link

Thank you for filing this feature request. We appreciate your feedback and will review the feature at our next grooming or sprint planning session. We prioritize feature requests with more upvotes and comments.

@uip-robot-zz
Copy link

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

@AllanOricil AllanOricil changed the title Make each Custom Label to be in a separate file when working in Source format Separate each Custom Label entry on its own file when working with the "Source" format Feb 24, 2022
@AllanOricil
Copy link
Author

AllanOricil commented Mar 2, 2023

@mshanemc
couldn't this be a built in pre deploy|push|versio creation|retrieve hook in sfdx?
Sfdx could support separate xml files for each label when working with the source format. And before running any of those commands, sfdx would create a "CustomLabels.xml" joining the separate files that are in the labels folder. When retrieving custom labels, sfdx would retrieve it as a whole, and then break it into separate files, one for each custom label.

Custom Labels are versioned as separate files

labels
    a.xml
    b.xml

While running sfdx comamnds, the CustomLabels.xml file would be generated joining a.xml and b.xml files

labels
    CustomLabels.xml

@AllanOricil
Copy link
Author

This can help to avoid mistakes when reviewing diffs in xml files
https://marketplace.visualstudio.com/items?itemName=semanticdiff.semanticdiff

@mshanemc
Copy link
Contributor

Related discussion: #2544

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
custom-registry feature Issue or pull request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants