-
Notifications
You must be signed in to change notification settings - Fork 654
WIP: Continuous deployment and delivery versioning mode #325
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
Conversation
I thought one of the version number variables had number of commits as the fourth build number already?
|
@robdmoore they do, but say I want release branches to do that and master to have proper semver, now my build scripts need to know what branch I am on. Configuration seems the right place for this |
Yep, agreed for that scenario :)
|
@yannisgu Looking at this, we need to change the yaml. Maybe:
Then on the Config we have:
|
@JakeGinnivan yep I see, we need to be more flexible. Is your goal to completly abstract away the "version finders"? So that there would only be one branch finder which calculates the version depending on the matching branch configuration? Then there would be one big default configuration for each branch, which reflects the current behavior? |
@yannisgu yep exactly right. My idea is that we have a bunch of version strategies, then configuration. So the main version calculation function would be:
In my head this would work. But have not actually spiked it out to see if my simplistic view would actually work. |
And branchCOnfiguration would be simply:
And we populate the list with defaults, overriding values which have been specified in config |
Okey I see. This sounds like a lot of refactoring 😄
Hmm is the mode-handling really in the variable provider? |
Instead of a list I think a dictionary is better for the branches key: https://github.com/ParticularLabs/GitVersion/pull/325/files#diff-5779d04f6f560a78b6aef819b4288a9aR71 |
The semver either way is Also, variables like SemVer will always stay as the SemVer. it is things like NuGet version etc that will be affected.
The branch prefix is a regex, we should append |
Given a branch "feature/BRIKKS-1337" GitVersion (GitFlow) will generate a PreReleaseTag with: with a broken output: I'll guess this PR will handle the case above? |
@orjan A pr and a test showing the new behaviour would be awesome. Thanks |
@JakeGinnivan I've submitted a PR trying to explain my issue: |
As discussed #323 GitVersion should support different versioning modes which can be configured in the GitVersionConfig.yaml.
The modes are continuous deployment and continuous delivery.
As @JakeGinnivan says:
At the moment the only difference is the pre-release tag. In continuous delivery the scheme is
<configured tag>.1
or if there is an applicable tag<last-tag-name>-<last-tag-number>+1
.In continuous deployment the scheme is
<configured tag>.<nr of commits>
What is still open:
CurrentBranchConfig
property or maybe even find a better place for this property than thecontext
Happy to see your comments and thoughts 😄