-
Notifications
You must be signed in to change notification settings - Fork 115
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: properly merge DigitalExperience
components W-16646427
#1496
Conversation
src/convert/metadataConverter.ts
Outdated
for (const component of output.mergeWith) { | ||
mergeSet.add(component.parent ?? component); | ||
if (component.type.id === 'digitalexperience' && !component.parent?.content) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this only happen for DEs? are there other bundle types? you could actually check component.type.strategies.adapter==='digitalExperience'
so it would apply to all of the types that use that adapter, which I think is only DEB anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this only happen for DEs?
technically it should happen with any child type that's addressable without its parent, but yes only DE/DEB use this adapter.
In the investigation the customer mentioned sitedotcom
sites were working ok on MPDs, those don't have childs.
you could actually check component.type.strategies.adapter==='digitalExperience'
done ✅
What does this PR do?
Fixes SDR retrieving and writing
DigitalExperience
metadata to the wrong paths in this scenario:sfdx-project.json
)Given this project structure:
where
force-app
(default pkg dir) andmy-app
contain 1 DE each, if you retrieve one ofCapricorn_Coffee_B1
's filessf
/SDR writes the retrieve toforce-app
instead of merging it with the contents inmy-app
:Bug
project retrieve start
builds the correct source-backed DE components for merging here:https://github.com/salesforcecli/plugin-deploy-retrieve/blob/0bc486a28e3d4b49f42093144b3e435d34404ffe/src/commands/project/retrieve/start.ts#L171
but the metadata converter prefers the component parent if present for merging (I assume for decomposed types that aren't individually addressable):
https://github.com/forcedotcom/source-deploy-retrieve/blob/68c3a4e034ee0dbb09c33df974d47e0ff78769d2/src/convert/metadataConverter.ts#L183C18-L183C34
so the metadata transformer would always try to merge a retrieved DE against its local DEB (no match so the retrieved DE would get saved to the default pkg dir):
source-deploy-retrieve/src/convert/streams.ts
Line 76 in 68c3a4e
Fix
Testing
This PR adds a small UT for the converter fix and salesforcecli/plugin-deploy-retrieve#1279 includes a full MPD project with NUTs to test component merging of DEB/single DEs retrieves.
cd test/nuts/digitalExperienceBundle/mpdProject
sf org create scratch -d -f config/project-scratch-def.json -a deb-mpd
sf project deploy start
my-app
, seesf
writes it intoforce-app
What issues does this PR fix or reference?
@W-16646427@