GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Ensure NestedModules property gets populated by Test-ModuleManifest by SteveL-MSFT · Pull Request #7859 · PowerShell/PowerShell Conversation
|
|
This seems like the right way to efficiently build/return the nested module info objects. But for the sake of having considered other ideas, wouldn't users expect a fully live nested module info object here? Since the fake module info is the same type that would normally be returned by Further down in the same method when nested modules are read, we actually go and read their manifest and load a module info. Creating fake info objects from the nested module specifications is certainly more efficient, but I think it's a breaking change from previous (pre-regression) behaviour. See Windows PowerShell's version of the same: I think we may be committed to doing the inefficient thing. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| if (!needToAnalyzeScriptModules) | ||
| { | ||
| // need to add nested modules to the manifestInfo when no more analysis needs to be done |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
// Add nested modules ...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Rob Holt (@rjmholt) You raise a fair point. However, I think most cases the user doesn't need a complete object. In the issue, the problem with the current behavior is that the I would suggest deferring whether we want to add capability to get the entire tree of objects until there is a customer request for it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
fd861f1 to
6428aaf
Compare
address codefactor issue added test for update-modulemanifest
6428aaf to
36fc6ea
Compare
Maybe use lazy for the objects? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Steve Lee (@SteveL-MSFT) Thanks for fixing this regression! It looks good to me, but since the same code is used both here and for The helper method can be a iterator method, which can be used for both here an |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dongbo Wang (@daxian-dbw) yes, I'll make that change. Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| /// <summary> | ||
| /// Helper function to generate fake PSModuleInfo objects from ModuleSpecification objects |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please add final dot.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| BeforeEach { | ||
| $testModulePath = "testdrive:/module/test.psd1" | ||
| New-Item -ItemType Directory -Path testdrive:/module |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please suppress output New-Item -ItemType Directory -Path testdrive:/module > $null.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| BeforeEach { | ||
| $testModulePath = "testdrive:/module/test.psd1" | ||
| New-Item -ItemType Directory -Path testdrive:/module |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The same.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ) { | ||
| param($exportValue) | ||
|
|
||
| New-Item -ItemType File -Path testdrive:/module/foo.psm1 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The same.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Test-ModuleManifest does not populate the NestedModules field
There was an error while loading. Please reload this page.