User Story Pull Requests

Updated 1 month ago by Iván Minaya

Copado lets you create a Pull Request from a User Story and seamlessly add Code Review as part of your Copado quality gates.

Prerequisites

  1. Create an API Key in order for Github to notify the pull request events to Copado (via the Copado Webhook API).
  2. Make sure the Branch Base URL and Commit Base URL are setup on the Git Repository record in Copado. You can review the Git Repository documentation here.
  3. (Optional) Review the Webhook API documentation here and click on the "Post" link to see the Pull Request Webhook URL details. 

Setting up the Pull Request Webhook

Open your Git Repository and click on the Settings tab (if you do not see the Settings, please comm touch with your admin). Then click on the "Webhooks" menu item and then click on the "Add Webhook" button.

Fill the following information on the webhook configuration page:

  1. Payload URL: The Pull Request Webhook URL with the base URL of the Org where Copado is installed and your API Key.
    1. e.g. https://copado.herokuapp.com/json/v1/webhook/pullRequest?api_key=XXXXX
  2. Content Type: Select "application/json"
  3. Secret: Leave it empty
  4. Which events would you like to trigger this webhook?: Click on the "Let me select individual events" checkbox.


Then select the Pull requestPull request review and Issue comment events (leave all other deselected). 

Leave the Active checkbox selected and then click "Add webhook".

Usage

Once the Webhook is configured in Github, the pull requests made from a User Story feature branch will be received by Copado and displayed on the User Story detail page. 

Copado also tracks Code Reviews of the pull request and you can review them in the pull request detail page in Copado.

After a successful promotion and deployment of the User Story to the target environment, the pull request will automatically change its state from "open" to "closed" with the merged flag checked.

As of v11, once a pull request is created, the user story will be automatically updated with the mergeable status of the pull request when it is available.

When indexing the User Story metadata, you can leverage the pull request functionality to compare two feature branches that have changes on the same metadata components to review if changes are mergeable or if there are conflicts between the feature branches. More information here.


Pull Requests Providers

Copado not only supports pull requests from your user stories for Github but also for Bitbucket (Server and Cloud), Stash, GitLab, VSTS and any on-premise git provider, so that, your development process can include this quality gate as part of it no matter what Git vendor you use.


How did we do?