-
Notifications
You must be signed in to change notification settings - Fork 652
Dynamic Repository with GitHubFlow throws an exception #336
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
Comments
I've seen that before. I got around it by removing the need for a dynamic repository by ensuring it's been fully checked out by the build server and omitting the Definitely is a bug that needs fixing though. |
I encountered this on a TeamCity build agent (server) in combination with server side checkout.
After this patch the code was able to grab NextVersion.txt from the TeamCity checkout directory on the agent. |
I also reported this same bug under #101 |
Dynamic repositories should support NextVersion.txt in the root of the repository (I use it all the time with a custom build): |
@MacDennis76 - please can you try again with the latest release, this should now be working nicely. |
Tested with 2.0.1 release. Fixed! |
I am testing the Dynamic Repository functionality in combination with GitHubFlow and the latest release of GitVersion 2.0.0
From the command line:
gitversion /url https://stash.test.nl/customer/project/repo.git /b feature-TOHISP-91 /u user /p passw
Result:
Trying to check out 'NextVersion.txt'
Working directory: D:\test_dynamicrepository
Running against branch: feature-TOHISP-91
GitHubFlow version strategy will be used
An unexpected error occurred:
System.ArgumentNullException: Value cannot be null.
Parameter name: path1
at System.IO.Path.Combine(String path1, String path2)
at GitVersion.NextVersionTxtFileFinder.TryGetNextVersion(SemanticVersion& semanticVersion) in c:\BuildAgent\work\68ea6bfb44e5afb\GitVersionCore\GitHubFlow\NextVersionTxtFileFinder.cs:line 19
at GitVersion.NextSemverCalculator.d__2.MoveNext() in c:\BuildAgent\work\68ea6bfb44e5afb\GitVersionCore\GitHubFlow\NextSemverCalculator.cs:line 62
at System.Collections.Generic.List
1..ctor(IEnumerable
1 collection)at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at GitVersion.BuildNumberCalculator.GetBuildNumber(GitVersionContext context) in c:\BuildAgent\work\68ea6bfb44e5afb\GitVersionCore\GitHubFlow\BuildNumberCalculator.cs:line 26
at GitVersion.Program.Run()
It fails at:
public bool TryGetNextVersion(out SemanticVersion semanticVersion)
{
var filePath = Path.Combine(repositoryDirectory, "NextVersion.txt");
The repositoryDirectory is equal to null. The reason seems to be that the dynamic repository is a bare repository. This variable is set earlier on to:
context.Repository.Info.WorkingDirectory
WorkingDirectory is part of LibGit2Sharp.
From their code:
///
Is this a known issue?
The text was updated successfully, but these errors were encountered: