-
Notifications
You must be signed in to change notification settings - Fork 654
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
How to configure GitVersion to fit our needs #988
Comments
@maxraab Could you please provide a more visual example of how your Git graph looks like? A simple Web Sequence Diagram would do. |
As you can see, we have no tags directly in /cc @asbjornu |
You will need to use the feature #832 for this to work (currently only in the preview releases). For configuration (see http://gitversion.readthedocs.io/en/latest/configuration/): Mark the master branch as |
Thank you for your response. I don't get it. Is it possible to get one of these szenarios working? |
I couldn't test your scenario, but try a
|
@maxraab @DanielRose NOTE: In order to verify any changes that you make in the configuration file, you will need to clear the GitVersion cache, which you can find here: i.e. within the NOTE: This has been corrected in a newer version of GitVersion, but just wanted to point it out in case you don't see any changes in the asserted version number. |
This is exactly the configuration i've tested in Szenario2.css`: See here 2 / 5 tests will fail because:
and
It would be nice to have the branchname in the version string. |
@gep13 Thank you. I assume that every testcase will get a fresh git repository. |
Okay, if I understand those tests correctly (they are difficult to read because of all the helper methods which create and/or checkout branches, make commits, etc.): You created a branch That looks like a bug to me. |
Yep, that's the point. |
@DanielRose The problem I discovered is, that our feature branches has no branch-configuration. (It is not possible to force this in a big community). Then there is no branch-configuration found in If this default configuration would have |
There are a bunch of default configurations for various branches. You can see the current config (including all defaults) if you run @JakeGinnivan At least as far as I understand it, the feature-branches should not need |
@DanielRose As mentioned before, we are a big community with a lot of contributors and we cannot force them all to use such naming conventions like |
There is only so much that GitVersion can do in terms of recognising branches, and applying the necessary configuration to the branches. If you are not in a position to control the naming conventions that are used, then perhaps GitVersion isn't the right tool for your needs. |
@maxraab But is the entirety of this community allowed to create new branches in the main repository? Don't each individual developer have his own fork? With "everyone" allowed to do "everything" in a singular repository, I understand why it's hard to enforce law and order, but if that's the case, I'd say focus on getting everyone their own fork and do PRs from them. Then the PRs can be merged into branches following a naming convention in the main repository. Or am I misunderstanding things completely? |
Users can create branches in the main repository and push their code in. Then they open a pull request and only a core-team can review and merge them back to master. Same thing with the release branches: naming conventions can be forced and only (~30 40 members) are allowed to cherry-pick and/or merge to stable branches. You also can create a fork of every single repo and do what you want until you open a pull request. Our problem: the developers have to combine a lot of dll's from different repositories to one project/application. Sometimes dll's where picked from feature-branches for testing purposes. To check the exact versions it would be nice to have a exact assembly-version. |
@maxraab Ok, I'm going to go a bit off track here and point out two things:
I know these don't solve your immediate problem, but if my assumptions are correct, I strongly believe this is something you should take a hard look at and try to fix. It will make everyone's lives so much easier. To explain why I point this out, it's because GitVersion requires the Git repository to follow a flow to work. These flows are what I'd consider "best practice" for working with large projects on Git. They do carry with them a lot of baggage, though, like the (highly recommended) use of continuous integration, continuous deploy (or delivery), easily consumable artifacts (NuGet server), often a release manager (such as Octopus Deploy), etc. Without adopting all of the flow's inherent baggage, you're going to find yourself in a pain spot, which I believe is where you're at right now. We were there a few years ago too and it felt hopeless, but incrementally improving the process and adjusting as we saw issues and learned from others, we're finally somewhere quite comfortable. |
@asbjornu Thank you for this long explanation. We adopted some guidelines and workflows from GitLab and fit them to our needs. We have a private NuGet Server but no automatic package building. I will think about it, What's your opinion about the potential bug @DanielRose mentioned here? |
Yep, mark Also, rather than cherry pick, I suggest you get people to target their feature branches towards a release branch rather than cherry picking. Then you can just forward merge the release branch into master rather than cherry picking the other way around? But if the flow you have works, great. |
@JakeGinnivan Ok, thank you. Is it inteded?
Testcases can be found here: Test Case |
So master is building as 0.10.1, then you branch and the branch it is not 0.10.1? If that is the case, that's a bug. Should be able to verify with a simple test like this:
What is the last assert actually in this case? (I have to head off for a bit now so can't actually write this test for real) |
I put your code into a test and fixed the errors: [Test]
public void TestJakeGinnivan()
{
using (var fixture = new EmptyRepositoryFixture())
{
fixture.MakeACommit();
fixture.BranchTo("release/0.10.0");
fixture.MakeACommit();
fixture.MakeACommit();
fixture.AssertFullSemver(_config, "0.10.0-rc.1+2");
fixture.Checkout("master");
fixture.MakeACommit();
fixture.AssertFullSemver(_config, "0.10.1-pre.1+1");
fixture.BranchTo("MyFeatureD");
fixture.AssertFullSemver(_config, "0.10.1-MyFeatureD.1+1");
}
} The test fails:
It seems to be a bug. |
Is this test still failing, @maxraab? Please test with the latest build and reopen this issue if the problem persists. |
Suppose you have a big community and many contributions. Every contribution starts with a feature branch from
master
and after it's finished gets merged back tomaster
. (Normal GitHub Flow). The main difference is the release stragegy:If a release is sheduled - a new release branch (e.g. 8-1-stable, 8-2-stable, ...) is created from current
master
. From this time only some contributions gets cherry picked frommaster
into thestable branch
. All release candidates (e.g. 8.1-rc1, 8.1-rc2, ...) where tagged on thisstable branch
.If the Version is ready to ship, the Version gets tagged but the release branch will not merged back into
master
. (To support up to 10 versions at the same time).From this time, the commits on
master
should have a version similar to: "next-version"-pre.The text was updated successfully, but these errors were encountered: