GeistHaus
log in · sign up

Defensive Commits

victoramartinez.com

Defensive Commits are a strategy for pushing commit to upstream repos that runs part of the ci/cd pipeline locally using git hooks. It fails the hook fails. This allows you to catch integration errors and get feedback quickly. This strategy works best with trunk-based development and ci/cd teams, because it helps avoid breaking the build and reduces dumb mistakes from even being pushed up to main. At Coqui Health, we’ve implemented this strategy successfully and this is now the default way we work. We use a monorepo strategy coupled with ci/cd and trunk-based development, which means we work close to or in trunk and so having a robust ci/cd pipeline is paramount. Defensive commits allows us to catch bugs early and get feedback that our code will work or break things. It’s allowed us to move faster and not break things.

0 pages link to this URL

No pages have linked to this URL yet.