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

sfdx force:source:retrieve is adding fields with the same name as the object at the top level of the object folder. #638

Closed
ameliaclarke opened this issue Sep 25, 2020 · 5 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@ameliaclarke
Copy link

Summary

sfdx force:source:retrieve using manifest is changing the structure when components (eg. fields or record types) have the same name as the object.

Steps To Reproduce:

  1. Ensure Custom Object Task is named in the package.xml alternatively create an object with a field that has the same name as the object.
  2. Retrieve using sfdx force:source:retrieve --targetusername <org-alias> --manifest manifest/package.xml

Expected result

Objects should have fields and recordTypes folders with the component in the appropriate folder

Actual result

Components that have the same name as the object are added to the top level of the object folder.

Additional information

image

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):

sfdx-cli/7.74.1-32db2396ed darwin-x64 node-v12.18.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.0 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/lwc-dev-server 2.5.1
├─ @oclif/plugin-help 2.2.3
└─ @oclif/plugin-update 1.3.9
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.1 (core)
analytics 1.12.1 (core)
config 1.1.8 (core)
generator 1.1.3 (core)
salesforce-alm 49.3.1-4 (mpd)
salesforcedx 49.10.0 (core)
├─ apex 0.0.9 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
├─ templates 49.4.4 (core)
└─ custom-metadata 1.0.10 (core)
sfdx-cli 7.74.1 (core)

OS and version:

macOS Catalina
Version 10.15.6 
@ameliaclarke ameliaclarke changed the title SFDX retrieve is adding fields with the same name as the object at the top level of the object folder. sfdx force:source:retrieve is adding fields with the same name as the object at the top level of the object folder. Sep 25, 2020
@shetzel
Copy link
Contributor

shetzel commented Sep 29, 2020

This should be fixed with the patch release this Thursday. If you provide example contents of the manifest I can verify the fixes. I created a CustomObject, field, and record type of "MyFoo" and retrieved using a manifest that only contained the field (usecase 1) and just the custom object (usecase 2) and it worked as expected.

@the-last-byte
Copy link

Hi @shetzel!

I've just experienced this error. I've create a reproduction on github:
https://github.com/the-last-byte/forcedotcom-issue-638-repro

Hope this helps!

@HamishBuckley
Copy link

Hi @shetzel
Hi have done some futher testing, this bug only happens if the metadata is being updated, it won't happen the first time you do a retrieve.

image

As you can see on the second run, the MyFoo__c.field-meta.xml is created in the objects folder not the fields folder.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):

sfdx-cli/7.80.0-b979aae708 darwin-x64 node-v12.18.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.1 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/lwc-dev-server 2.6.0
├─ @oclif/plugin-help 2.2.3
└─ @oclif/plugin-update 1.3.10
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.3 (core)
analytics 1.12.1 (core)
auth 1.3.0 (core)
config 1.1.11 (core)
generator 1.1.3 (core)
salesforcedx 50.5.0 (core)
├─ schema 1.0.1 (core)
├─ custom-metadata 1.0.10 (core)
├─ apex 0.1.2 (core)
├─ templates 50.1.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 50.5.0 (core)

OS and version:
macOS Catalina
Version 10.14.6

@shetzel
Copy link
Contributor

shetzel commented Nov 18, 2020

@HamishBuckley @the-last-byte - Yes, I'm seeing now too. Someone is actively working on the fix. Thanks for the extra info!

@clairebianchi clairebianchi added the bug Issue or pull request that identifies or fixes a bug label Dec 1, 2020
@uip-robot-zz
Copy link

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

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
Projects
None yet
Development

No branches or pull requests

7 participants