-
Notifications
You must be signed in to change notification settings - Fork 656
Improve IFileSystem usage in the app (part 1) #4340
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code cleanup
Replaced direct file and directory operations with IFileSystem methods. This change standardizes file system interactions and simplifies dependency injection across the codebase.
Simplified the MakeAndGetTempPath method by converting it to an expression-bodied member.
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.
Copilot reviewed 12 out of 27 changed files in this pull request and generated no suggestions.
Files not reviewed (15)
- src/GitVersion.App.Tests/GitVersion.App.Tests.csproj: Language not supported
- src/GitVersion.Core/PublicAPI.Unshipped.txt: Language not supported
- src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj: Language not supported
- src/GitVersion.Core.Tests/Helpers/TestFileSystem.cs: Evaluated as low risk
- src/GitVersion.Core.Tests/Helpers/TestStream.cs: Evaluated as low risk
- src/GitVersion.Configuration/ConfigurationProvider.cs: Evaluated as low risk
- src/GitVersion.Core/Core/GitPreparer.cs: Evaluated as low risk
- src/GitVersion.App/GitVersionExecutor.cs: Evaluated as low risk
- src/GitVersion.App/ArgumentParser.cs: Evaluated as low risk
- src/GitVersion.Core/Extensions/ConfigurationExtensions.cs: Evaluated as low risk
- src/GitVersion.App.Tests/ArgumentParserTests.cs: Evaluated as low risk
- src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs: Evaluated as low risk
- src/GitVersion.Core.Tests/Helpers/GitVersionCoreTestModule.cs: Evaluated as low risk
- src/GitVersion.Core/Core/Abstractions/IFileSystem.cs: Evaluated as low risk
- src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs: Evaluated as low risk
Thank you @arturcic for your contribution! |
🎉 This issue has been resolved in version 6.1.0 🎉 Your GitReleaseManager bot 📦🚀 |
This was referenced Jul 25, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to the
GitVersion
project, primarily focusing on the integration and usage of theIFileSystem
interface across various classes and tests, as well as some refactoring and cleanup of test files.Integration of
IFileSystem
:src/GitVersion.App/ArgumentParser.cs
: AddedIFileSystem
as a dependency and replaced direct file system calls withIFileSystem
methods. [1] [2] [3]src/GitVersion.App/GitVersionExecutor.cs
: AddedIFileSystem
as a dependency and used it for directory existence checks. [1] [2] [3]Test updates and refactoring:
src/GitVersion.App.Tests/ArgumentParserTests.cs
: IntroducedIFileSystem
and replaced direct directory creation calls withIFileSystem
methods. [1] [2] [3] [4]src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs
: Refactored to remove redundant methods and usedIFileSystem
for directory creation. [1] [2]src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs
: Added a helper methodGetWorktreePath
to streamline test setup. [1] [2] [3] [4]Removal of
TestFileSystem
:src/GitVersion.Core.Tests/Helpers/GitVersionCoreTestModule.cs
: ReplacedTestFileSystem
with the actualFileSystem
implementation.src/GitVersion.Core.Tests/Helpers/TestFileSystem.cs
: Removed theTestFileSystem
class as it is no longer needed.Other changes:
src/GitVersion.App.Tests/GitVersion.App.Tests.csproj
: Removed references toTestFileSystem
andTestStream
.src/GitVersion.Configuration.Tests/Configuration/ConfigurationProviderTests.cs
: Updated test to include a check for the configuration file path.src/GitVersion.Configuration.Tests/Configuration/Extensions.cs
: Added directory existence check and creation inSetupConfigFile
extension method.src/GitVersion.Configuration/ConfigurationProvider.cs
: UsedIFileSystem
to find the Git directory.