Skip to content
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

Merged

Conversation

slask
Copy link
Contributor

@slask slask commented Dec 21, 2021

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

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
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Dec 21, 2021
@ghost
Copy link

ghost commented Dec 21, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

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

Author: slask
Assignees: -
Labels:

area-System.IO

Milestone: -

@dnfadmin
Copy link

dnfadmin commented Dec 21, 2021

CLA assistant check
All CLA requirements met.

@danmoseley danmoseley requested a review from jozkee December 21, 2021 23:10
@slask
Copy link
Contributor Author

slask commented Dec 22, 2021

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:

  • remove the windows specific test cases (InlineData attribute instances)
  • extract the windows specific test cases and mark them somehow to be run on Windows only. I might need some pointers on how to do that. Is it the [ActiveIssue(...)] or [PlatformSpecific(TestPlatforms.Windows)] attribute?

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
@jozkee
Copy link
Member

jozkee commented Dec 28, 2021

@slask thanks for your PR.

I just saw this:

Two options that I see now are:

remove the windows specific test cases (InlineData attribute instances)
extract the windows specific test cases and mark them somehow to be run on Windows only. I might need some pointers on how to do that. Is it the [ActiveIssue(...)] or [PlatformSpecific(TestPlatforms.Windows)] attribute?

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
slask added 4 commits January 17, 2022 18:46
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
@ericstj ericstj added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Jan 18, 2022
@ghost ghost added the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Jan 18, 2022
@ghost
Copy link

ghost commented Jan 18, 2022

Added needs-breaking-change-doc-created label because this PR has the breaking-change label.

When you commit this breaking change:

  1. Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
  2. Ask a committer to mail the .NET Breaking Change Notification DL.

Tagging @dotnet/compat for awareness of the breaking change.

@slask
Copy link
Contributor Author

slask commented Jan 21, 2022

Linking doc issue created for breaking change: dotnet/docs#27916

@slask
Copy link
Contributor Author

slask commented Jan 21, 2022

@jozkee / @ericstj I created the breaking change doc issue and cross-linked them.
I also emailed [email protected] with the docs issue but the mail got rejected.

I don't think I have permission to remove the tag from this PR.

@slask
Copy link
Contributor Author

slask commented Jan 25, 2022

Hi @jozkee, is there something else I need to do to finalize this PR?

@slask
Copy link
Contributor Author

slask commented Feb 7, 2022

Hi @jozkee. Friendly reminder to move this PR forward.

Copy link
Member

@jozkee jozkee left a 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.

slask added 2 commits February 7, 2022 09:39
Pipeline retrigger. Some pipelines timed out, most probably transient issues.

Fix dotnet#62606
@slask
Copy link
Contributor Author

slask commented Feb 7, 2022

@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...

@jozkee
Copy link
Member

jozkee commented Feb 7, 2022

@slask the time-outs are most likely unrelated. Just for safety, I hit re-run, let's hope they finish this time.

@jozkee jozkee merged commit 2a1b15d into dotnet:main Feb 7, 2022
@jozkee
Copy link
Member

jozkee commented Feb 7, 2022

@slask, thanks for your contribution!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 1, 2022
@jeffhandley jeffhandley removed the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Apr 26, 2022
@danmoseley
Copy link
Member

#68883

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FileSystemEventArgs.FullPath does not return a fully qualified path
6 participants