cli icon indicating copy to clipboard operation
cli copied to clipboard

Translations are missing the namespace prefix of Apps from Managed Packages

Open amtrack opened this issue 8 months ago • 12 comments

Summary

When retrieving Translations from a Source-Tracked Org, the <customApplications> entries are missing the namespacePrefix of Apps from Managed Packages (e.g. Address Picker Autocomplete for Flow).

As a consequence the deployment of those invalid .translation-meta.xml files to another org fails with:

In field: name - no CustomApplication named Address_Picker_Autocomplete found

Steps To Reproduce

Please see my Git repository for all details and a reproduction using GitHub Actions: https://github.com/mdapi-issues/mre-translations-missing-namespace-of-applications

TL;DR

# create a Scratch Org with the Translation Workbench enabled
sf org create scratch -f config/project-scratch-def.json --alias translation-managed-application --set-default
# install the Managed Package "Address Picker Autocomplete for Flow"
sf package install --package 04t6F000004DJCEQA4 --no-prompt --wait 30
# deploy some unrelated translation of a managed CustomLabel
sf project deploy start --source-dir fixtures/some-unrelated-translation-of-a-managed-customlabel
# retrieve the translations from the Scratch Org
sf project retrieve start -m Translations

Expected result

<?xml version="1.0" encoding="UTF-8"?>
<Translations xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <customApplications>
        <description xsi:nil="true"/>
        <label><!-- Address Picker Autocomplete --></label>
        <name>DV_Flow_AP__Address_Picker_Autocomplete</name>
    </customApplications>
</Translations>

Actual result

<?xml version="1.0" encoding="UTF-8"?>
<Translations xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <customApplications>
        <description xsi:nil="true"/>
        <label><!-- Address Picker Autocomplete --></label>
        <name>Address_Picker_Autocomplete</name>
    </customApplications>
</Translations>

actual (red) vs. expected (green)

<?xml version="1.0" encoding="UTF-8"?>
<Translations xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <customApplications>
        <description xsi:nil="true"/>
        <label><!-- Address Picker Autocomplete --></label>
-        <name>Address_Picker_Autocomplete</name>
+        <name>DV_Flow_AP__Address_Picker_Autocomplete</name>
    </customApplications>
</Translations>

System Information

{
  "architecture": "darwin-arm64",
  "cliVersion": "@salesforce/cli/2.42.6",
  "nodeVersion": "node-v20.10.0",
  "osVersion": "Darwin 23.5.0",
  "rootPath": "/Users/john.doe/.local/lib/node_modules/@salesforce/cli",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.0.18 (core)",
    "@oclif/plugin-commands 3.3.4 (core)",
    "@oclif/plugin-help 6.0.22 (core)",
    "@oclif/plugin-not-found 3.1.9 (core)",
    "@oclif/plugin-plugins 5.0.21 (core)",
    "@oclif/plugin-search 1.0.24 (core)",
    "@oclif/plugin-update 4.2.12 (core)",
    "@oclif/plugin-version 2.1.2 (core)",
    "@oclif/plugin-warn-if-update-available 3.0.19 (core)",
    "@oclif/plugin-which 3.1.10 (core)",
    "@salesforce/cli 2.42.6 (core)",
    "apex 3.1.11 (core)",
    "auth 3.6.11 (core)",
    "data 3.3.5 (core)",
    "deploy-retrieve 3.6.14 (core)",
    "info 3.2.8 (core)",
    "limits 3.3.7 (core)",
    "marketplace 1.2.5 (core)",
    "org 4.1.10 (core)",
    "packaging 2.4.4 (core)",
    "schema 3.3.6 (core)",
    "settings 2.2.6 (core)",
    "sobject 1.4.2 (core)",
    "source 3.3.12 (core)",
    "telemetry 3.3.7 (core)",
    "templates 56.2.7 (core)",
    "trust 3.6.11 (core)",
    "user 3.5.8 (core)"
  ]
}

Additional information

image

Untitled

Screenshot 2024-06-05 at 16 00 29

amtrack avatar Jun 05 '24 14:06 amtrack