Trunk Merge is a service that enables your repository to adhere to The “Not Rocket Science Rule Of Software Engineering”: Automatically maintain a repository of code that always passes all the tests.

How It Works

Trunk Merge adds an additional test pass before merging pull requests. For example, a typical developer workflow for authoring a feature and merging the code to a repository might look like this:

  1. Create a feature branch from the main branch
  2. Author a Change
  3. Open a Pull Request
  4. Tests are Run
  5. Code Review
  6. When tests & code review pass, Author merges request

In a repository with many contributors, the state of the main branch will have advanced significantly after step 1. Because of this, the results of the tests run in step 4 are out of date. Merge solves for this by adding another test pass to ensure no broken code lands on your main branch. A developer workflow with Merge integrated might look like this:

  1. Create a feature branch from the main branch
  2. Author a Change
  3. Open a Pull Request
  4. Tests are Run
  5. Code Review
  6. When tests & code review pass, Author submits pull request to Merge
  7. Tests are run on a branch consisting of head of main + the pull request changes
  8. If the tests pass, the pull request is merged automatically

Demo

Watch this 5 minute demo to see how it works in practice


What’s Next

Take 5 minutes and set up Merge in your repository