codingChris
codingChris

Reputation: 697

GitVersion StackOverflow on Pull Requests

I've run across an issue with our on-prem TFS2017 builds. We have a project with a GitVersion task that will not find the version when using a pull request. I can build the branch itself without issue, but the pull request continues until GitVersion.exe exits with a stackoverflowexception.

I've tried ignoring commits using "commits-before:" and a variety of branch configuration changes for Pull Requests to no avail.

The following occurs in the log over and over until the exception...

Starting task: GitVersion  
Set workingFolder to default: D:\xxx\tasks\GitVersion\3.6.5   
Executing the powershell script: D:\xxx\tasks\GitVersion\3.6.5\GitVersion.ps1  
Current Directory:  D:\xxx\tasks\GitVersion\3.6.5 D:\xxx\_work\13\s  
Invoking GitVersion with D:\xxx\_work\13\s /output buildserver /nofetch /updateassemblyinfo true  
D:\xxx\tasks\GitVersion\3.6.5\GitVersion.exe D:\xxx\_work\13\s /output buildserver /nofetch /updateassemblyinfo true  
INFO [02/13/17 15:43:21:08] Working directory: D:\xxx\_work\13\s  
INFO [02/13/17 15:43:21:09] IsDynamicGitRepository: False  
INFO [02/13/17 15:43:21:11] Returning Project Root from DotGitDirectory: D:\xxx\_work\13\s\.git - D:\xxx\_work\13\s  
[02/13/17 15:43:21:11] Running on Windows.  
INFO [02/13/17 15:43:21:11] Applicable build agent found: VsoAgent.  
INFO [02/13/17 15:43:21:11] Branch from build environment: refs/pull/2336/merge  
INFO [02/13/17 15:43:40:31] IsDynamicGitRepository: False  
INFO [02/13/17 15:43:40:31] Returning Project Root from DotGitDirectory: D:\xxx\_work\13\s\.git - D:\xxx\_work\13\s  
INFO [02/13/17 15:43:40:31] Project root is: D:\xxx\_work\13\s  
INFO [02/13/17 15:43:40:31] DotGit directory is: D:\xxx\_work\13\s\.git  
INFO [02/13/17 15:43:40:36] IsDynamicGitRepository: False  
INFO [02/13/17 15:43:40:36] Returning Project Root from DotGitDirectory: D:\xxx\_work\13\s\.git - D:\xxx\_work\13\s  
INFO [02/13/17 15:43:40:36] Begin: Loading version variables from disk cache  
INFO [02/13/17 15:43:40:36] Cache file D:\xxx\_work\13\s\.git\gitversion_cache\8BD4.yml not found.  
INFO [02/13/17 15:43:40:36] End: Loading version variables from disk cache (Took: 0.00ms)  
INFO [02/13/17 15:43:40:36] IsDynamicGitRepository: False  
INFO [02/13/17 15:43:40:36] Returning Project Root from DotGitDirectory: D:\xxx\_work\13\s\.git - D:\xxx\_work\13\s  
INFO [02/13/17 15:43:40:52] Using latest commit on specified branch  
INFO [02/13/17 15:43:40:52] Begin: Attempting to inherit branch configuration from parent branch  
INFO [02/13/17 15:43:40:58] HEAD is merge commit, this is likely a pull request using devops/gitver-testingv5 as base  
INFO [02/13/17 15:43:40:66] Begin: Finding branch source  
INFO [02/13/17 15:43:40:70] Begin: Found merge base of ded0 against hotfix/white-42630-customerrors-fix  
INFO [02/13/17 15:43:40:72] End: Found merge base of ded03 against hotfix/white-42630-customerrors-fix (Took: 15.63ms)  
INFO [02/13/17 15:43:40:72] Begin: Found merge base of ad42 against master  
INFO [02/13/17 15:43:40:72] Merge base was due to a forward merge, moving to next merge base  
INFO [02/13/17 15:43:40:72] End: Found merge base of ad42 against master (Took: 0.00ms)  
INFO [02/13/17 15:43:40:73] Begin: Found merge base of 665d against Release/1.47.0  
INFO [02/13/17 15:43:40:73] Merge base was due to a forward merge, moving to next merge base  
INFO [02/13/17 15:43:40:73] End: Found merge base of 665d against Release/1.47.0 (Took: 0.00ms)  
INFO [02/13/17 15:43:40:73] Begin: Found merge base of 05651 against Release/1.47.3  
INFO [02/13/17 15:43:40:73] End: Found merge base of 0565 against Release/1.47.3 (Took: 0.00ms)  
INFO [02/13/17 15:43:40:73] Begin: Found merge base of ab58 against Release/1.47.4  
INFO [02/13/17 15:43:40:73] End: Found merge base of ab58 against Release/1.47.4 (Took: 0.00ms)  
INFO [02/13/17 15:43:40:73] Begin: Found merge base of 4984 against Release/1.48.0  
INFO [02/13/17 15:43:40:73] Merge base was due to a forward merge, moving to next merge base  
INFO [02/13/17 15:43:40:73] End: Found merge base of 4984 against Release/1.48.0 (Took: 0.00ms)  
INFO [02/13/17 15:43:40:73] Begin: Found merge base of ad42 against Release/1.49.0  
INFO [02/13/17 15:43:40:73] Merge base was due to a forward merge, moving to next merge base  
INFO [02/13/17 15:43:40:75] End: Found merge base of ad42 against Release/1.49.0 (Took: 15.62ms)  
INFO [02/13/17 15:43:40:80] Begin: Found merge base of d782 against Release/2016-07-21_Release  
INFO [02/13/17 15:43:40:80] End: Found merge base of d782 against Release/2016-07-21_Release (Took: 0.00ms)  
INFO [02/13/17 15:43:40:80] Begin: Found merge base of 6286 against Release/2016-08-04_Release  
INFO [02/13/17 15:43:40:80] End: Found merge base of 6281 against Release/2016-08-04_Release (Took: 0.00ms)  
INFO [02/13/17 15:43:40:81] Begin: Found merge base of bfb7 against Release/2016-08-18_Release  
INFO [02/13/17 15:43:40:81] Merge base was due to a forward merge, moving to next merge base  
INFO [02/13/17 15:43:40:81] Merge base was due to a forward merge, moving to next merge base  
INFO [02/13/17 15:43:40:81] End: Found merge base of bfb7 against Release/2016-08-18_Release (Took: 0.00ms)  
INFO [02/13/17 15:43:40:81] Begin: Found merge base of d7a5 against Release/2016-09-01_Release  
INFO [02/13/17 15:43:40:81] Merge base was due to a forward merge, moving to next merge base  
INFO [02/13/17 15:43:40:83] End: Found merge base of d7a against Release/2016-09-01_Release (Took: 15.63ms)  
INFO [02/13/17 15:43:40:83] Begin: Found merge base of 425c against Release/2016-09-15_Release  
INFO [02/13/17 15:43:40:83] End: Found merge base of 425c against Release/2016-09-15_Release (Took: 0.00ms)  
INFO [02/13/17 15:43:40:83] Begin: Found merge base of f9df against Release/2016-09-29_release  
INFO [02/13/17 15:43:40:83] End: Found merge base of f9df against Release/2016-09-29_release (Took: 0.00ms)  
INFO [02/13/17 15:43:40:84] Begin: Found merge base of 8b07 against Release/2016-10-07_Release  
INFO [02/13/17 15:43:40:84] End: Found merge base of 8b07 against Release/2016-10-07_Release (Took: 0.00ms)  
INFO [02/13/17 15:43:40:84] Begin: Found merge base of 9be6 against Release/2016-10-13_release  
INFO [02/13/17 15:43:40:84] End: Found merge base of 9be6 against Release/2016-10-13_release (Took: 0.00ms)  
INFO [02/13/17 15:43:40:84] Begin: Found merge base of 1e90 against Release/2016-10-27_release  
INFO [02/13/17 15:43:40:84] End: Found merge base of 1e90 against Release/2016-10-27_release (Took: 0.00ms)  
INFO [02/13/17 15:43:40:84] Begin: Found merge base of 64f4 against Release/2016-11-10_Release  
INFO [02/13/17 15:43:40:84] End: Found merge base of 64f4 against Release/2016-11-10_Release (Took: 0.00ms)  
INFO [02/13/17 15:43:40:86] End: Finding branch source (Took: 203.13ms)  
INFO [02/13/17 15:43:40:86] Begin: Getting branches containing the commit ad42.  
INFO [02/13/17 15:43:40:86] Trying to find direct branches.  
INFO [02/13/17 15:43:40:86] No direct branches found, searching through tracked branches.  
INFO [02/13/17 15:43:40:87] End: Getting branches containing the commit ad42. (Took: 15.63ms)  
INFO [02/13/17 15:43:40:87] Found possible parent branches:   
WARN [02/13/17 15:43:40:91] Failed to inherit Increment branch configuration, no branches found.  
Falling back to feature/merge-rc-to-master branch config

Upvotes: 2

Views: 2397

Answers (3)

ManiVI
ManiVI

Reputation: 590

If it helps any

I had similar issue, but in AZ Devops git repository.

In my gitVersion.yml under master branches section I updated increment: Inherit to increment: Patch

Upvotes: 0

codingChris
codingChris

Reputation: 697

So based off of this comment on github, I changed the Inheritance to None for pull requests in the global config. This didn't solve the issue but it did make me realize that every iteration of the versioning attempt led back to this branch feature/merge-rc-to-master and its config.

After attempting to do a pull request with that branch and seeing the same issue, we deleted the branch (the PR had been abandoned and the code was previously added to master). All PRs are now working again.

Upvotes: 2

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31075

If I understand correctly, you are using GitVersion extension and enable "Automatically build pull requests" branch policy like screenshot below:

enter image description here

I have created a build definition with GitVersion task, when create a new pull request, the build is queued without issue. You may compare my settings with yours and try a new build.

enter image description here

enter image description here

If there is misunderstanding, please provide detailed steps to reproduce your issue.

Upvotes: 0

Related Questions