-
Notifications
You must be signed in to change notification settings - Fork 111
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
W-16273581 fix: manifests for custom object can omit parent #1375
Conversation
? fullName.split('.')[1] | ||
: fullName | ||
); | ||
const type = this.registry.getTypeByName(typeId); | ||
|
||
// Add children |
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.
the children are always added. the parent might or might not be depending on if it has content.
doing the children first lets the parent conditionally return early
@@ -750,3 +737,28 @@ const splitOnFirstDelimiter = (input: string): [string, string] => { | |||
const indexOfSplitChar = input.indexOf(KEY_DELIMITER); | |||
return [input.substring(0, indexOfSplitChar), input.substring(indexOfSplitChar + 1)]; | |||
}; | |||
|
|||
/** side effect: mutates the typeMap property */ | |||
const addToTypeMap = ({ |
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 code is simplified and now uses a set instead of an array
@@ -199,19 +199,3 @@ const getXmlFromCache = | |||
} | |||
return xmlCache.get(key) ?? {}; | |||
}; | |||
|
|||
/** composed function, exported from module for test */ | |||
export const unwrapAndOmitNS = |
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.
moved for easier sharing
@@ -34,11 +40,9 @@ export const DECOMPOSED_VIRTUAL_FS: VirtualDirectory[] = [ | |||
name: DECOMPOSED_XML_NAME, | |||
data: Buffer.from(`<CustomObject xmlns="${XML_NS_URL}"><fullName>customObject__c</fullName></CustomObject>`), | |||
}, | |||
{ |
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.
I don't think it should be
objects/CustomObject__c/Fields__c.field-meta.xml
@@ -51,11 +55,11 @@ export const DECOMPOSED_VIRTUAL_FS: VirtualDirectory[] = [ | |||
], | |||
}, | |||
{ | |||
dirPath: 'fields', |
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 didn't have the relative path, just the last segment
@@ -0,0 +1,91 @@ | |||
/* |
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.
copy of the existing one, but has no "real" content in the CustomObject
@@ -370,7 +370,9 @@ describe('SourceComponent', () => { | |||
); | |||
|
|||
it('should return child components for a component', () => { | |||
expect(decomposed.DECOMPOSED_COMPONENT.getChildren()).to.deep.equal([expectedChild, expectedChild2]); |
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.
order changed
QA NOTESSteps to repro
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Cat__c.Legs__c</members>
<name>CustomField</name>
</types>
<version>61.0</version>
</Package>
<types>
<members>Cat__c-Cat Layout</members>
<name>Layout</name>
</types>
|
QA UPDATE
|
What does this PR do?
deploy -d of an entire folder including a blank CustomObject file causes the Object to be in the manifest.
Case 1: If the Object is in the manifest, the mdapi will validate that the Object metadata contains all the required fields.
Case 2: If the Object is not in the manifest (only one or more of its child types are) then the validation doesn't happen (only the child types are validated)
SDR, when generating the manifest, needs to ask if the top-level (ex: object.meta.xml) is effectively empty. If so, that type should be omitted from the manifest (to get Case 2 behavior from the API)
other changes
update some tests that were based on an invalid mock
update the workflow preset to make all children of workflow unaddressable
What issues does this PR fix or reference?
@W-16273581@ (see inv)