-
Notifications
You must be signed in to change notification settings - Fork 654
[ISSUE]: System.ArgumentOutOfRangeException when IncrementStrategy is Inherit #4554
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
Can you write an integration test like: GitVersion/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs Lines 183 to 190 in 80c8b6c
Generally, in some situation it is not possible to determine the parent branch (for the Mainline version strategy). From the algorithm point of view it is not solvable. Are you using the TrunkBased/preview1 workflow? If yes this error should not happen. If no your configuration might be wrong. |
Reproduced with v6.3.0 and Only happens in (ADO) PR merge branch, not source branch. Azure pipeline task reports Our (temporary) solution was to downgrade to v5 and switch to |
How it might be possible to analyze your issue and find a solution if you don’t even provide a sample repository or steps to reproduce? |
I believe we are seeing something similar. Originally happened in remote gitlab pipeline (we assume, all we see there is the error code), but it is reproduce-able locally on the same branch. Previous to this, we noticed that version was no longer being calculated (with no other changes to gitversion or its config, it just suddenly stopped working, with version being pinned to the last tag instead), but we hadn't had time to research that yet. I suspect this might be same issue.
We are currently using gitversion via docker ( GitVersion.yml workflow: TrunkBased/preview1
strategies:
- Mainline
# Branch-specific configuration
branches:
main:
increment: Patch
label: null
regex: ^main$
is-main-branch: true
is-release-branch: true
pre-release-weight: 0
feature:
regex: ^(?!main$)(?<BranchName>.+)$
increment: Inherit
label: "{BranchName}" Error
|
The information about how to reproduce this error is still not provided. If you cannot provide the repository then please create a hellow world repository or create an integration test or provide simple git commands (I don't care). If you or other communirty members are not able to do so, I'm going to close this issue. Thank you for your understanding. |
@HHobeck I'm currently on holiday. So keep the bug open for a while to give me some time to create an integration test. Even if it's a config issue on my side, I can still learn from it. |
Prerequisites
GitVersion package
GitVersion.Tool
GitVersion version
6.3.0
Operating system
N/A
What are you seeing?
Sometimes, pull request builds fail for GitVersion with the following exception:
What is expected?
GetEffectiveConfiguration should keep looking for a parent branch configuration as long as the IncrementStrategy of the branch is Inherit.
https://github.com/GitTools/GitVersion/blob/main/src/GitVersion.Core/Extensions/ConfigurationExtensions.cs#L19-L29 #
Steps to Reproduce
I think it happens when we merge one feature branch into another feature branch.
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
The text was updated successfully, but these errors were encountered: