FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixing bug #2607 related to ModuleSpec syntax in RequiredModules by anmenaga · Pull Request #3594 · PowerShell/PowerShell · GitHub

Fixing bug #2607 related to ModuleSpec syntax in RequiredModules - #3594

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
anmenaga:FixedModuleSpecSyntaxInRequiredModules
May 1, 2017
Merged

Fixing bug #2607 related to ModuleSpec syntax in RequiredModules#3594
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
anmenaga:FixedModuleSpecSyntaxInRequiredModules

Conversation

Copy link
Copy Markdown

This fixes issue #2607.
'RequiredModules' is a field in module manifest that can reference other modules using ModuleSpecification format.
The basic version of this format (just module name) was working fine, however there was a problem when more detailed version of the format was used (the one that uses module versions or/and GUIDs).
During module import, there is a check for cyclic references through 'RequiredModules' field. The bug was in this check for cyclic references , related to comparison rules for ModuleSpecification objects - as a result code was incorrectly reporting 'cyclic reference' error in cases when there was none.

Added tests for different ModuleSpecification formats and a test for error when there is actually a cyclic reference.

Test results before the fix:

Test results after the fix:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

does requiredModuleSpecification only needs to be added when currentModule is not null?
this is confusing here. if so, please add comment explains why

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Originally I was thinking that both addition should be bundled together; but thinking more about it - it is better to move the new addition to its own 'if' check. Updated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

please also check that the module is actually loaded.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good point; updated.

Andrew (anmenaga) force-pushed the FixedModuleSpecSyntaxInRequiredModules branch from 5fc877d to bad1221 Compare April 28, 2017 17:57

Copy link
Copy Markdown
Contributor

good to sign off

Dongbo Wang (daxian-dbw) merged commit c0aafdb into PowerShell:master May 1, 2017
Andrew (anmenaga) deleted the FixedModuleSpecSyntaxInRequiredModules branch October 31, 2018 21:20
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
…ell#3594)

This fixes issue PowerShell#2607.
'RequiredModules' is a field in module manifest that can reference other modules using ModuleSpecification format.
The basic version of this format (just module name) was working fine, however, there was a problem when a more detailed version of the format was used (the one that uses module versions or/and GUIDs).
During module import, there is a check for cyclic references through 'RequiredModules' field. The bug was in this check for cyclic references, related to comparison rules for ModuleSpecification objects - as a result, the code was incorrectly reporting 'cyclic reference' error in cases when there was none.
Also, added tests for different ModuleSpecification formats and a test for error when there is actually a cyclic reference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL