-
Notifications
You must be signed in to change notification settings - Fork 654
NextVersion.txt and GitVersionConfig.yaml support for dynamic repositories #352
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
NextVersion.txt and GitVersionConfig.yaml support for dynamic repositories #352
Conversation
…ories to support NextVersion.txt
obligatory "can this be tested?"... |
I knew that question would come. As always, time and resources are limited, but I understand. |
:) think we r on the same page. your call. is this worth the effort to test or not? |
Not really worth the effort, but will add them anyways. @JakeGinnivan already put in effort to make the repositories offline. I can add a few files to test it. |
@GeertvanHorrik thanks |
Unit tests added. I had to improve some generic methods as well to support creation of dynamic files in fixtures. I couldn't run because I get a invalid read/write on memory access thing, I assume this has to do with the latest update to libgit2sharp, but maybe you can double check / verify? |
can u rebase? |
i know how much u love to use git ;) |
Not sure how I should do that once I have committed. I hope I don't have to revert commits? |
i can manually merge if it is too much hassle. just tell me if u dont have time |
I am searching for info, but cannot find the right stuff. I think I should have chose rebase instead of merge when I pushed, but once it is already pushed I don't know how to rebase. Happy to do it, just need some guidance (link?). |
$ git rebase pr/NextVersionForDynamicRepositories |
I have rebased on my master branch now. Is that better? |
github says still no automerge |
…into pr/NextVersionForDynamicRepositories Conflicts: GitVersionExe.Tests/GitPreparerTests.cs
Ah, just had to do a "git pull upstream master" :-) |
ok the merge is OK but the build server says no. is it building on your machine? |
What does the build serve say now? |
|
|
Somehow I either get this:
-or-
Somehow something is screwed on my system. I tried deleting all bin/obj, but doesn't seem to help either. Continuing my quest... |
@GeertvanHorrik perhaps something to do with mismatching libgit files? although not sure how that could happen? |
I deleted packages/bin/obj several times:
|
do u have a stack trace? |
|
btw. I am using x86 2.6.4 NUnit runner in R#. |
I had to explicitly set the platform of R# unit test runner to x86. |
The "LibGit2Sharp.EmptyCommitException : No changes; nothing to commit." is very random. Sometimes it works, sometimes it doesn't. Alsmost looks like async code that is not being awaited. Need to investigate the repository fixture. |
Adding this to the fixture solves it:
I don't want to know what's happening under the hood ;-) |
@GeertvanHorrik i tried explicit 2.6.3 and x86 and could not repro. if u switch back to to 2.6.3 does it still happen? |
@nulltoken can u weigh in here? re |
"number of inspection errors is too large: 1 " What's that? |
@GeertvanHorrik resharper inspections |
@GeertvanHorrik runs r# inspections on the build server
Is the error |
Cool, thanks. How do you run R# on the build server. Is it a TC thing or separate executable? |
File.WriteAllText(randomFile, Guid.NewGuid().ToString()); | ||
|
||
// GHK: 2015-01-18: I know it's very ugly, but somehow we need to retry here otherwise "there is nothing to commit" | ||
int retryCount = 3; |
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.
make this a var
it is built into TC. but there is a command line |
File.WriteAllText(randomFile, Guid.NewGuid().ToString()); | ||
|
||
// GHK: 2015-01-18: I know it's very ugly, but somehow we need to retry here otherwise "there is nothing to commit" | ||
var retryCount = 3; |
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.
@JakeGinnivan @nulltoken thoughts on how to avoid doing this retry?
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 changed config based versioning branch to increment the commit time for each commit - 14487a0#diff-c7ff189f687fa58758611ef26120e6dcR8
Not sure if this would fix the issue.
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.
@SimonCropp @JakeGinnivan EmptyCommitException
is raised when the tree about to be committed matches the tree from the parent commit. This means that no modification has been detected. My guess is that is related to a known issue in libgit2 (see libgit2/libgit2sharp#688).
Meanwhile, in order to work around this, just make sure that your files are of random length
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 already implemented random content, but we can also add random length as well. Doesn't libgit see a difference when the file contents are different but equal length?
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.
@GeertvanHorrik Time is also a variable of the equation. See libgit2/libgit2sharp#688 (comment)
@GeertvanHorrik You can find it here: https://chocolatey.org/packages/resharper-clt |
Thanks for all the info, will incorporate that into all my builds tomorrow as well. |
If you are interested, the ChocolateyGUI build process for both InspectCode and DupFinder starts here: I create a very basic HTML file from the generated XML file (this is really what TeamCity does for you automagically) to make deciphering the output a bit easier. Feel free to borrow and extend them if you want. |
Have manually merged into #364 Also fixed the retry hack by appending a changing number of |
See #351