Pull Request

Prerequisites

  • Have a Org Credential.
  • Create an API Key in order for Github to notify the pull request events to Copado (via the Copado Webhook API).
In order to start enjoying all benefits of code review with Copado Pull Request, having a complete and validated Git Repository record is mandatory.  
  • If required, complete Git Repository Fields:
    • Git Provider
    • Branch Base URL
    • Commit Base URL
    • Pull Request Base URL
You can review the Git Repository documentation here

Pull Request Webhook URL: you can review the Webhook API documentation here and click on the "Pull Request Event" link to see the Pull Request Webhook URL. 

Setup Pull Request Webhook
Open your Git Repository and click on the Settings tab (if you do not see the Settings, please contact your Git Server 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 of your Git Server:
  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.
  5. Select the Following Events or Equivalent according to your Git Provider.
    1. Pull Request.
    2. Pull Request Review.
    3. Issue Comment.
  6. Activate
Note: You can check this GitHub Webhook setup example.

You can create a Pull Request:
  • Between Different User Stories:
    • Available Since: Copado Version 10
    • This option will be available when the same component is committed on more than one User Story and it's been tracked by Copado's Overlap Awareness Feature. Whenever created, Copado will compare User Stories Feature Branches.
    • Follow this steps to create a Pull Request Between two User Stories Feature Branches:
      • Open a User Story that has components tracked by Copado Overlap Awareness Feature.
      • In the User Story Page, Click a component from User Story Metadata related list.
      • A list of User Stories with the components will be displayed. 
      • From the Related User Story Metadata table, select the User Story to compare with and click Pull Request.
  • From Promotion:
    • Available Since: Copado Version 10
    • Pull request from promotion will compare the Promotion Branch with Destination Branch.
    • Follow this steps to create Pull Request for Promotion:
      • Open the Promotion Record to compare.
      • Under the Deployment Related List, In the Action Column, click Pull Request.
  • Individual User Story:
    • When you commit files in a User Story, A Pull Request Button will be enabled on the User Story Page. Whenever you create a Pull Request, User Story Feature Branch will be compared with Target Branch.
    • Follow this steps to create a User Story Pull Request:
      • Open User Story with complete git commits.
      • From the Page Header, click "Create Pull Request".
User Story Pull Request Special Behaviour: 
  • If  the Webhook is configured on your git provider, Actions/Events on Pull Request will be received by Copado and displayed on the User Story detail page on Pull Request Related List.
User Story Pull Request Related List
  • 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.
Reviews in the Pull Request will be tracked by Copado (If Event is configured on WebHook). 
User Story Pull Request Detail Page