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

fix: Wr/coft mpd #1146

Merged
merged 11 commits into from
Oct 31, 2023
Merged

fix: Wr/coft mpd #1146

merged 11 commits into from
Oct 31, 2023

Conversation

WillieRuemmele
Copy link
Member

@WillieRuemmele WillieRuemmele commented Oct 18, 2023

What does this PR do?

allows CustomFieldTranslation MDT to be retrieved across MPDs

What issues does this PR fix or reference?

forcedotcom/cli#2124 @W-13193003@

Functionality Before

with a remote change to a CFT, the parent COT being in the non-default package dir, and running a force source pull

 ➜  pull
Preparing retrieve request... ⣾
Preparing retrieve request... MetadataTransferError
Error (1): Metadata API request failed: Unexpected child metadata [/Users/william.ruemmele/projects/scratches/sfdx-translation-bug/package-a-app/main/default/objectTranslations/customObject__c-es/customField__c.fieldTranslation-meta.xml] found for parent type [CustomObjectTranslation]

Functionality After

 ➜  sf force source pull                                
Warning: We plan to deprecate this command in the future. Try using the "project retrieve start" command instead.
Loading source tracking information... ⣽
Updating source tracking... done
=== Retrieved Source

 STATE   FULL NAME                         TYPE                    PROJECT PATH                                                                                                   
 ─────── ───────────────────────────────── ─────────────────────── ────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
 Changed customObject__c-es.customField__c CustomFieldTranslation  package-a-app/main/default/objectTranslations/customObject__c-es/customField__c.fieldTranslation-meta.xml      
 Changed customObject__c-es                CustomObjectTranslation package-b-app/main/default/objectTranslations/customObject__c-es/customObject__c-es.objectTranslation-meta.xml 

notice package-a and package-b as the two different packages written to, a is default, where new MD is written to, and b contains the parent COT

@WillieRuemmele WillieRuemmele marked this pull request as ready for review October 18, 2023 21:13
@WillieRuemmele WillieRuemmele requested a review from a team as a code owner October 18, 2023 21:13
Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine. Lots of discussions about how deletes are supposed to be handled, and the possibility of the behavior being confusing to users.

@mshanemc
Copy link
Contributor

mshanemc commented Oct 24, 2023

QA:
deployed using customer's repro repo, this branch yarn-linked in PDR's bin/dev.

✅ deploys using tracking
✅ deploys using multiple -d

create a field translation
project retrieve preview shows COT is changed

Will Retrieve [1] files.
 Type                    Fullname           Path                                                                                                           
 ─────────────────────── ────────────────── ────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
 CustomObjectTranslation customObject__c-es package-b-app/main/default/objectTranslations/customObject__c-es/customObject__c-es.objectTranslation-meta.xml

project retrieve start shows COT and COFT as changed, but also shows duplicate results. 😕

Retrieved Source
===================================================================================================================================================================
| State   Name               Type                    Path                                                                                                           
| ─────── ────────────────── ─────────────────────── ────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
| Changed customObject__c-es CustomObjectTranslation package-a-app/main/default/objectTranslations/customObject__c-es/customField__c.fieldTranslation-meta.xml      
| Changed customObject__c-es CustomObjectTranslation package-a-app/main/default/objectTranslations/customObject__c-es/customField__c.fieldTranslation-meta.xml      
| Changed customObject__c-es CustomObjectTranslation package-a-app/main/default/objectTranslations/customObject__c-es/customObject__c-es.objectTranslation-meta.xml 
| Changed customObject__c-es CustomObjectTranslation package-a-app/main/default/objectTranslations/customObject__c-es/customObject__c-es.objectTranslation-meta.xml

❌ the COT is in package-b in the customer's repo. It's being added, in duplicate, to package-a when the changes are retrieved. It should have realized that we already had the COT in package-b and any changes are merged into there.

change the translation in the org
❌ tracking thinks there are conflicts with the object in package-b. Also, still duplicated

➜  sfdx-translation-bug git:(main) ✗ ../../plugin-deploy-retrieve/bin/dev project:retrieve:preview

Conflicts [2]. Run the command with the --ignore-conflicts flag to override.
Type                    Fullname           Path                                                                                                           
─────────────────────── ────────────────── ────────────────────────────────────────────────────────────────────────────────────────────────────────────── 
CustomObjectTranslation customObject__c-es package-b-app/main/default/objectTranslations/customObject__c-es/customObject__c-es.objectTranslation-meta.xml 
CustomObjectTranslation customObject__c-es package-b-app/main/default/objectTranslations/customObject__c-es/customObject__c-es.objectTranslation-meta.xml 

@shetzel shetzel changed the title Wr/coft mpd fix: Wr/coft mpd Oct 31, 2023
@shetzel shetzel merged commit 7fdfd33 into main Oct 31, 2023
67 checks passed
@shetzel shetzel deleted the wr/coftMPD branch October 31, 2023 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants