Protect development at all cost

Some time ago I wrote a few entries about my attitude to the GitFlow and a small adjustment that can greatly reduce the possibility of breaking development/release branches. The main reasoning was following: review, build your merge commits in your feature branches, then using fastforward-only merge apply it on develop. Having this applied should keep your development, healthy, right?

Not at all. The final step is pushing changes. And it’s a manual step, as ending the feature is. If that’s a manual step, there’s a bunch of things that can wrong. Yes, you can push quick-fixes, fixups, minor-improvements to development and say to your whole team “it’ll be there in a sec”, but isn’t it easier to just don’t break things? Having that said, is possible to be guarded against push that isn’t proper? Yes, and my automation for this is simple:

  • use git prehooks
  • add check against TeamCity API if the build is ok
  • add check against a code review tool
  • allow push only if the checks are successful

In the following posts I’d present how to

  • create git hooks, preferably using PowerShell (“You won’t be able to run on Linux oooooh nooooo!”)
  • successfully get statuses and consume TeamCity API
  • combine this to revoke commits that might hurt development branch

Stay tuned!

3 thoughts on “Protect development at all cost

  1. Pingback: Git plumbing with PowerShell | Extreme .NET programming

  2. Great thoughts. Personally I believe that “the root of all evil” when it comes to pushing to the development branch is all minor fixes, features and refactors. It is just like you mentioned – since in the final flow step, there is a huge human factor, reducing it is the only way to lower the risk of breaking a build. Just a quick thought – I think we, the people who call themselves software engineers – turn a blind eye to often when it comes to all continuous build remarks, alerts and warnings. As long as we have team members, who are like “yeah, I’ve just broken a build, let me fix this with following 5 rubbish commits”, we can fight and try to protect development, but it is still tilting at windmills.

Comments are closed.