Drupal Peer Review and Testing with Pantheon Multidev

Drawing of a storefront

We use Pantheon for most of our projects and it is quite wonderful to use. In particular, the multidev feature provided by the Business+ level hosting is a "must have" for development teams. Not only do you get the standard dev => test => live development workflow, you also get separate sandboxed dev sites for each of your developers to work in. For example, if you have a team of 5 developers, each one could have a dedicated multidev site to use for development, testing, and acceptance before merging into the master (dev) branch.

Git feature-branch workflows vs Pantheon multidevs

In many git feature-branch workflow strategies, you would create a new git branch to work on your current feature or bug or task, finish it up, merge the branch, and blow the branch away when you were done. The Pantheon multidev setup doesn't lend itself to that fast-paced throw-away branch structure because spinning up a multidev takes some time. A multidev site not only has its own git branch but its own database and files. Given a large site with a big db and lots of files, it will take a fair amount of time to create a multidev site. For example, one site we are working on has a ~10GB db and ~80GB of files and it can take more than an hour to spin up a multidev environment.

Dedicated multidev branches

Because of this we keep dedicated multidevs around and each developer has access to one or more. Sometimes it makes sense for more than one developer to update a single multidev branch, but typically each developer has her/his own to work with. We've done branch naming based on general branch focus (e.g. performance or migration), on a project-theme-related name (e.g. tahiti, kenya), or on developers names/nicknames (e.g. aimee, kristen, k2). The disadvantage of focused names like "performance" is that if the branch is used to develop a non-performance-related feature, then maybe that is a bit confusing. Name-based ones are good for multidev environments if you have a dedicated team that won't be changing much. "Theme" related multidev names are a good when team members will be coming and going and you will be using multidevs for developing different features.

Peer review and testing using multidev workflow

Multidev environments make pre-merge-to-master reviews and testing easy. Let's assume we have the follow developers:

  1. Dev1 - developer 1 - in charge of working on feature
  2. Dev2 - developer 2 - in charge of reviewing Dev1's feature
  3. Dev3 - developer 3 - in charge of moving code from dev => test

The process is typically as follows:

  1. Dev1 works locally on feature with her/his favorite tools... for longer development tasks, the developer should merge from master frequently to keep code sync'ed as well as copy the latest live or test db to the local db (can use terminus)
  2. Once ready, Dev1 merges from master and pushes code to multidev branch and, if necessary, copies the latest live or test db to the multidev db using the Pantheon dashboard
  3. Dev1 tests on multidev branch
  4. Once ready, Dev2 is notified that code is ready for review and testing
  5. Dev2 clones or pulls the code locally and can diff changes and do code review
  6. Dev2 can test the feature using the multidev site on Pantheon (e.g. dev1-example.gotpatheon.com)
  7. Dev2 can provide feedback to Dev1 if changes are needed
  8. Once changes are approved via peer review+testing, client can test on the multidev branch if necessary (good for complex or disruptive features)
  9. Once client approves, Dev1 merges changes to master branch (this might also be done by Dev2 or Dev3 depending on your project roles)
  10. Dev3 pushes changes to test environment
  11. Dev3 and/or client tests feature on test environment
  12. Feature is pushed to live on next deployment

This process frees up the dev => test => live "pipeline" in case there are hot fixes that need to be applied while larger features/fixes are being developed. This also minimizes the risk of broken code getting into master which can slow down the whole team if propagated out to other multidev branches.

Note: Pantheon does have free developer accounts to try out their tools but that does not include the multidev feature. If you do get a chance to try out multidev, you'll never want to be without it. It would be great if multidev was available for all hosting levels but it is a key differentiator and a compelling reason to upgrade to Business+ hosting so I'm sure that won't ever happen. If you are using multidev...