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: getComponent won't throw when parent is ignored #418

Merged
merged 1 commit into from
Aug 11, 2021

Conversation

WillieRuemmele
Copy link
Member

What does this PR do?

the decomposedSourceAdapter was calling baseSourceAdapter.getComponents which was throwing an error when a parent xml file wasn't found or was .forceignore'd

this wasn't working for decomposed types because the parent isn't required... and so it was throwing when it shouldn't - blocking functionality.

I overrode the getComponents in the decomposedSourceAdapter adapter so that it wouldn't throw an error in that scenario

What issues does this PR fix or reference?

forcedotcom/cli#1110, forcedotcom/cli#1106, @W-9720135@

Functionality Before

Metadata xml file /Users/william.ruemmele/projects/scratches/SFDXCLI-Issues/CLIIssues/force-app/main/default/objects/hed__Term__c/hed__Term__c.object-meta.xml is forceignored but is required for /Users/william.ruemmele/projects/scratches/SFDXCLI-Issues/CLIIssues/force-app/main/default/objects/hed__Term__c/fields/Term_Title__c.field-meta.xml

<insert gif and/or summary>

Functionality After

Source was successfully converted to Metadata API format
<insert gif and/or summary>

@WillieRuemmele WillieRuemmele requested review from a team as code owners August 9, 2021 22:58
@@ -54,7 +54,7 @@ export abstract class BaseSourceAdapter implements SourceAdapter {

let component: SourceComponent;
if (rootMetadata) {
const componentName = this.type.inFolder
const componentName = this.type.folderType
Copy link
Member Author

Choose a reason for hiding this comment

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

inFolder was deprecated, folderType was the suggested replacement

Copy link
Contributor

@shetzel shetzel left a comment

Choose a reason for hiding this comment

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

Tested several converts/deploys/retrieves pointing to CustomObject children, child dirs, and object dirs with the object meta file ignored, not present, and present. All looks good.

@shetzel shetzel merged commit 125ce16 into develop Aug 11, 2021
@shetzel shetzel deleted the wr/decomposedAdapter branch August 11, 2021 17:28
xyc pushed a commit that referenced this pull request Aug 12, 2021
* feat: enable typedoc generation in circleci publish job (#392)

* feat: enable doc generation in circleci publish

* fix: getComponent won't throw when parent is ignored (#418)

* feat: adds support for destructive changes (#420)

* feat: adds support for destructive changes

SourceComponents can now be marked for delete and added to ComponentSets. Conversion will then
create a destructiveChangesPost.xml and include with the deploy.

* feat: add ability to do destructiveChangesPre.xml

Co-authored-by: Willie Ruemmele <[email protected]>

Co-authored-by: Violet Yao <[email protected]>
Co-authored-by: Willie Ruemmele <[email protected]>
Co-authored-by: Steve Hetzel <[email protected]>
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.

2 participants