-
Notifications
You must be signed in to change notification settings - Fork 98
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
feat: add required child type entries to manifest #446
Conversation
QA notes: using sharingRules/Workflow repo <?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Lead</members>
<name>SharingRules</name>
</types>
<types>
<members>*</members>
<name>SharingOwnerRule</name>
</types>
<types>
<members>*</members>
<name>SharingCriteriaRule</name>
</types>
<types>
<members>*</members>
<name>SharingGuestRule</name>
</types>
<types>
<members>*</members>
<name>SharingTerritoryRule</name>
</types>
<types>
<members>Account</members>
<members>Case</members>
<name>Workflow</name>
</types>
<types>
<members>*</members>
<members>*</members>
<name>WorkflowFieldUpdate</name>
</types>
<types>
<members>*</members>
<members>*</members>
<name>WorkflowKnowledgePublish</name>
</types>
<types>
<members>*</members>
<members>*</members>
<name>WorkflowTask</name>
</types>
<types>
<members>*</members>
<members>*</members>
<name>WorkflowAlert</name>
</types>
<types>
<members>*</members>
<members>*</members>
<name>WorkflowSend</name>
</types>
<types>
<members>*</members>
<members>*</members>
<name>WorkflowOutboundMessage</name>
</types>
<types>
<members>*</members>
<members>*</members>
<name>WorkflowRule</name>
</types>
<version>52.0</version>
</Package> ❌ deploy using -x and the above generated manifest throws |
} else { | ||
if (!typeEntry.includes(fullName) && !typeEntry.includes(ComponentSet.WILDCARD)) { | ||
typeMap.get(typeName).push(fullName); | ||
} |
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.
This conditional prevents a wildcard from being written in addition to fullNames. It also prevents duplicates.
What does this PR do?
When deploying certain parent metadata types to orgs for packaging, the child type entries must also be included within the manifest or the deployment will fail.
This PR changes some parent types in the registry so that their children are included when creating the manifest. Specifically, when calling
SourceComponent.getChildren()
for non-decomposed types, and the types have both auniqueIdElement
andxmlElementName
defined, it will create child SourceComponents for manifest entries.Also, some changes were made to
ComponentSet.getObject()
so that duplicate entries and wildcard entries with non-wildcard entries are prevented.What issues does this PR fix or reference?
forcedotcom/cli#1115
forcedotcom/cli#1163
forcedotcom/cli#1170
@W-9798333@
@W-9816625@
Functionality Before
Deploy error when trying to deploy certain parent types to an org for packaging. E.g., Workflow, SharingRules, ManagedTopics.
"Missing in package.xml
Functionality After
Successful deploy. Converting these types generate the correct manifest.
Testing Notes
Types to test with:
CustomLabel, Settings, Workflows, SharingRules, MatchingRules, AssignmentRules, AutoResponseRules, EscalationRules
Source commands to use for testing (all/any types listed above can be used):
sfdx force:source:manifest:create -m Settings
sfdx force:source:manifest:create -m Settings:<specific_setting>
sfdx force:source:convert -m Settings -d settings1
sfdx force:source:convert -m Settings:<specific_setting> -d settings2
sfdx force:source:convert -m Settings:<specific_setting> -n MyPkg -d settings3
// deploy the converted source from above commands
sfdx force:mdapi:deploy -w 3 -d settings1
sfdx force:mdapi:deploy -w 3 -d settings2
sfdx force:mdapi:deploy -w 3 -d settings3
sfdx force:source:deploy -m Settings
sfdx force:source:deploy -m Settings:<specific_setting>
sfdx force:source:retrieve -m Settings
sfdx force:source:retrieve -m Settings:<specific_setting>