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 — Make PowerShell Core enumerate COM collections by daxian-dbw · Pull Request #4553 · PowerShell/PowerShell Conversation
Member
Fix #3775 'GetEnumerator()' is not supported on COM collections in .NET Core (see https://github.com/dotnet/corefx/issues/19731), so we need to have our own implementation to enumerate COM collections.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Dongbo Wang (daxian-dbw)
requested review from
Aditya Patwardhan (adityapatwardhan) and
Ilya (iSazonov)
Jason Shirk (lzybkr)
previously approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM with minor comment
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add extra line at the end.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a new line.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Aditya Patwardhan (adityapatwardhan)
previously approved these changes
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we check
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will add a null check here.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Closed.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe use
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a duplicate check, line 416 could make
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
| Describe 'Basic COM Tests' -Tags "CI" { | ||
| It "Should enumerate ShellWindows" { | ||
| $shell = New-Object -ComObject "Shell.Application" | ||
| $windows = $shell.Windows() |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is it work on Core and IoT?
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.
Good catch. NanoServer and IoT don't have the shell, so these tests don't apply. Will update.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) I have addressed your comments. Please take another look. Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
We have new commits - please take another look.
|
Jason Shirk (@lzybkr) Aditya Patwardhan (@adityapatwardhan) We have new commits - please take another look. |
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.
| } | ||
| } | ||
|
|
||
| return enumVariant != null ? new ComEnumerator(enumVariant) : null; |
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.
I meant that here slightly hidden logic. Maybe:
// if IEnumVARIANT interface var enumVariant = comObject as COM.IEnumVARIANT; if (enumVariant != null) { return new ComEnumerator(enumVariant); } // if a collection var enumerable = comObject as IEnumerable; ... enumVariant = result as COM.IEnumVARIANT; if (enumVariant != null) { return new ComEnumerator(enumVariant); } ... return null; // any warnings for users?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| catch (Exception) | ||
| { | ||
| /* Catch all exception. */ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Obvious comment and typo (exception -> exceptions). Catch all exceptions - why? Please enhance the comment or remove.
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.
Fixed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Jason Shirk (@lzybkr) Can you approve? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) Jason probably doesn't have time to come back and approve it again, so it's up to the maintainer's judgment to see if it's necessary for reviewers who had approved to approve again. There are some guidelines you can use, for example:
Certainly, you will get your own guidelines as you become more experienced in this role. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dongbo Wang (@daxian-dbw) Thank you for the helpful comment! In this case, it's more of a courtesy - I have to show respect and ask him after I formally dismissed his approval. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) Another related comment. I usually don't dismiss a reviewer's approval unless the PR needs some fundamental changes (e.g. design flaw, logic changes and etc.). If the following-up changes are touch-ups or minor fixes (like typo, a null condition check, test fix-up), I think it's fine to keep the previous approval, and once the minor issues are addressed, you can approve the PR and merge it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dongbo Wang (@daxian-dbw) I wonder why CI AppVeyor failed? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I have investigated the failure, it actually a bug in Binder, more specifically at here, the restriction generated in the call to A repro would be: The I cannot open an issue until this PR is merged because the repro requires enumerating a COM collection. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Dongbo Wang (@daxian-dbw) Maybe made two commits for code and tests before rebase and merge? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) Please just choose 'Squash and merge'. It's a simple fix and there is no need to keep history commits. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A follow-up of the binder bug: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dongbo Wang (@daxian-dbw) Merged. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) Thank you for the review and good work as a maintainer 😄 Here are some of my experiences to choose among
As you can see from the main branch history, most of time we use (and prefer to) As for what is a simple/complex/non-trivial fix/work, it's hard to describe but you will have your judgement call as you gain more expeirences. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dongbo Wang (@daxian-dbw) Thanks for sharing your experience! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Make PowerShell Core enumerate COM collections
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.