Mainline in 6.0.0 with default configuration values throws #4236
-
Prerequisites
GitVersion packageGitVersion.Tool, GitVersion.MsBuild GitVersion version6.0.0 Operating systemLinux What are you seeing?Using mainline strategy, when building on github in a PR, it says:
And a bit further I get:
I am using the default configuration except for adding mainline strategy. What is expected?I expect default configuration not to throw.
Steps to ReproduceBuild a pull request on GitHub with this configuration:
RepositoryFixture TestNo response Output log or link to your CI build (if appropriate).No response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
That is exactly the magic of using branch configuration with the inheritance option. GitVersion is taking (inherits) the value from the parent branch. From your exception output I can see that gitversion complains about, that your feature branch is orphaned. Means you have no parent branch like main which is mandatory. Please create an integration test or give some examples by e.g. defining git commands to reproduce your scenario. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hi, here is a test that can reproduce the issue. Took me a while to make it as I did not exactly know how to get in the situation.
This crash in the same manner as described in the bug. Here are git commands to create the repo
It assumes that you have this GitVersion.yml file in the directory already
So now that I understand the cause better, I guess you will say we should not have merged main into a branch ... It was before we started using gitversion (and mainline), and not the brightest idea imho. |
Beta Was this translation helpful? Give feedback.
-
Actually this configuration makes no sense in my opinion: strategies:
- Fallback
- ConfiguredNextVersion
- MergeMessage
- TaggedCommit
- TrackReleaseBranches
- VersionInBranchName
- Mainline The mainline version strategy can be seen as a strategy which already includes most of the other strategies. But with the goal not to be dependent on tags. Please try the following configuration instead: strategies:
- ConfiguredNextVersion
- Mainline |
Beta Was this translation helpful? Give feedback.
-
Thanks for explaining what the configuration should be. However even with that new configuration it still does crash. (Updated previous comment to add missing a in yaml) |
Beta Was this translation helpful? Give feedback.
Thank you very much providing the integration test. Indeed merging back from main to the development branch can be problematic:
Anyway I think your use case is different. If you use the following workflow it works like expected: