-
Notifications
You must be signed in to change notification settings - Fork 663
Replace the version mode Mainline in 6.x (Part IV) #3883
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
Merged
HHobeck
merged 6 commits into
GitTools:main
from
HHobeck:feature/Replace-the-version-mode-Mainline-Part-IV
Jan 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4966764
Add new property with name strategy (type VersionStrategies) to the c…
HHobeck fc9d7f7
Implement code review suggestions.
HHobeck b721d45
Rename ConfigNext to ConfigNextVersion and ensure that the array of v…
HHobeck eb80383
Integrate code review suggestions.
HHobeck c5512f2
Rename ConfigNextVersionVersionStrategy to ConfiguredNextVersionVersi…
HHobeck 0bd90f5
Make code clean up and integrate code review suggestions.
HHobeck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Integrate code review suggestions.
- Loading branch information
commit eb80383c0e730178d2283ec98cc00f1c27a79150
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the folder called
SupportedWorkflowswhen it's associated with a configuration property calledversion-strategy? Either we should rename the YAML property toworkflowor we should rename the folder toStrategies.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm correct we have a clash with the term TrunkBased here... What is your suggestion? In the folder
SupportedWorkflowswe are talking from workflow where in the strategy we are talking from strategy which is something different.We could define e.g. on the workflow template
SupportedWorkflows/TrunkBased/v1.ymlto use the strategyTrunkBased,NextVersionto support the next-version configuration as well if it is applicable. Thus there is no one to one relation from workflow to strategy. It's up to you how you would define it.Edit:
TLDR: The folder called
SupportedWorkflowsis not associated with a configuration property calledversion-strategy.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the overlap between
strategyandworkflowis a bit confusing. Would it be possible to removestrategycompletely from configuration and only allowworkflowto be configured? Perhaps not in v6, but in v7?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I saw a lot of issues where the user wants to have it in control which strategies are used or not. The workflows are static and integrated in the assembly. If you delete the strategies then how would the user change the behavior?
Another point here is that we are not defining any hard coded business logic around the workflow. The workflow is just a template which will be used as a base configuration. If the user like he can take the configuration directly with the same effect.
Edit:
What do you think about to name the strategy instead of TrunkBasedStrategy MainlineStrategy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point wrt. allowing configurability on individual strategies. So we probably want
workflowandstrategiesto be mutually exclusive, no? If not, how wouldworkflow: TrunkBasedwithstrategies: [TaggedCommit]work?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VersionStrategies pattern is the main mechanism to control which strategy will be used to determine the next version. This can be of course changed by the user. Like every time if the user changes the configuration and customizes their own workflow he needs to ensure the correct behavior as well. Because it is hard work to build a workflow we as contributors are providing a supported workflow templates (at this moment GitHubFlow, GitFlow and TrunkBased and maybe more in future) to help the user get there build pipe up and running. And for this workflows we give a support.
Comming to your question: You only can answer this question if it is working or not if you know what workflow the user wants to implement. Because we don't know what the workflow might be we cannot do any assumptions about it. In best case it has just a performance impact in worst case the user gets a version number he would not expect.
Edit:
The scenario you are describing here would be a customization of the TrunkBased workflow. This setting would of course break everything. But the user is responsible to ensure the behavior by himself when customizing. Changing configuration is only for advanced user who understanding what they are doing. Again the used workflow template is only a base template which can be overwritten. For the version calculation GitVersion doesn't care if you use a base workspace and customize it afterwards or provide a full configuration from scratch without the usage of a base workflow. It is equivalent and the result is the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I just want us to be on the same page here and offer the best possible developer experience when interacting with these new configuration properties. That's why I thought
strategiesandworkflowcould be made mutually exclusive; you either use one or the other. GitVersion would simply return an error if both properties are present inGitVersion.yml.I think that's going to lead to fewer problems (i.e. fewer filed issues on GitHub) than allowing developers to mix
workflowandstrategies. From my years of experience maintaining API surfaces like this, it's wise to start out restrictive and increase flexibility over time. If we start out flexible, allowingstrategiesandworkflowto be mixed, it's going to be much harder adding restrictions on their usage in the future.If we are to allow
strategiesandworkflowsimultaneously, we need to figure out whetherstrategiesare additive or reductive to the ones implicitly added byworkflow, for instance. I say we just avoid having to answer that question by not allowing it.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not a big fan of being a guardian for the user and protecting them for themselves. I would say to document it and make a attention sign that only advanced user who knows what they are doing should change this field.
Anyway if we do it like you mentioned how would the users of the following issues use this feature?
My expectation would be if you want to skip the MergeMessageVersionStrategy you need to change the configuration as following:
and if you want to skip VersionInBranchNameVersionStrategy you write:
That means the strategies array is not additive.