Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 21, 2025

  • Delete PathFeatures.cs file
  • Remove PathFeatures.cs references from .csproj files (5 files)
  • Update FileSystemTest.cs to remove PathFeatures usage (3 properties)
  • Update PathTestsBase.cs to use non-legacy values in TestData_GetPathRoot_DevicePaths (5 lines)
  • Update PathTests_Windows.cs to remove conditional logic based on PathFeatures (9 usages)
  • Update zip_ManualAndCompatibilityTests.cs to remove PathFeatures usage (1 property + 1 conditional)
  • Update ProcessModuleTests.Windows.cs to remove ConditionalFact attribute (1 line)
  • Build and test affected libraries to ensure all tests pass
    • System.Runtime.Extensions.Tests: 8280 tests passed
    • System.IO.FileSystem.Tests: 8716 tests passed
    • System.IO.Compression.Tests: 1335 tests passed
    • System.Diagnostics.Process.Tests: 339 tests passed
  • Run final verification of all changes
  • Address feedback: Remove AreAllLongPathsAvailable, LongPathsAreNotBlocked, and UsingNewNormalization properties
  • Address feedback: Update outdated comment about ConditionalFact in ProcessModuleTests.Windows.cs
  • Address feedback: Remove IsUsingNewPathNormalization property from zip_ManualAndCompatibilityTests.cs
  • Address feedback: Remove redundant property wrappers in Delete.cs and replace with RemoteExecutor.IsSupported
  • Address feedback: Merge GetFullPath_Windows_UNC_Valid_LegacyPathSupport test cases into GetFullPath_UNC_Valid
  • Fix CI failure: Add typeof(RemoteExecutor) parameter to ConditionalFact attributes

Summary

Successfully removed PathFeatures.cs dead code and all its references. Replaced all conditional test attributes that depended on always-true properties with unconditional Fact/Theory attributes. Removed redundant property wrappers and merged duplicate test methods. Fixed ConditionalFact attributes to properly reference RemoteExecutor.IsSupported. All tests now assume:

  • All long paths are available (no legacy MAX_PATH limitations)
  • New path normalization is always used (no legacy path handling)
  • No conditional behavior based on runtime capabilities
Original prompt

This section details on the original issue you should resolve

<issue_title>PathFeatures.cs is dead code</issue_title>
<issue_description>PathFeatures.cs is only used in tests in target current netcoreapp app. All path features are available in current netcoreapp.</issue_description>

<agent_instructions>Please delete PathFeatures.cs and all references to it. Assume that all Path features are available and no legacy behaviors are present.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #120928


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 21, 2025
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Copilot AI changed the title [WIP] Remove PathFeatures.cs and its references Remove dead code PathFeatures.cs and assume all path features are available Oct 21, 2025
Copilot finished work on behalf of jkotas October 21, 2025 04:07
Copilot AI requested a review from jkotas October 21, 2025 04:07
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot finished work on behalf of jkotas October 21, 2025 04:36
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot finished work on behalf of jkotas October 21, 2025 05:42
Copilot AI requested a review from jkotas October 21, 2025 05:42
@davidfowl
Copy link
Member

oops, ran the workflow on the wrong PR 😄

Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot finished work on behalf of jkotas October 21, 2025 06:12
@jkotas jkotas marked this pull request as ready for review October 21, 2025 06:57
@jkotas jkotas requested review from Copilot and stephentoub October 21, 2025 06:57
@jkotas jkotas removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the obsolete PathFeatures.cs file and all references to it throughout the codebase. The PathFeatures class was only used in tests targeting current netcoreapp where all path features (long paths, new normalization) are already available. The changes eliminate dead code and conditional logic that assumed legacy path behaviors.

Key changes:

  • Deleted PathFeatures.cs and removed its references from 5 csproj files
  • Replaced conditional test attributes (ConditionalFact/ConditionalTheory) with unconditional Fact/Theory attributes where they depended on always-true path feature checks
  • Removed conditional runtime logic that branched based on path normalization capabilities
  • Merged duplicate test methods that previously existed to handle legacy vs. new path normalization

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
PathFeatures.cs Deleted obsolete file containing runtime path feature detection
System.Runtime.Extensions.Tests.csproj Removed PathFeatures.cs reference
System.IO.FileSystem.Tests.csproj Removed PathFeatures.cs reference
System.IO.FileSystem.DisabledFileLocking.Tests.csproj Removed PathFeatures.cs reference
System.IO.Compression.Tests.csproj Removed PathFeatures.cs reference
System.Diagnostics.Process.Tests.csproj Removed PathFeatures.cs reference
PathTests_Windows.cs Removed conditional logic based on legacy path normalization and merged duplicate test cases
PathTestsBase.cs Updated test data to use non-legacy expected values
FileSystemTest.cs Removed property wrappers for PathFeatures methods
Delete.cs Replaced redundant property wrappers with direct RemoteExecutor.IsSupported checks
zip_ManualAndCompatibilityTests.cs Removed PathFeatures usage and converted conditional test to unconditional
ProcessModuleTests.Windows.cs Converted ConditionalFact to Fact and updated comment
Various test files Converted ConditionalFact/ConditionalTheory to Fact/Theory

@dotnet-policy-service
Copy link
Contributor

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

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

@copilot please apply my suggestions to fix following CI failure:

[FAIL] System.IO.Tests.Directory_Delete_str_bool.ExtendedDirectoryWithSubdirectories
System.InvalidOperationException : An appropriate member 'IsSupported' could not be found. The conditional method needs to be a static method, property, or field on the type System.IO.Tests.Directory_Delete_str or any ancestor, of any visibility, accepting zero arguments, and having a return type of Boolean.

[FAIL] System.IO.Tests.Directory_Delete_str_bool.LongPathExtendedDirectory
System.InvalidOperationException : An appropriate member 'IsSupported' could not be found. The conditional method needs to be a static method, property, or field on the type System.IO.Tests.Directory_Delete_str or any ancestor, of any visibility, accepting zero arguments, and having a return type of Boolean.

Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot please apply my suggestions to fix following CI failure:

...

Applied the suggested fixes to add typeof(RemoteExecutor) parameter to both ConditionalFact attributes. (commit 6c4e3a5)

Copilot AI requested a review from adamsitnik October 21, 2025 08:14
Copilot finished work on behalf of adamsitnik October 21, 2025 08:14
@stephentoub stephentoub merged commit 9bb1d21 into main Oct 21, 2025
84 checks passed
@stephentoub stephentoub deleted the copilot/remove-dead-code-pathfeatures branch October 21, 2025 10:44
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PathFeatures.cs is dead code

5 participants