-
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
Resolving Pull Requests in TeamCity context #32
Resolving Pull Requests in TeamCity context #32
Conversation
I've started to work on fixing #31. In order to not introduce any regression, I've chosen to first cover the existing In order to work against a coherent repo, I've reproduced the layout of the describe repo in the article A usccesssful Git branching model and created a test asbm test repository. Using the existing code, I've covered the retrieval of a version from the existing Master/Develop branches and from a new Feature. I can't make the test covering the creation of a new Hotfix branch pass (most probably because I don't completely understand what's the lifecycle of a hotfix branch). I've reproduced the behavior that one can observe in TeamCity when dealing with a pull request pointed at by a detached HEAD. I'm going to go further with this, but In order to do it correctly, I'd need you to help me
FWIW I'll rebase those new tests to come so that they appear before the future refactoring. |
@andreasohlund I've fixed this. The hotfix is created from master and named This is still failing with the following message
Creating an annotated tag named
|
You need to name the tag 1.0.2-Beta1 @SimonCropp didn't we remove this requirement? Sent from my iPhone
|
Some more background on that tag requirement: We couldn't find a stable way to count the "number of commits since the hotfix branch was created" so we enforced a tag pointing to the branch point. Ie tag= 1.0.2-Beta1 => first build == 1.0.2-Beta1 and as more commit are added 1.0.2.Beta1.NumberOfCommitsAheadOfTHeTag That said we agreed to relax this and just do a 1.0.2-Alpha0 for the first one and then let the users tag as needed. |
So I guess if you have any ideas on how we can reliably count number of commits since the branch got created without using the reflog you're our hero! |
@andreasohlund The hotfix test now pass. Thanks for the support!
I'm not sure if that's what you're after, but I've added 56d953e which performs this count in the hotfix branch. Maybe have you met some more complex cases where that wouldn't work? If that's the case, I'd be interested if you could share those with me. |
Ifaik(simon?) we had issue when we lost count if a release branch was merged back to develop before the release was completed. This obviously is no issue for hotfix branches Sent from my iPhone
|
@SimonCropp can you review and pull? |
This one is still a WIP. It's not ready to be merged yet. #36 should be ready to be reviewed, though. |
Sorry, got the numbers mixed up:) On Thu, Nov 21, 2013 at 7:47 PM, nulltoken notifications@github.com wrote:
|
Ok, so I've been thinking a bit about this. Below my current proposal: Proposed changes
Those changes should lead to the following benefits:
|
Another option would be to fail if we find two refs pointing to the commit being built. Although quite unlikely, this may occur, for instance, if two pull requests are opened targeting the same commit. Maybe failing in this case would be more "safe" rather than generating a potentially wrong version... |
Sounds good!! Sent from my iPhone
|
Refer to http://nvie.com/posts/a-successful-git-branching-model/ for a high level view of this repository layout
…n a TeamCity agent
Target repository should contain 'master' and 'develop' branches.
Also make FeatureVersionFinder.FindFirstCommitOnBranch() not rely on the ref log to identify the first commit of the feature branch.
Local branches "develop" and "master" are expected to always exist. They're dynamically recreated from the fetched remote tracking branches when GitFlowVersion is being run on a TeamCity agent.
So I think this should now be ready for review
Note: Some tests previously relying on MockRepository have been rewritten in order to benefit from built-in LibGit2Sharp capabilities (identification of ancestor, for instance). Things to maybe consider later:
|
Regarding relaxing that tagging requirement: #33 |
Raised and issue for throwing when the branch type can't be detected |
Resolving Pull Requests in TeamCity context
@nulltoken seems like there is test failures on the buildserver http://builds.particular.net/viewLog.html?buildId=28556&buildTypeId=GitFlowVersion_1Buil |
Can you please revert this merge while I investigate? Off the top of my head:
|
I've enabled pull building and GH feedback now |
Awesome!
Those failures are now fixed by #45 |
Fix #31