Azure / Azure/azure-functions-core-tools
Migrate IFileSystem to TestableIO System.IO.Abstractions
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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