-
Notifications
You must be signed in to change notification settings - Fork 654
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
Make sure custom configuration file path is returned when custom configuration is set #4483
base: main
Are you sure you want to change the base?
Conversation
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.
I have reviewed your code changes.
src/GitVersion.Configuration.Tests/Configuration/CustomConfig.yaml
Outdated
Show resolved
Hide resolved
src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs
Outdated
Show resolved
Hide resolved
src/GitVersion.Configuration.Tests/Configuration/ConfigurationFileLocatorTests.cs
Outdated
Show resolved
Hide resolved
@kucuk-furkan please check why the the tests fail on ubuntu |
@arturcic i didn't fix it on purpose to ask this. I shouldn't be the decider i think. I'm just a user of this tool and try to help fix my issue. Tests fails because of this Either i can remove those tests too or put back case insensivity support back. What should i do? Someone who responsible for this project tell me what to do. I think leaving managing case sensivity to OS is better choice. But someone opened this as an issue then fixed it. Which direction should i go? |
The case insensitive should be kept for the default file names, for the custom config file probably better to leave it to the OS |
@kucuk-furkan please make sure you do rebase of your branch on top of |
…iguration is set Introduce a new test method `ReturnConfigurationFilePathIfCustomConfigurationIsSet` in `ConfigurationFileLocatorTests.cs` to verify custom config file handling. Update `GitVersion.Configuration.Tests.csproj` to copy `Configuration/CustomConfig.yaml` to the output directory. Enhance `GetConfigurationFile` method in `ConfigurationFileLocator.cs` to return the custom config file path if set and exists. Add `CustomConfig.yaml` with various versioning settings.
@arturcic i think its ready now. Tests looks fine. I rebased my fork and for cleaner look, i squashed my commits. |
Description
In this pr,
/config
argument usage controlled and issue when using it fixed.ReturnConfigurationFilePathIfCustomConfigurationIsSet
inConfigurationFileLocatorTests.cs
toverify custom config file handling.
GitVersion.Configuration.Tests.csproj
to copyConfiguration/CustomConfig.yaml
to the output directory.GetConfigurationFile
method inConfigurationFileLocator.cs
to return the custom config file path if set and exists.CustomConfig.yaml
with various versioning settings.Related Issue
Resolves #4480
Motivation and Context
This bugfix resolves #4480 issue. In earlier changes there is a change to how should tool locating configuration files. It cause a problem if
/config
arguments is used. Now if its used and configuration file is presents, locator returns custom configuration file path directly.This isn't a problem before this change merged. In dotnet Path.Combine method handles if path is rooted automatically. But with this pr, tool stops using Path.Combine and starts directly looking under givin directory path. For further information, you can check this Microsoft documentation. In this documentation; we are interested with combine method's examples section - path1 and path3 combine example -.
How Has This Been Tested?
All existing tests pass.
New tests added.
Checklist: