forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
494 stars 78 forks source link

'project retrieve start' nests duplicate parent folder for custom objects since cli v2.47.6 #2977

Closed readeral closed 3 weeks ago

readeral commented 3 months ago

Summary

Between CLI versions 2.46.6 and 2.47.6 a change has occurred that causes a retrieved package to nest a duplicate of the parent folder within itself when retrieving custom objects, splitting object-meta.xml away from the rest of the metadata.

Folder structure under 2.46.6: Screenshot 2024-07-31 at 10 31 34 AM

Folder structure under 2.47.6 and all subsequent versions of the CLI Screenshot 2024-07-31 at 10 28 28 AM (generated using cli version 2.47.6, see below reproduction for same result generated with the latest CLI release)

Steps To Reproduce

Expected result

Screenshot 2024-07-31 at 11 23 51 AM (example created by running retrieve with cli v2.46.6 installed)

Actual result

Screenshot 2024-07-31 at 11 25 39 AM (example created by running retrieve with cli v2.51.6 installed)

CLI output when retrieving the package:

Retrieved Source
=========================================================================================================================
| State   Name                  Type         Path                                                                         
| ─────── ───────────────────── ──────────── ──────────────────────────────────────────────────────────────────────────── 
| Created Test__c.Completion__c CustomField  TestPackage/main/default/objects/Test__c/fields/Completion__c.field-meta.xml 
| Created Test__c.Status__c     CustomField  TestPackage/main/default/objects/Test__c/fields/Status__c.field-meta.xml     
| Created Test__c               CustomObject TestPackage/TestPackage/main/default/objects/Test__c/Test__c.object-meta.xml 
| Created Test__c-Test Layout   Layout       TestPackage/main/default/layouts/Test__c-Test Layout.layout-meta.xml   

System Information

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.51.6",
  "nodeVersion": "node-v18.16.0",
  "osVersion": "Darwin 23.5.0",
  "rootPath": "/Users/alan/.nvm/versions/node/v18.16.0/lib/node_modules/@salesforce/cli",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.1.7 (core)",
    "@oclif/plugin-commands 4.0.7 (core)",
    "@oclif/plugin-help 6.2.6 (core)",
    "@oclif/plugin-not-found 3.2.11 (core)",
    "@oclif/plugin-plugins 5.3.7 (core)",
    "@oclif/plugin-search 1.2.3 (core)",
    "@oclif/plugin-update 4.4.9 (core)",
    "@oclif/plugin-version 2.2.8 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.9 (core)",
    "@oclif/plugin-which 3.2.8 (core)",
    "@salesforce/cli 2.51.6 (core)",
    "apex 3.2.5 (core)",
    "auth 3.6.36 (core)",
    "data 3.5.5 (core)",
    "deploy-retrieve 3.9.17 (core)",
    "info 3.3.18 (core)",
    "limits 3.3.18 (core)",
    "marketplace 1.2.18 (core)",
    "org 4.3.5 (core)",
    "packaging 2.7.1 (core)",
    "schema 3.3.19 (core)",
    "settings 2.3.8 (core)",
    "signups 2.3.10 (user) published 51 days ago (Sun Jun 09 2024) (latest is 2.5.5)",
    "sobject 1.4.19 (core)",
    "source 3.5.5 (core)",
    "telemetry 3.6.2 (core)",
    "templates 56.3.3 (core)",
    "trust 3.7.13 (core)",
    "user 3.5.18 (core)"
  ]
}
github-actions[bot] commented 3 months ago

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.

mdonnalley commented 3 months ago

@readeral Thanks for the detailed writeup! I've replicated the issue, so I'll mark this as a bug and get it on our board. Looks like it might have been caused by this PR

git2gus[bot] commented 3 months ago

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

jshackell-sfdc commented 3 weeks ago

This issue has been fixed in CLI version 2.62.6 (October 16, 2024).