Manage Pull Requests (PR) or Merge Requests in DevOps Change Velocity

  • Release version: Washingtondc
  • Updated August 1, 2024
  • 2 minutes to read
  • Manage Jenkins and Azure DevOps (ADO) pipeline’s pull requests for GitHub, Bitbucket, and ADO coding sources from ServiceNow DevOps. You can enable the change approval process on your pull request to control pull request merge approvals from ServiceNow DevOps and monitor pull request details associated with the change request.

    Before you begin

    Ensure that the following prerequisites are met before approving pull requests:

    Role required: sn_devops.admin

    About this task

    For Jenkins pipelines, pull requests can be managed for GitHub and Bitbucket coding sources.

    For ADO pipelines, pull requests can be managed for ADO coding source.

    Procedure

    1. Create a pull request in GitHub or Bitbucket or ADO.
    2. Perform the following steps based on your orchestration tool.
      Orchestration toolSteps
      Jenkins
      1. In the Jenkins dashboard, navigate to Manage Jenkins > Configure System > ServiceNow DevOps Configuration.
      2. Select the Pull Request Pipeline Tracking Check option.
      ADO
      1. In ServiceNow, navigate to All > DevOps > Properties.
      2. Set the Enable to track Azure DevOps Code Pull-Requests to Yes.

        Pull request tracking will be enabled for all the existing configured projects. For any project that is not configured, you must configure them for pull requests to be tracked.

    3. Run the pull request pipeline in Jenkins or ADO.
      A build is initiated and a change request notification is sent to the approver associated with the pipeline.
    4. Navigate to DevOps > Orchestrate > Pipeline Change Requests.
    5. Select the change record associated with the pull request.
    6. Approve the change request associated with the pull request by selecting Approved in the State field.
      Merge is enabled in GitHub or Bitbucket or ADO for the pull request. Merge the pull request in the corresponding tool.
    7. Select the Pull Requests related list associated with the change record.
    8. View the pull request details by clicking the pull request number corresponding to the Number field.
      Pull request details associated with a change record for a Jenkins pipeline
      All the pull request details (including the details after the request is merged) associated with the change record are displayed. Details such as Pull request ID, Commits, Origin branch, Destination branch, Raised by, Approver, Comments, PR raised time, PR approved time, PR merged/closed time are displayed. Commits from pull requests are shown in the Commits related list.
      Limitation
      Details of pull requests that are created in a BitBucket coding source and associated with a Jenkins pipeline are not displayed for a change request.