In praise of continuous deployment: The WordPress.com story
toni.org
toni.org
- Being maniacal about integration tests
- Manually testing key flows (user registration in particular)
- Hoptoad exception tracking coupled with push email
- cap deploy:rollback
When you have production database migrations things get a little trickier. We are still looking for better ways to handle migrations in general, including leveraging systems like MongoDB.With this logic, it's perfectly fair to point out that WordPress's security record is absolute shit (tptacek: "There are unforced errors in Wordpress. Every web application will have a cross-site scripting mistake. It takes a special one to have "anonymous commenter" -> "admin" privilege escalation, or executable style templates." - http://news.ycombinator.com/item?id=1328583) and it's fair to conclude that this "We systematically and deliberately fail to check our code before deploying it!" approach to development may be a contributing factor.
Now, nothing stops you from implementing "take bug, code solution, run it through code review and QA, deploy" on a patch-by-patch basis, but I have a hard time imagining making 20 releases a day with that procedure, so I'm assuming that's not what they are doing with some reason.
Basically, what I'm saying here is that hearing WordPress advocate this model is a strong argument against it. If they honestly think it's not costing them anything, or even just a net benefit, then I call their judgment into question. Or perhaps rather, further into question, since I think their security track record was already calling their judgment into question.
Yes I am, and I apologize. I did not realize there was much of a distinction. I would edit away much of my message now if I could.
But...
"Also, our fast deployment model helps to very quickly fix whatever problems there may."
Security problems do not work that way. Rapid deployment does not recover your user database that the hacker got, just as one example. Rapid deployment may close XSS holes, but doesn't undo the damage they did while open. And you don't need rapid deployment to close XSS anyhow, historically lots of people have managed that without rapid deployment. I still see it as potentially beneficial on some fronts but an enormous risk on other fronts I care about a lot.
Funny, when I worked at ESPN.com this is exactly what we did. When I first started, I was horrified.
But you know what? Traffic and revenue still grew, and users didn't seem to mind.
Deploying quickly gave us an incredible speed advantage that allowed us to change and respond to problems and new opportunities.
I have lovingly crafted ( wasted ) a system which is still in its infancy to handle a form of automated test driven development and from what I can see so far, the times I break it or discover a bug ( logic bug ) in my code later it is usually due to week tests.
Clearly I am not a large site like wordpress.com, a part of me thinks its the right thing to do. It certainly makes deploying a breeze and gives a little more "confidence" that the system didn't just fall over.
The sad part, at least in the PHP world, there are no libraries with an explanation on how best to use it with your site / application structure.
The database part is the biggest hiccup. My solution is a duplicate database with no data. First it confirms that the "fake db" matches the "real db" and warns if the table structure is different.
Then with my blank "fake db" using functions in my tests to "setup" and "destroy" I purposly build data to test with.
Once my site is operational, I will look to using live data in the "fake db" to simulate with real data. But so far it has been an interesting journey.
Clearly, TDD would become a bigger issue if you have to test sphinx/couchdb/mongodb etc setups but like with all creations its starts with a blank.php. ( in my case )
Not that this covers "Optimise for security".
But my test suite, after the first "test time" the test has been run, will warn if the "library","model", "controller" it is linked to has been altered without the "test" file changing, which at least warns me to the idea that maybe I need to refine my test.
All very padantic, but reading from the side lines of patio11, I can't help but see logic in "automating" things to make your life easier, more efficent and less likely to add human error into the equation.
I leave with what I consider a valid point.
Once upon a time, people looked at the "MVC" approach as time consuming and wasteful. At least from my understanding of watching the web evolve from the earlier days.