-
Notifications
You must be signed in to change notification settings - Fork 654
Allow overriding of the config file path #1691
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
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 think this looks excellent. Can you please rebase the changes on top of HEAD
of master
and force-push the changes so we get a fresh PR? I'll merge as soon as it lights up green.
Looks like I'm running into some flaky tests here? Should I drop my last commit? I think Shouldly will give you better error messages for failures if you use it this way, but it isn't related to my PR. |
@chuseman could you please rebase on top of master as there are some changes to the vsix version. |
This adds a new abstract ConfigFileLocator class, which has two implementations: * DefaultConfigFileLocator, which is the current logic (GitVersion.yml and GitVersionConfig.yaml in working and project root directories). * NamedConfigFileLocator that will only look for a specific file path (it can be a relative or absolute path). GitVersionExe has a new optional /config argument which takes a path. GitVersionTask has a new ConfigFilePath property on all inputs and is exposed via the MSBuild GitVersionConfig property. GitVersionTfsTask has a new configFilePath input.
Thanks for your contributions, @chuseman! |
I believe this feature introduced a unwanted breaking change in the GitVersionTfsTask. I believe the problem is that configFilePath is of type filePath. So if you enter something relative (or empty) Azure DevOps will always pretent the working directory. So in the GitVersion.ts the property configFilePath will always contain a value (working directory) and will result in always adding the /config param. Resulting in command below (Config file field set empty) |
@asbjornu I can test it on Monday. Is the fix available in the gitversion (preview) version (5.0.2) of the azure devops task? |
@Skoucail you can use the preview version of the task - https://marketplace.visualstudio.com/items?itemName=gittools.gitversion-preview |
If the code is merged it should be available in the preview version |
FWIW, I've verified the fix on our Azure DevOps Server 2019 instance with the preview version. The /config parameter is no longer passed unless the task specifies it. |
Same here, looks fine now. Thx for fixing @chuseman |
This adds a new abstract
ConfigFileLocator
class, which has two implementations:DefaultConfigFileLocator
, which is the current logic (GitVersion.yml
andGitVersionConfig.yaml
in working and project root directories).NamedConfigFileLocator
that will only look for a specific file path (it can be a relative or absolute path).GitVersionExe
has a new optional/config
argument which takes a path.GitVersionTask
has a newConfigFilePath
property on all inputs and is exposed via the MSBuildGitVersionConfig
property.GitVersionTfsTask
has a newconfigFilePath
input.This resolves #894.