Skip to content

Fixing issue #4112 Replace deprecated SHILCreateFromPath with SHParseDisplayName - #4707

Merged
RussKie merged 7 commits into
dotnet:mainfrom
wreuel:SHILCreateFromPath
Mar 29, 2021
Merged

RussKie merged 7 commits into
dotnet:mainfrom
wreuel:SHILCreateFromPath

Conversation

@wreuel

@wreuel wreuel commented Mar 20, 2021 •

Copy link
Copy Markdown
Contributor

…DisplayName

Fixes #4112 changed the deprecated as should be

Proposed changes

  • Rewrite the code to use the SHParseDisplayName

Customer Impact

  • None

Regression?

  • No

Risk

  • No

Screenshots

Before

After

Test methodology

  • Run the WinformsControlsTest
  • Open the Dialogs Samples
  • Breakpoint on the lines where GetShellItemForPath
  • Checked the behaviour when the paths is provided and when is not provided
Microsoft Reviewers: Open in CodeFlow

@wreuel
wreuel requested a review from a team as a code owner March 20, 2021 18:15
@ghost ghost assigned wreuel Mar 20, 2021
@dnfadmin

dnfadmin commented Mar 20, 2021 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@codecov

codecov Bot commented Mar 20, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #4707 (6ce4671) into main (67111c7) will decrease coverage by 0.00753%.
The diff coverage is n/a.

❗ Current head 6ce4671 differs from pull request most recent head 59c7069. Consider uploading reports for the commit 59c7069 to get more accurate results

@@                 Coverage Diff                 @@
##                main       #4707         +/-   ##
===================================================
- Coverage   97.97911%   97.97158%   -0.00754%     
===================================================
  Files            547         547                 
  Lines         265675      265675                 
  Branches        5105        5105                 
===================================================
- Hits          260306      260286         -20     
- Misses          4486        4502         +16     
- Partials         883         887          +4     
Flag Coverage Δ
Debug 97.97158% <ø> (-0.00754%) ⬇️
test 97.97158% <ø> (-0.00754%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@wreuel

wreuel commented Mar 20, 2021

Copy link
Copy Markdown
Contributor Author

@RussKie see, it failed on the same test that are failing if I just clone the repo and run the .\build -test command, should I do something else? Hope we can solve this.

@RussKie RussKie left a comment

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.

Can you please describe how you tested the change?

@ghost ghost added the waiting-author-feedback The team requires more information from the author label Mar 22, 2021
@RussKie

RussKie commented Mar 22, 2021

Copy link
Copy Markdown
Contributor

run the .\build -test command, should I do something else? Hope we can solve this.

Depends on what tests failed. Locale specific tests are known to fail (e.g. #2734). So as clipboard-related tests.
If you provide more info, we can look into it.

@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Mar 24, 2021
@wreuel

wreuel commented Mar 24, 2021

Copy link
Copy Markdown
Contributor Author

Can you please describe how you tested the change?

@RussKie About the tests, I just used the one that existed before, that was using the SHILCreateFromPath, the test is ShellItemTests.SHParseDisplayName_ValidPath() and it is passing, if I did wrong please LMK, trying to help. :)

@wreuel

This comment has been minimized.

@wreuel
wreuel requested a review from RussKie March 24, 2021 20:34
@wreuel wreuel changed the title Fixing issue #4112 Replace deprecated SHILCreateFromPath with SHParse… Fixing issue #4112 Replace deprecated SHILCreateFromPath with SHParseDisplayName Mar 24, 2021
@RussKie

This comment has been minimized.

@RussKie

RussKie commented Mar 25, 2021

Copy link
Copy Markdown
Contributor

Can you please describe how you tested the change?

About the tests, I just used the one that existed before, that was using the SHILCreateFromPath, the test is ShellItemTests.SHParseDisplayName_ValidPath() and it is passing, if I did wrong please LMK, trying to help. :)

Our automated tests don't have an exhaustive coverage, so likely there are code paths that aren't covered by those.
You also need to do an exploratory testing, i.e. run WinformsControlsTest test app (Dialogs sample) to verify that all code paths are executed, and the behaviour is expected.

SHParseDisplayName is only invoked through GetShellItemForPath which is used in three places:
image

So the bare minimum you need to run FolderBrowserDialog, OpenFileDialog and SaveFileDialog samples to confirm they still work as expected.

@RussKie RussKie added the waiting-author-feedback The team requires more information from the author label Mar 25, 2021

@RussKie RussKie left a comment

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.

👍

@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Mar 28, 2021
@wreuel

wreuel commented Mar 28, 2021

Copy link
Copy Markdown
Contributor Author

@RussKie so, I did the exploratory test, as you explained. And the Dialog are working fine.
Every path that goes to the GetShellItemForPath was hit correctly and the dialog opened on the path that was provided before hand on the config options.

Also it worked fine when the path wasn't provided.

Do you need anything else?

@wreuel wreuel left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have done in a new commit

@wreuel
wreuel requested a review from RussKie March 28, 2021 11:17
@RussKie
RussKie merged commit 2b161db into dotnet:main Mar 29, 2021
@ghost ghost added this to the 6.0 Preview4 milestone Mar 29, 2021
@RussKie

RussKie commented Mar 29, 2021

Copy link
Copy Markdown
Contributor

Thank you!

wreuel added a commit to wreuel/winforms that referenced this pull request Apr 13, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace deprecated SHILCreateFromPath with SHParseDisplayName

3 participants