1

From https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow :

Once the release is ready to ship, it will get merged it into master and develop, then the release branch will be deleted

Now that the merge is done : let's say we're now facing instability in production suddenly (how unlucky!), the master and develop branch are now temporarily out-of-sync with production environments and the release (let's say 1.1) is postponed. Later we find the issue that requires one or more fixes : What would be the best way in your opinion to deal with one or more bugfixes knowing that master and develop are now out-of-sync with prod ?

  • should I create a new release branch from develop (and name it for example 1.2), then revert changes from master and develop to latest production release tag (let's say 1.0)? If so : what would be the best way so the history of changes can be preserved as much as possible?
  • for those with real-life experience of release cycle : are you tempted to merge your release branches after a release or happy with doing so prior to a release?

EDIT : in summary this questions is really about clarifying the amount of work needed when dealing with bug fixes after a release cycle AND before the release has been deployed to environment. The objective is to clarify how many actions one may save by doing the release cycle merge (into master/develop) after the deployment to production environment (basically release to environment from a release branch rather than master).

NicolasW
  • 1,519
  • 5
  • 22
  • 34
  • "Now that the merge is done": Which merge are you talking of? You merged `release` into `master` and `develop`? And what state is your "production environment" on? Why is it out of sync? Shouldn't it be on the same state as `master`, i.e. is `master` not your production branch? – kowsky Feb 16 '18 at 07:54
  • Which merge are you talking of => the release branch per the sentence (and link).You merged release into master and develop => Yes, and until the release in performed we are out of sync between prod and master.. – NicolasW Feb 16 '18 at 13:21
  • This is *exactly* what hotfixes are for, it's their express purpose. – user229044 Feb 16 '18 at 14:49
  • Thanks - so assuming I am creating a bugfix branch from a recent tag, where am I merging this back once done ? remember my release is postponed until the instability issue is resolved on prod environments - my master and develop are polluted with changes due for deployment, for which I have no interest for at the moment. hence the underlying question : should I look into merging my release branches AFTER deployment to environments? – NicolasW Feb 16 '18 at 18:27
  • Maybe in my case it is acceptable to release from the hotfix. – NicolasW Feb 16 '18 at 18:44

1 Answers1

0

In the article you linked, it is stated that

The master branch stores the official release history[...]

Thus, the merge of the release branch into master is, by definition, a release. This is not the case in the workflow you described, as you have another production instance that gets updates from master in some distant future.

Having that said, I think the best approach in your situation would be to create a hotfix branch from production, fix your issues and merge it into production as well as into develop and master. The "release" from master can then proceed as planned, while your production issues are fixed as soon as possible.

That appoach is very close to the GitFlow hotfix workflow, as described in the article you linked. Since the only thing you're doing are bugfixes, a hotfix workflow is much more appropriate in contrast to a full-blown release.

kowsky
  • 12,647
  • 2
  • 28
  • 41
  • 1) I m not having a production branch, by "production release tag" I mean release tags hence on the master. – NicolasW Feb 16 '18 at 18:20
  • clicked too fast 2) "the merge of the release branch into master is, by definition, a release" - mh .. ok from a purely "integration" perspective.. but by performing a release above I am meaning deploying to production environment. – NicolasW Feb 16 '18 at 18:21
  • In your response you have not taking into consideration :"knowing that master and develop are now out-of-sync with prod[uction environments]". Basically if I merge bugfix into master and develop I end up with a mix of release + bugfix but at this point I only want to deploy bugfit. – NicolasW Feb 16 '18 at 20:16
  • Ah, I see. Because you deploy via `master` branch, i.e. your `master` has to include the hotfix but not the release in order to deploy it? – kowsky Feb 20 '18 at 06:30
  • Correct, my master has the release + the hotfix now. But I only want the bugfix at the moment. – NicolasW Feb 20 '18 at 14:53