Skip to content
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

[Bug] NoFetch property not derived from buildagent when GitVersion is invoked without arguments #2439

Closed
davikor opened this issue Oct 28, 2020 · 1 comment · Fixed by #2440
Labels
Milestone

Comments

@davikor
Copy link

davikor commented Oct 28, 2020

Starting with 5.3.0 the NoFetch argument remains set false when GitVersion is being invoked without arguments. This is because the ParseArguments function checks at the beginning whether it was invoked without any arguments and then just sets some default values.

Expected Behavior

In my opinion all arguments should be set to the same value they would be set if GitVersion was invoked with at least one argument. E.g. if GitVersion is called only with parameter targetpath, NoFetch would be inferred from the buildAgent. If called without any parameters at all NoFetch would be set to false no matter what the build agents PreventFetch method says. This also applies to other parameters, e.g. the authentication would not be derived from the environment vars in case GitVersion is invoked without any arguments

Actual Behavior

Currently NoFetchremains false even if the buildagents PreventFetch function returns true when GitVersionis invoked without any arguments

Possible Fix

Remove the zero-arguments check at the beginning of the ParseArguments function. I will provide a pull request if welcome

Steps to Reproduce

invoke on a build server environment (e.g. environment variables TEAMCITY_VERSION and Git_Branch exist) one time without any arguments and the other time with unrelated argument e.g. target path and see how NoFetch is falsein the one case and true in the other.

Context

Updated from 5.2 to 5.5 and GitVersion suddenly failed because it tried to fetch data from remote

Your Environment

TeamCity 2020.1

@github-actions
Copy link

🎉 This issue has been resolved in version 5.5.1 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants