Skip to content
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

Fix for #1348, branch without commit take version from tag instead of branch name. #1743

Merged
merged 2 commits into from
Dec 13, 2019

Conversation

pi3k14
Copy link

@pi3k14 pi3k14 commented Jul 15, 2019

A start for resolving #1348.

Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add tests to make sure this change works as expected?

@stale
Copy link

stale bot commented Nov 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 14, 2019
@asbjornu asbjornu removed the stale label Nov 14, 2019
@asbjornu
Copy link
Member

I still have no good idea how to fix this.

@pi3k14
Copy link
Author

pi3k14 commented Nov 15, 2019

I still have no good idea how to fix this.

Any hint on what parts of the code that need modifications? I might have some time next week to look into this.

@asbjornu
Copy link
Member

asbjornu commented Nov 18, 2019

I'm not sure, but you might want to take a look at TrackReleaseBranchesVersionStrategy and how it behaves in relation to a git tag.

public class TrackReleaseBranchesVersionStrategy : IVersionStrategy

@pi3k14 pi3k14 changed the title First version of a testcase to present problem. Fix for #1348, branch without commit take version from tag instead of branch name. Nov 26, 2019
if (taggedSemanticVersion != null)
{
// set the commit count on the tagged ver
taggedSemanticVersion.BuildMetaData.CommitsSinceVersionSource = semver.BuildMetaData.CommitsSinceVersionSource;
// replace calculated version with tagged version only if tagged version greater or equal to calculated version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we can use semver > taggedSemanticVersion instead? as the SemanticVersion implements IComparable

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full semver compare leads to failure in some tests, eg. DevelopScenarios.CanHandleContinuousDelivery -> 1.1.0-alpha.8+1 instead of 1.1.0-alpha.7

At first sight it seems GitVersion is calculating wrong.

@arturcic
Copy link
Member

@pi3k14 I pushed some changes to you branch, can you rebase on top of master?

@arturcic
Copy link
Member

@pi3k14 the build is failing, I'll need to fix it, as it's something with the scripts, when it gets fixed you can rebase once again and we can merge

@pi3k14
Copy link
Author

pi3k14 commented Nov 27, 2019

@arturcic it seems like the build scripts got confused by me naming the branch after the original issue

@arturcic
Copy link
Member

It's something wrong only on Azure Pipelines, and other PRs have this issue. I'll try to find some time to fix the build

@arturcic
Copy link
Member

@pi3k14 the build was fixed can you rebase on top of master and we can continue?

@arturcic
Copy link
Member

@asbjornu do you mind having a look at this PR?

@arturcic arturcic merged commit 495ba8a into GitTools:master Dec 13, 2019
@arturcic
Copy link
Member

Thank you so much for your contributions, @pi3k14 👍

@pi3k14
Copy link
Author

pi3k14 commented Dec 13, 2019

You're welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants