| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Leave a comment
Sorry, something went wrong.
|
This PR has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 10 days. |
Sorry, something went wrong.
|
Steve Lee (@SteveL-MSFT) do we have interest in the change? |
Sorry, something went wrong.
|
Ilya (@iSazonov) yes, I think this change is something we want |
Sorry, something went wrong.
|
Ilya (@iSazonov) OK, rebased to latest master. |
Sorry, something went wrong.
There was a problem hiding this comment.
ContainsWildcardCharacters is a public method in WildcardPattern. Changing to the behavior is a breaking change. The method name clearly indicates that it only checks if the string contains any wildcard characters, but not if it contains valid wildcard characters. If we need to check for valid wildcard characters, a new method should be introduced.
Sorry, something went wrong.
Does the comment only refer to this method or its use too? |
Sorry, something went wrong.
The comment only applies to the method, not to its uses. If a caller assumes differently, then another method should be added for checking if a path contains valid wildcard characters. |
Sorry, something went wrong.
|
I think the breaking change is in gray area because using of the method implies that we want exactly working wildcards and not something similar ']['. Also I'd said that passing '][' in the method is a bug. |
Sorry, something went wrong.
|
Ilya (@iSazonov) This is more of a unacceptable changes in public contract. Quoted from the breaking-chagne-doc:
That being said, I do like the refactoring changes in CommandSearcher.cs and inclined to keep it. |
Sorry, something went wrong.
|
Add the "Review-Committee" label. The proposed change is a breaking change that falls in bucket 1, so we need committee to review. |
Sorry, something went wrong.
|
@PowerShell/powershell-committee reviewed this. Recommendation is to deprecate this api and introduce ContainsValidWildcardPattern() API and fix all callsites to use the new method (separate PR). |
Sorry, something went wrong.
|
Should the new method be a strict checking (e.g. try/catch with the WildcardPatternParser::Parse)? |
Sorry, something went wrong.
|
At first glance it should be TryParse(). Although we should review all callsites (131) - huge work! |
Sorry, something went wrong.
|
The method ContainsWildcardCharacters is called at many places in powershell, and I believe at least some of the callers only need a hint about whether a string might contains wildcard pattern, instead of an accurate answer, so for those caller, a perf penalty will be charged as [WildcardPatternParser]::Parse is relatively expensive. Even for the callers that do want the accurate answer, another call to Parse will be made when creating/using the WildcardPattern from the string, so we will be paying the tax twice. We can still add the new method ContainsValidWildcardPattern wrapping a call to WildcardPatternParser.Parse, so we can accurately know if a string contains valid wildcard patterns. But it's probably not right to blindly change all callers of ContainsWildcardCharacters to the new method. |
Sorry, something went wrong.
|
kwkam Changes regarding ContainsValidWildcardPattern and ContainsWildcardCharacters would be a bit tricky and likely involve many changes in other places. How about we revert the changes to ContainsValidWildcardPattern in this PR and make it only about the refactoring changes in CommandSearcher.cs? We can merge the refactoring changes, and open a separate issue/PR to discuss the right fix for ContainsValidWildcardPattern. |
Sorry, something went wrong.
|
I full agree with Dongbo Wang (@daxian-dbw). |
Sorry, something went wrong.
|
kwkam Do you agree with Dongbo Wang (@daxian-dbw) suggestion to split the PR? |
Sorry, something went wrong.
Do not glob path with invalid wildcard pattern (eg. "./[.ps1"). Merge the path resolving code from GetNextFromPath into ResolvePSPath. Add test for previous change engine/regex: add MayBeWildcardPattern CommandSearcher: use MayBeWildcardPattern [Feature] Fix FunctionProvider test [Feature] Revert "[Feature] Fix FunctionProvider test" This reverts commit d7ab0d7d538df8943bf156f098866cbf7b38bc64. [Feature] Remove 'resolvedPath != null' [Feature] Redo efe93252c5 and b300130e59 [Feature] fixup Revert "[Feature] fixup" Revert "[Feature] Redo Rename MayBeWildcardPattern Fix ContainsValidWildcardPattern
|
rebased PR |
Sorry, something went wrong.
|
PoshChan-Bot (@PoshChan) Please remind me in 1 hour |
Sorry, something went wrong.
|
Travis Plunk (@TravisEz13), this is the reminder you requested 1 hour ago |
Sorry, something went wrong.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Sorry, something went wrong.
|
Dongbo Wang (@daxian-dbw) Please update your review |
Sorry, something went wrong.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Sorry, something went wrong.
|
Dongbo Wang (@daxian-dbw) Please update your review |
Sorry, something went wrong.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Sorry, something went wrong.
|
This PR has 36 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience! Quantification details
Label : Extra Small Size : +33 -3 Percentile : 14.4% Total files changed: 4 Change summary by file extension: .cs : +27 -3 .ps1 : +6 -0 Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
Sorry, something went wrong.
|
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Do not glob path with invalid wildcard pattern (eg. "./[.ps1").
PR Motivation
Merge the Qualified Path Search and Relative Path Search into a single function (GetNextFromPath into ResolvePSPath).
Add an internal method ContainsValidWildcardPattern to the WildcardPattern API to make the checking be more sensitive to invalid bracket patterns, to allow faster fallback from wildcard search for fully qualified path to a literal search.
PR Checklist