-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
62606 Return fully qualified path from FileSystemEventArgs #63051
62606 Return fully qualified path from FileSystemEventArgs #63051
Conversation
Gets the fully qualified path after combining the directory and name part as per the thread discussion. Also added and updated tests for the new change. Fix dotnet#62606
To be consistent with new behavior of FullPath from FileSystemEventArgs same change was applied for RenamedEventArgs including updated tests. Fix dotnet#62606
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsThe FullPath for FileSystemEventArgs and related OldFullPath for RenamedEventArgs now return fully qualified paths as per the documentation and the name of these properties and according to the discussions in the issue below. Fix #62606
|
Hi @jozkee . Based on the feedback from the failed tests I believe the fix is good but the tests are too Windows OS oriented. They were the same before my changes but back then it was not an issue since the FullPath was not actually returning a truly fully qualified path but mostly a simple concatenation of directory and file name. Two options that I see now are:
Please let me know your thoughts. Thanks! |
In the context of using an actual full path which can vary on Unix vs Windows Fix dotnet#62606
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/src/System/IO/RenamedEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/tests/Args.RenamedEventArgs.cs
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
@slask thanks for your PR. I just saw this:
Second option is the way to go, which based on what I saw you already did correctly. |
Adjusted unit tests to match the new logic. Fix dotnet#62606
The previous buggy implementation of RenamedEventArgs produced a convenient side-effect for PhysicalFilesWatcher. Without the trailing slash adde by RenamedEventArgs the root was longer than the fullPath by a trailing slash. Fix dotnet#62606
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs
Outdated
Show resolved
Hide resolved
Implemented most of the code review suggestions. Fix dotnet#62606
…eturn-fully-qualified-path-FileSystemEventArgs
Also made unit tests more focused by removing needless asserts from the tests Fix dotnet#62606
Reverted the changes to PhysicalFilesWatcher and added back the trailing separator behavior as per code review suggestion Fix dotnet#62606
Added When you commit this breaking change:
Tagging @dotnet/compat for awareness of the breaking change. |
Linking doc issue created for breaking change: dotnet/docs#27916 |
@jozkee / @ericstj I created the breaking change doc issue and cross-linked them. I don't think I have permission to remove the tag from this PR. |
Hi @jozkee, is there something else I need to do to finalize this PR? |
Hi @jozkee. Friendly reminder to move this PR forward. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor nits in test code; otherwise, looks good to me, thanks.
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem.Watcher/tests/Args.FileSystemEventArgs.cs
Outdated
Show resolved
Hide resolved
As per code review suggestions. Fix dotnet#62606
Pipeline retrigger. Some pipelines timed out, most probably transient issues. Fix dotnet#62606
@jozkee I have made the small changes you mentioned to the tests but I see these 7 jobs are timing out for some reason but I don't see how they are related to the changes I made... |
@slask the time-outs are most likely unrelated. Just for safety, I hit re-run, let's hope they finish this time. |
@slask, thanks for your contribution! |
The FullPath for FileSystemEventArgs and related OldFullPath for RenamedEventArgs now return fully qualified paths as per the documentation and the name of these properties and according to the discussions in the issue below.
Fix #62606