forcedotcom / forcedotcom/cli

sf project generate manifest produce package.xml file which does not include namespace for the custom metadata record

Open
#3,267 3 comments 0 reactions 0 assignees View on GitHub
investigating validated
Dominant language
No language data
Stars
571
Forks
80
Avg merge
2d 15h
Merged PRs (30d)
3

Description

### Summary
sf project generate manifest produce package.xml file which does not include namespace for the custom metadata record
There are 2 packages installed:
- one is unlocked with prefix XXX
- once is managed with prefix YYY
Manage package contains custom metadata ZZZ and some basic custom metadata records
When generating manifest including managed and unlocked packages, there is missing name space prefix fo custom metadata entry

### Steps To Reproduce
1. create salesforce org (sandbox, trial or developer does not matter)
2. install managed or unlocked package containing custom metadata records
3. generate manifest using command `sfdx project generate manifest --from-org org_alias --name="backup.xml" --output-dir "backup\%1" -c unlocked -c managed`

### Expected result
generated backup XML file should contain custom metadata records with namespace prefix
XXX__FieldSetField - custom metadata
XXX__FieldSetField.XXX__RecordName - custom metadata record from managed package
XXX__FieldSetField.YYY__RecordName2 - custom metadata records from unlock package which depends on managed package
```


XXX__FieldSetField.XXX__RecordName
XXX__FieldSetField.YYY__RecordName2
CustomMetadata

55.0

```

### Actual result
generate backup.xml file does not contain namespace prefix for custom metadata records.
See missing XXX__ and YYY__ before RecordName and RecordName2
It looks like RecordName and RecordName2 are custom metadata records created in unmanaged package or with deploy without any namespace, which is not true, because later when I try to retrieve metadata I get warning that there custom metadata records do not exist.
```


XXX__FieldSetField.RecordName
XXX__FieldSetField.RecordName2
CustomMetadata

55.0

```

### Additional information
it works correctly in @salesforce/cli@2.76.3
it does not work in any newer version up to @salesforce/cli@2.84.6

### System Information
I'm using windows CMD or ubuntu BASH
it does not work for
```json
{
"architecture": "win32-x64",
"cliVersion": "@salesforce/cli/2.84.6",
"nodeVersion": "node-v20.19.0",
"osVersion": "Windows_NT 10.0.26100",
"rootPath": "C:\\Users\\Wojtek\\AppData\\Local\\nvm\\v20.19.0\\node_modules\\@salesforce\\cli",
"shell": "cmd.exe",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.2.27 (core)",
"@oclif/plugin-commands 4.1.22 (core)",
"@oclif/plugin-help 6.2.27 (core)",
"@oclif/plugin-not-found 3.2.49 (core)",
"@oclif/plugin-plugins 5.4.36 (core)",
"@oclif/plugin-search 1.2.23 (core)",
"@oclif/plugin-update 4.6.36 (core)",
"@oclif/plugin-version 2.2.27 (core)",
"@oclif/plugin-warn-if-update-available 3.1.38 (core)",
"@oclif/plugin-which 3.2.34 (core)",
"@salesforce/cli 2.84.6 (core)",
"apex 3.6.12 (core)",
"api 1.3.3 (core)",
"auth 3.6.109 (core)",
"data 4.0.25 (core)",
"deploy-retrieve 3.21.3 (core)",
"info 3.4.51 (core)",
"limits 3.3.51 (core)",
"marketplace 1.3.8 (core)",
"org 5.6.0 (core)",
"packaging 2.12.3 (core)",
"schema 3.3.58 (core)",
"settings 2.4.22 (core)",
"sobject 1.4.53 (core)",
"telemetry 3.6.38 (core)",
"templates 56.3.43 (core)",
"trust 3.7.79 (core)",
"user 3.6.16 (core)"
]
}
```

it works OK for
```json
{
"architecture": "win32-x64",
"cliVersion": "@salesforce/cli/2.76.3",
"nodeVersion": "node-v20.19.0",
"osVersion": "Windows_NT 10.0.26100",
"rootPath": "C:\\Users\\Wojtek\\AppData\\Local\\nvm\\v20.19.0\\node_modules\\@salesforce\\cli",
"shell": "cmd.exe",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.2.18 (core)",
"@oclif/plugin-commands 4.1.19 (core)",
"@oclif/plugin-help 6.2.23 (core)",
"@oclif/plugin-not-found 3.2.39 (core)",
"@oclif/plugin-plugins 5.4.29 (core)",
"@oclif/plugin-search 1.2.19 (core)",
"@oclif/plugin-update 4.6.27 (core)",
"@oclif/plugin-version 2.2.23 (core)",
"@oclif/plugin-warn-if-update-available 3.1.31 (core)",
"@oclif/plugin-which 3.2.26 (core)",
"@salesforce/cli 2.76.3 (core)",
"apex 3.6.8 (core)",
"api 1.3.3 (core)",
"auth 3.6.91 (core)",
"data 4.0.7 (core)",
"deploy-retrieve 3.18.0 (core)",
"info 3.4.34 (core)",
"limits 3.3.44 (core)",
"marketplace 1.3.7 (core)",
"org 5.2.25 (core)",
"packaging 2.9.15 (core)",
"schema 3.3.46 (core)",
"settings 2.4.10 (core)",
"sobject 1.4.49 (core)",
"telemetry 3.6.32 (core)",
"templates 56.3.35 (core)",
"trust 3.7.60 (core)",
"user 3.6.6 (core)"
]
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.