arcanist: lint, unit test, and submit for code review
I briefly mentioned arcanist in a previous article. It is a command line tool that wraps around git, hg, and svn and provides some handy features for working on a shared codebase. It is meant to be used in conjunction with phabricator, and all my examples assume that situation. As I mentioned previously, a typical workflow while using arc might look something like this:
Create a local branch git checkout -b mygreatfeature hack on that branch Run arc lint to run your changes through several possible code linters Run arc unit to run the unit tests that are associated with your changes Run arc diff to submit your patch for review (Note: just running arc diff will call both the lint and the unit test steps if you have them configured)
code review before commit
I’ve started implementing code review before commit/push on my team. We theoretically had a code review system in place before this, but it went something like this:
Write code Commit code Push code Roll a d20 If die came up greater than 2, no one will review your code. Otherwise, someone tries to retroactively review a billion commits in 30 minutes. That process wasn’t really the best didn’t work. In my experience, once the code is in the tree, there is a near zero chance that it will be reviewed.
more continuous integration
So, in a previous post, Continuous Integration I gave a quick overview of our continuous integration setup, and mentioned that I’d like to explore allowing jenkins to push our deploys for us. That work is now done. The basic workflow is now:
Developer develops new feature Developer runs unit tests locally Developer submits patch for code review via Phabricator Code is approved by another person on the team Developer lands (pushes to master) changes Jenkins initiates a build, and if all tests pass, promotes the build automatically to the integration server.
Continuous Integration
I finally got around to setting up Jenkins for some continuous integration on one of the projects I contribute to at work. It’s been a long time coming and we’ve been talking about it for awhile. Finally getting it done ended up taking longer than expected. No surprise there, with the constant pressure to deliver and release, we often forget that quality and quality assurance are an important aspect of shipping.