Azure / Azure/azure-functions-core-tools

Migrate IFileSystem to TestableIO System.IO.Abstractions

Open
#5,561 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement v5
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
6d 7h
Merged PRs (30d)
16

Description

### Description

Replace the custom `IFileSystem` abstraction in `src/Func/Common/` with [TestableIO System.IO.Abstractions](https://www.nuget.org/packages/TestableIO.System.IO.Abstractions) and its test helpers package. Benefits:

- Standardizes on the same abstraction used in other Azure Functions projects
- Eliminates the need to test our own `PhysicalFileSystem` implementation
- Leverages TestableIO's `MockFileSystem` in tests instead of hand-rolled fakes

The custom `IFileSystem` currently has methods not covered by TestableIO (archive extraction, SHA-256 hashing). These should move to a separate `IArchiveService` or similar interface.

Consumers to migrate: `CliUpdater`, `UserProfileSource`, `ProjectProfileSource`, `ProjectProfileConfigStore`, `RemoteProfileSource`, and their tests.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the custom IFileSystem abstraction in src/Func/Common/ and the listed consumers: CliUpdater, UserProfileSource, ProjectProfileSource, ProjectProfileConfigStore, and RemoteProfileSource. Compare their tests with TestableIO System.IO.Abstractions and its test helpers, then migrate the consumers and tests so MockFileSystem replaces hand-rolled fakes and archive extraction and SHA-256 hashing have a separate service interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.