3 ms·
Overall, this is a reasonable article, which may or may not be applicable for your situation. I am a big fan of CI (continuous integration) and automated tests
by aliasEli 5y ago
Overall, this is a reasonable article, which may or may not be applicable for your situation.
I am a big fan of CI (continuous integration) and automated tests, but please don't do this:
> Even better: continuous deployment! When the tests pass, deploy.
Continuous deployment (CD) means deploying to your production environment. This is dangerous and should always be a conscious decision by someone (preferably even multiple persons). Normally, a new release either fixes a bug or adds new functionality.
If your using CD and your software has a bug, that means that your original tests were not sufficient. The fact that you now have new software and new tests does not mean that you have solved the original bug.
If you want to add new features, you will also have to add tests that these features work as intended.
In all these cases expert human judgement is needed, it is not wise to automatically deploy changes by developers.
- simonw 5y agoThere are projects for which CD is not a good idea - projects where financial or physical harm may come to someone if a mistake goes out - but in my experience the majority of projects don't fit that definition. Also, the great thing about CD is that mistakes can be fixed really quickly: push another commit. Not using CD is no guarantee that you will ship less bugs. In fact I'd argue that it makes shipping bugs more likely, because the friction involved in deploying means you'll bunch up multiple changes in a single release - and that's a great way to discover bad interactions between changes too late. (Even if you don't use CD to production, having CD to a staging environment is a no-brainer in my opinion: giving everyone on the team access to a current demo of the main branch is another big productivity boost.)
- aliasEli 5y ago> Also, the great thing about CD is that mistakes can be fixed really quickly: push another commit. If the change messes up your database and you don't discover it immediately, it is not always possible to simply rollback the database. CD to a staging environment is fine, but I would regard it more as a form of CI.
- shric 5y ago> In all these cases expert human judgement is needed, it is not wise to automatically deploy changes by developers Isn't this code review? This can and should be enforced before it goes to automatic deployment. If not, what other expert human judgement is needed? Yes, you need to reach a certain quality bar of your automated testing, and you may choose to implement a canary system before full deployment, but I see no reason to avoid automatic deployment once these safeguards are in place.
- TheCoelacanth 5y agoIt's still a conscious decision by the person who put the change in master and the person who reviewed it. You just implement the tests at the same time as the thing it's testing and merge them together. It works fine as long as developers are used to working that way.