A Testing Environment for Every Pull Request
At Chromatic, when we are collaborating with our clients on a website or product, we typically work in an agile, iterative process. As part of that process, it is important for all stakeholders to be able to easily review and approve changes to a site as they are being made, but this can frequently be a pain point. There are often members of the team who are less technical, may not have a development instance of the website, or an interest in checking out git branches. Frankly, even for users that are willing and able, this process is often an inefficient use of everyone’s time.
Enter Tugboat #
Tugboat describes itself simply as “a complete working website for every pull request.” The service integrates with your Github, Gitlab, or Bitbucket repositories and generates a preview environment whenever a pull request is created allowing you to review every feature or bug fix with automatic builds. This preview will live for the life of the pull request, gets updated when new code is pushed, and is torn down when the pull request is merged. On top of the convenience of having everyone review changes in a shared environment, this also gives you a chance to test the deployment process itself. Your deployments are automated, right?
The Base Preview #
The base preview is Tugboat’s secret sauce for efficiency. Building each Tugboat preview from scratch could take a while depending on your build steps, but Tugboat accelerates this process by allowing you to specify one of your preview instances as the “base preview”. For us, this is usually the “master” branch preview since all of our branches and pull requests are created off of this branch. When you have a base preview enabled, a new pull request preview will “clone” the base preview with its database and configuration intact, then pull in your pull request code changes, and run the build steps you have specified. In practice, this means that your pull request preview environments are often built in a matter of seconds instead of minutes.
Streamlined and Out of the Way #
Tugboat does something extremely valuable; it allows us to iterate more quickly and flag a greater number of issues earlier. Without a tool like Tugboat, even our rigorous code review process will have blind spots by excluding stakeholders who are not willing or able to check out git branches to their own development instance of the site. Better still, Tugboat empowers our clients to feel like they have their hand more firmly on the ship’s tiller during the development process.