Pull Request/Merge Request Workflow

In step three of the Build Tools guide, learn how to use pull requests as part of your workflow.

Discuss in our Forum Discuss in Slack

Pull Request/Merge Request Introduction

This section demonstrates the Build Tools project workflow by making a code change on a Git feature branch and opening a pull request (GitHub) or merge request (GitLab) to accept that change into the master branch.

As a reminder, these examples use GitHub as the code repository with CircleCI as the CI. CircleCI builds the full site artifact and deploys it to the project's Pantheon site. Substitute the Git provider and CI below with the right ones for your project.

Branches with an associated pull request are built and deployed to a Pantheon Multidev environment, with the pull request number being used to construct the Multidev name. For example, pull request 12 will be deployed to a Pantheon Multidev named pr-12.

The master branch is automatically built and deployed to the Pantheon dev environment. This happens both when you commit code directly to the master branch and when a pull request is merged into the master branch.

Continuous delivery diagram shows the Master branch going to Dev, and the PR going to a Multidev

Deployments to the test and live environments on Pantheon must still be done manually, either through the Dashboard or via Terminus. For this reason, Continuous Delivery (CD) is not enabled.

Create a Pull Request

  1. From your GitHub project page, click on the config directory. Select the file system.site.yml and click to open an editor:

    system.site.yml file open in GitHub

  2. Change the slogan to something inspiring:

    Slogan edited to say 'Making the world amazing'

  3. Scroll down and enter a message describing this change in the Commit changes area. Then click on the radio button to create a new branch and give it a short name, like slogan. Click Propose file change:

    Create 'slogan' branch

  4. Click Create Pull Request:

    Slogan Pull Request

  5. Wait for the build on CircleCI to leave a comment, then click on the Visit Site button to access the Multidev site URL. Note that the slogan you entered in your pull request branch has been imported and is visible in the site header:

    Site initial login

    This Multidev environment will persist for as long as the pull request remains open in GitHub.

  6. Enter the admin username and password you created in the build-env:create-project command. Click Log in to access the admin interface:

    Site admin log in