Frage

In order to have make sure all code eventually goes through pull request code review, we've started creating branches for features and bug branches off of develop following the git-flow style.

The only problem is that once a bug is found in a release branch, we often have to make a branch off of the release branch in order to do a pull request back to the release branch. But there doesn't seem to be an obvious git-flow process for handling branches off of the release branch when bug fixing a release branch.

What is the git-flow process for fixing release branch bugs and code review?

Are you supposed to fix the bug in develop and create a new release branch? Is branching off of a release branch still valid git-flow? What's the best way to handle pull request code reviews on release branch bug fixes?

War es hilfreich?

Lösung

From your update you're asking about a release that has not been deployed to prod. I'm assuming that means that you haven't merged to master or tagged the commit yet.

In git-flow, you would fix any bugs directly on the release branch. See the diagram below:

enter image description here

The git-flow docs I've read say explicitly

any problems are fixed directly in the release branch

I think the rationale is that these bugs should be small things that relate to the release, and it will improve your release test cycle by avoiding bug-fix branches. While the rationale is sound, I believe it's better to make sure the codebase is protected, and code review processes should not be subverted because a release needs to go out the door. Since you have a code review policy, I would recommend doing exactly what you're already doing. Create a bug-fix feature branch off your release branch, commit to the bug-fix branch, and submit a PR from bug-fix branch to release branch--regardless of what the docs say. After all, the branch strategy should be tailored to your needs, not the other way around.

Lizenziert unter: CC-BY-SA mit Zuschreibung
scroll top