-
Notifications
You must be signed in to change notification settings - Fork 656
Extend git flow complex example to post merge and rebase behaviour #4585
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
base: main
Are you sure you want to change the base?
Extend git flow complex example to post merge and rebase behaviour #4585
Conversation
1586c8e
to
45f96cc
Compare
@HHobeck, I think these changes look reasonable. What are your thoughts on this? |
@@ -7,7 +7,7 @@ namespace GitVersion.Core.Tests.Helpers; | |||
|
|||
public class TestBase | |||
{ | |||
public const string MainBranch = "main"; | |||
public const string MainBranch = RepositoryFixtureBase.MainBranch; |
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.
#4589 Magic strings >> BranchConfigurationKey.
fixture.MakeACommit( | ||
"feature 2 additional commit after original feature has been merged to develop " + System.Environment.NewLine + | ||
$"and release/1.2.0 has already happened >> {fullSemver}" + | ||
"Problem #1: 1.3.0-f2.1+0 is what I observe when I run dotnet-gitversion 6.3.0 but in the repo the assertion is 1.3.0-f2.1+1" + |
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.
Problem 1:
- 1.3.0-f2.1+1 is what the test asserts
- 1.3.0-f2.1+0 is what I observe when I run dotnet-gitversion 6.3.0
$"and release/1.2.0 has already happened >> {fullSemver}" + | ||
"Problem #1: 1.3.0-f2.1+0 is what I observe when I run dotnet-gitversion 6.3.0 but in the repo the assertion is 1.3.0-f2.1+1" + | ||
"After rebase 1.3.0-f2.1+3 is both what the test asserts and what I observe when I run dotnet-gitversion 6.3.0." + | ||
"Problem #2: I expected to get the same before and after the rebase." + |
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.
Problem 2:
- Before rebase 1.3.0-f2.1+1 is what the test asserts (but not what dotnet-gitversion produces - see Problem 1).
- After rebase 1.3.0-f2.1+3 is what both tests and dotnet-gitversion 6.3.0 produce.
I'd have anticipated1.3.0-f2.1+1 both before and after rebase, in this specific scenario.
var yaml = new ConfigurationSerializer().Serialize(concreteConfig); | ||
const string fileName = "GitVersion.yml"; | ||
var filePath = FileSystemHelper.Path.Combine(r.Info.Path, "..", fileName); | ||
File.WriteAllText(filePath, yaml); |
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.
Intentionally writing out the GitVersion.yml to demonstrate inconsistency between UnitTest version calculation and running dotnet-gitversion from the commandline. Refer to 2 problems in commentary.
Description
Extend the GitFlowComplexExample to document unexpected post merge and rebase behaviour.
Fix the integration test fixtures so they can accept a "master" main branch instead of hardcoding "main".
Related Issue
Motivation and Context
I have been really struggling to get GitVersion to work post the v6 changes so I checked out the repo to run through sample scenarios to try and adapt but I either need more documentation to understand what the new behaviour is or the new behaviour is possibly unintended.
Rather than just rely on the Integration tests with injected configuration, I wanted to be able to revisit the repository that is created by the integration test and I observe
How Has This Been Tested?
GitFlowComplexExample
Screenshots (if appropriate):
Checklist:
This is a WIP proposal to document a problem & ask for help; if I get direction I'm happy to update the PR as offered/advised.