We have a Gitflow/trunk-style source control system in Git, where releases go through the following process:
- Devs branch off
master
- Devs pull request into
master
- After PR merged, build happens to "QA" environment
- QA team tests code
- We do a release from
master
(devs PR's tomaster
, we do some testing, then we do a release from there).
Now, a given 'build' to QA might have a few chunks of work. Problem is, if an issue is found at step 4) above, we only have the following options:
- Fix the code (slow)
- Go to production with the issue (risk)
Basically, one bad 'chunk' of work means other good work can't go to production.
How can we fix this?
These are my ideas, in terms of my preference:
- Use a 'release' pipeline, like this:
Means that each commit goes through a set of stages. If a 'new' piece of work doesn't pass a stage, it doesn't get promoted. In other words we can release from the 'last known good build'. Can use something like Octopus Deploy for this.
- Use 'release' branches in Git. After something is tested, we move it to a 'release' branch.
- Cherry-pick good commits in Git. Kind of similar to 2.
Any suggestions? What's the best practices here to solving this problem?