In GitFlow, are you allowed to merge features into develop once a release branch has been created?
As far as I can tell this seems to result in incorrect versioning of certain commits, namely:
-
All the commits that are added to develop before the release branch gets merged back with its tag will be reported as "belonging" to the previous version according to git describe. git describe will find the newly created tag for any commits that are created after merging the release branch with develop. But any commits before it got merged back and after the forking from the release branch will show the previous tag even though they're not part of this release, but the next one.
-
These same sets of commits will have an incorrect version number in any files such as AssemblyInfo, package.json, or any other files that contain a version number. This is because git flow only mentions bumping a version number inside the release branch. When merging back the release branch, I'm assuming that it will take over the version number of the release branch.
So all commits before the release branch was started will have the previous version number. All commits after the release branch will have the next version number. But all the commits in between, will also have the previous version number.
Is this actually an issue? If not, please explain why. If yes, how do you deal with it?
At work, we've been experiencing a real issue related to this.
For the sake of the example, imagine 2 repositories, both using git flow.
Repository A consumes an artifact published from repository B (nuget package).
Repository B is currently at version 1.0.0 in master, and version 1.1.0-alpha+3 in develop.
Now the following sequence of actions occurs:
- Repository B creates a release branch from 1.1.0-alpha+3. Meanwhile development continues, and two additional features are merged with develop. Repository B now has version 1.1.0-beta+0 in the release branch, while develop is already at 1.1.0-alpha+5.
- Repository A takes a dependency on 1.1.0-alpha+5 version of repository B that was created after the release branch in repository A was started.
- Repository B's release branch is finished, and a stable package version 1.1.0 is created.
- Repository A's dependency on 1.1.0-alpha+5 is upgraded to the stable equivalent 1.1.0.
- BOOM: 1.1.0 does not contain the 2 additional features 1.1.0-alpha+4 and 1.1.0-alpha+5.
I guess there are multiple ways around this problem:
- Only consume stable packages. However, in our current environment this is not realistic as we have major release cycles.
- Work with alpha/beta versioning for both the file versions and git tags. By doing this, any new features merged into develop after the release branch has been started will be working towards the "next next" version. In the example that would result in 1.2.0-alpha+1 and 1.2.0-alpha+2 instead of 1.1.0-alpha+4 and 1.1.0-alpha+5.
In GitFlow, are you allowed to merge features into develop once a release branch has been created?
As far as I can tell this seems to result in incorrect versioning of certain commits, namely:
All the commits that are added to develop before the release branch gets merged back with its tag will be reported as "belonging" to the previous version according to
git describe.git describewill find the newly created tag for any commits that are created after merging the release branch with develop. But any commits before it got merged back and after the forking from the release branch will show the previous tag even though they're not part of this release, but the next one.These same sets of commits will have an incorrect version number in any files such as
AssemblyInfo,package.json, or any other files that contain a version number. This is because git flow only mentions bumping a version number inside the release branch. When merging back the release branch, I'm assuming that it will take over the version number of the release branch.So all commits before the release branch was started will have the previous version number. All commits after the release branch will have the next version number. But all the commits in between, will also have the previous version number.
Is this actually an issue? If not, please explain why. If yes, how do you deal with it?
At work, we've been experiencing a real issue related to this.
For the sake of the example, imagine 2 repositories, both using git flow.
Repository A consumes an artifact published from repository B (nuget package).
Repository B is currently at version 1.0.0 in master, and version 1.1.0-alpha+3 in develop.
Now the following sequence of actions occurs:
I guess there are multiple ways around this problem: