-
Notifications
You must be signed in to change notification settings - Fork 652
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
Mechanism to configure a pre-release-weight for the tagged commits #2222
Mechanism to configure a pre-release-weight for the tagged commits #2222
Conversation
I have created an initial proposal for addressing issue #1994 and added a failing unit test for the type |
While don't fully understand the use cases of #1994 and #1600 (and, to be honest, I haven't dug deeply into the later), I can't really comment on the Anyway, I propose to go for a simpler approach first, just enough for the vanilla gitflow use case, where you only tag final versions. Simply defining a static default pre-release weight for tags should be enough for preventing the So either we can go for a new top-level config key, a simple scalar. Or, in the same spirit as the branch config something like tags:
default:
pre-release-weight: 60000 Later, this can still be extend with different named tag configs, with regex matching and extracted pre-release labels, what ever... |
If your proposed solution is sufficient, it's definitely the simplest one to implement, maintain and document, @jbaehr. Thoughts, @ruhullahshah? |
|
Sounds good, @ruhullahshah! Looking forward to seeing the implementation. |
Sounds and looks great, @ruhullahshah! Could you give this a quick review too, @jbaehr? A rebase on the |
for translating the pre-release labels in Git tags to weights.
…, especially in GitFlow branching scenarios. This could lead to an emission of AssemblyFileSemVer that is not strictly increasing. Solution: Introduce a new configuration parameter, tag-pre-release-weight, that could overrwrite the WeightedPreReleaseNumber if it turns out to be 0.
b4a416c
to
80473c5
Compare
@ruhullahshah thanks for your work! I only question the "0" default for the |
Thank you so much for your work on this @ruhullahshah, and for your valuable input @jbaehr! 🙏 |
Merge pull request #2222 from ruhullahshah/feature/1994_PreReleaseWeightAndRegexForTags Mechanism to configure a pre-release-weight for the tagged commits
@asbjornu You are welcome! |
Background
This PR is motivated by issue #1994. As a user, I should be able to:
Proposal
In order to achieve the stated objectives, we can extend the global configuration as:
A new GitVersion variable
TagWeightedPreReleaseNumber
will be introduced which can have similar semantics as the existingWeightedPreReleaseNumber
, i.e. it can be computed aspre-release-label-weight + CommitsSinceVersionSource
.The
file-versioning-format
will have similar semantics asassembly-file-versioning-format
and can specify environment variables as well.