-
Notifications
You must be signed in to change notification settings - Fork 102
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: don't strip last folder from dir when resolving projectDir #660
Conversation
@@ -417,7 +417,7 @@ describe('Convert Transaction Constructs', () => { | |||
state.exampleComponent = component; | |||
}); | |||
|
|||
const result = await context.nonDecomposition.finalize(nonDecomposed.DEFAULT_DIR, TREE); | |||
const result = await context.nonDecomposition.finalize(dirname(nonDecomposed.DEFAULT_DIR), TREE); |
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.
@@ -273,7 +273,7 @@ class NonDecompositionFinalizer extends ConvertTransactionFinalizer<NonDecomposi | |||
*/ | |||
private getAllComponentsOfType(defaultDirectory: string, componentType: string): SourceComponent[] { | |||
// assumes that defaultDir is one level below project dir |
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.
Is this comment still accurate now?
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.
yes, the difference now is that it doesn't strip the last member in defaultDirectory
, so for force:mdapi:convert -r mdapi -d test1/test2
const defaultDirectory = '/Users/cdominguez/code/sfdx-project/test1/test2';
const projectDir = resolve(defaultDirectory);
// projectDir would equal '/Users/cdominguez/code/sfdx-project/test1/test2'
...:thinking: wouldn't this cause SDR fail to find customlabels if you have MPDs in a project? Since projectDir
will not be pointing to the root project dir.
this is the only place it's being called:
const allNonDecomposed = this.getAllComponentsOfType( |
Closed in favor of #666 |
What does this PR do?
Fixes
NonDecompositionFinalizer
finalizer resolving metadata components from the top-level folder when passing a dir path that is exactly one level below the project dir.When running
sfdx force:mdapi:convert -r mdapi -d src
plugin-source sets the
outputDirectory
to:/Users/cdominguez/code/sfdx-project/src
which then in this line:
source-deploy-retrieve/src/convert/convertContext.ts
Line 276 in 7804d44
dirname
strips the last folder after the last/
soand last SDR uses the projectDir to get the compSet from source, which walks the tree, scans customlabels in other folders with other dir (other src, mdapi, etc) and make this line return the wrong parentKey.
source-deploy-retrieve/src/convert/convertContext.ts
Line 215 in 7804d44
What issues does this PR fix or reference?
forcedotcom/cli#1540
@W-11186731@
Functionality Before
NonDecompositionFinalizer
scans components in root project dir which causes issues when components are found in other folders (mdapi
, etc).Functionality After