# Pull Request Support for Azure Cloud

Pull requests let your team give feedback on changes in feature branches before merging the code into the master branch. Reviewers can step through the proposed changes, leave comments, and vote to approve or reject the code.

Previously, we had [GitHub](https://knowledgebase.autorabit.com/~/revisions/cT0ZuVgeUzTQt27sMR9n/product-guides/arm/arm-features/automation-and-ci/enabling-github-checks) and Bitbucket support. We've included support for [Azure DevOps](https://knowledgebase.autorabit.com/~/revisions/cT0ZuVgeUzTQt27sMR9n/product-guides/arm/integration-and-plugins/azure-devops) in the ARM 21.6 release.

For each pull request created inside AutoRABIT, you will have a link that will redirect you to the Azure DevOps application externally where you can view the code changes, merge the changes and close the pull request. But, if there are problems with the proposed changes, they can post feedback in the pull request. Follow-up commits will show up right next to the relevant comments.

There is also a provision to approve the pull request within the AutoRABIT application as well.

### Before You Begin <a href="#before-you-begin" id="before-you-begin"></a>

1. **Enable Pull Request** support for users in AutoRABIT.

   * The account owner or admin can assign the required permission to the users by visiting the **Admin > Roles** tab and selecting the **'External Pull Requests'** checkbox under the [**Version Control**](https://www.autorabit.com/blog/do-i-really-need-salesforce-version-control/) section

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FaH6zXKPBPqzos0kJh2lm%2Fimage.png?alt=media&#x26;token=a92b9ff6-0ffd-4095-9276-5977ff81d682" alt="" width="563"><figcaption></figcaption></figure>
2. Pull Request support is enabled for the **Azure Cloud plugin**.

   * Make sure the [**Azure Cloud**](https://knowledgebase.autorabit.com/~/revisions/cT0ZuVgeUzTQt27sMR9n/product-guides/arm/arm-features/version-control/external-pull-request/azure-cloud-authentication) checkbox is selected under the **My Account** > **Plugins** > **Pull Request Support** section.

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FOCJ0atc0gLHmxAv7CjT6%2Fimage.png?alt=media&#x26;token=ec5205ff-4f3f-4d28-8035-7915e031e817" alt=""><figcaption></figcaption></figure>
3. Users have appropriate **roles** or **permissions** to integrate their repository for pull requests.
   * Such privileges are granted by their account owner or admin. They can assign the required permission to the employees by visiting the **Admin > Roles** tab and selecting the **'Create Pull Request'** checkbox under the **'Special Permissions In Version Control'** section.
4. The Approver should have the **Pull Request Approver** permission.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FVORqjv3FEbTGMoCfctHB%2Fimage.png?alt=media&#x26;token=d69ca0d7-75d4-43bb-a176-fd2cab0fa21c" alt="" width="563"><figcaption></figcaption></figure>

5. Your **version control repo** should be eligible for the Azure cloud pull requests.

   * Go to **VC Repo's** section and look for your repository.
   * Select the checkbox: **Enable Pull Request Support**
   * Select **Azure Cloud** as a pull request plugin.

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Fmvs0fFVqPwK4gmGTSH5T%2Fimage.png?alt=media&#x26;token=7a475af3-4cce-45d7-a219-28f77a992d06" alt=""><figcaption></figcaption></figure>
6. Click **Save Details**.

### Creating a Pull Request <a href="#creating-a-pull-request" id="creating-a-pull-request"></a>

From the AutoRABIT tool, you can create a new PR from:

* from **External Pull Request** summary page
* during **EZ-Commit**

{% hint style="info" %}
**Point to Note:** Currently, creating new PRs while running a new CI Job isn't supported. To date, both GitHub and Bitbucket allows you to create a new PR.
{% endhint %}

#### Creating a new Pull Request from the External Pull Request Summary page <a href="#id-1-creating-a-new-pull-request-from-the-external-pull-request-summary-page" id="id-1-creating-a-new-pull-request-from-the-external-pull-request-summary-page"></a>

The **External Pull Request** screen is best viewed when the zoom setting is set to 80% on your chrome/firefox browser.

1. Go to **Version Control** > **External Pull Requests**.
2. Click on the **Create Pull Request** button on the right side of the page.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2F51H9azBe4RZk6s4GdyTx%2Fimage.png?alt=media&#x26;token=ac6dbc3d-cd71-499f-bf5d-fb87675e59ac" alt=""><figcaption></figcaption></figure>

3. On the next pop-up screen, furnish the below details:

   * Select your [**version control repository**](https://knowledgebase.autorabit.com/~/revisions/cT0ZuVgeUzTQt27sMR9n/product-guides/arm/arm-features/version-control/introduction-to-version-control/version-control-repositories-summary). Only those version control repositories for which the pull request is enabled will be listed under the **Repositories** drop-down.
   * Choose the **Source branch** and the **Destination Branch** to compare.
   * Enter a **Title** and detailed **Description** of your changes, so others can see what problems the changes solve.
   * Add reviewers' details that will accept your pull request. As you enter a name or email address, a list of matching users appears. Select the names to add as **Required reviewer** or **Optional reviewer**.&#x20;
   * Additional checkbox to **delete the source branch once the pull request has been approved**.

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FLWlawxFCJpKHtoaGUsCx%2Fimage.png?alt=media&#x26;token=de2df0ff-55c7-462f-9c65-35b9acd8d307" alt="" width="428"><figcaption></figcaption></figure>
4. Click **OK**. The newly created pull request will get displayed on top of the list on the **External Pull Request Summary** page.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FuOc6PrXZxQTKcAaQjvyW%2Fimage.png?alt=media&#x26;token=f07d6c91-4712-41b2-ac2e-5fd62ebed7e3" alt=""><figcaption></figcaption></figure>

#### Creating a Pull Request during EZ-Commit <a href="#id-2-creating-a-pull-request-during-ezcommit" id="id-2-creating-a-pull-request-during-ezcommit"></a>

The **New EZ-Commit** screen is best viewed when the zoom setting is set to 80% on your chrome/firefox browser.

1. From the top navigation pane, go to **Create New** > **New EZ-Commit**.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FXU3Fd5LGa8rVLf4cNOh0%2Fimage.png?alt=media&#x26;token=a30af0ec-6718-4fc9-b9e5-d1cf9046e9a8" alt="" width="563"><figcaption></figcaption></figure>

2. On the **EZ-Commit** screen, select the [**Salesforce Org**](https://knowledgebase.autorabit.com/~/revisions/cT0ZuVgeUzTQt27sMR9n/product-guides/arm/arm-features/version-control/external-pull-request/broken-reference) from which the metadata components will get fetched.
3. Select the Salesforce Org registered **Author**.
4. Select the **Version Control Repository** for which the pull request support is enabled. Select its mapped **branch**.
5. Select the way to fetch the metadata components from the selected Salesforce Org under the **Fetch Changes** section. Choose the one that best fits your needs.
6. Under **Perform** section, select the option: **Create a Pull Request**

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FFR6RxbaDeA52BwBQyG8a%2Fimage.png?alt=media&#x26;token=7547c6ee-d327-49f0-b39f-66126a7f5694" alt=""><figcaption></figcaption></figure>

7. Leave the remaining field as default and click on the **Next** button to proceed ahead.
8. On the next page, select the metadata components and their members to be committed to the Version Control branch. Click **Next**.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FFFt8qFDqtpO5UwIh4oWQ%2Fimage.png?alt=media&#x26;token=e86d6690-4f82-4373-9ba1-a8c77bccfb80" alt=""><figcaption></figcaption></figure>

9. On the next screen, you need to do the following:

   * To include your globally selected profiles/ permission sets to the commit, select the checkbox: **Apply Global Profile Permissions**
   * **Apply Search and Substitute Rules**: If you have created the SEARCH and SUBSTITUTE rules to define custom find and substitute rules, AutoRABIT applies whenever you commit and deploy files from one Sandbox to another Sandbox one Sandbox to Version Control or vice-versa, such rule can be found here.
   * Enter the **Commit Comment**. This is a mandatory step.

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FmJAVRddz0ucz66YJJu4t%2Fimage.png?alt=media&#x26;token=f1fbe1ba-b8c3-4d78-a3bf-a9d4e1011e3c" alt=""><figcaption></figcaption></figure>
10. Under **Create a Pull Request** section, choose where you like to commit i.e., in your base branch, or create a new branch and commit under it.
11. To create a new branch and later commit the changes, enter the new branch name.
12. Give the Pull Request a **Label Name**.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FtU1glCVWsYpDqqs7M7zx%2Fimage.png?alt=media&#x26;token=7e7c8395-a8cc-434e-81fa-855ac339111d" alt=""><figcaption></figcaption></figure>

13. Once all the fields are filled in, click on **Finish**. This concludes the creation of a pull request and is ready for review. After you create a pull request, you can ask a specific person to review your proposed changes.
14. Once the commit process is initiated, you will be redirected to the **Commits** screen where you can view the progress of your commit operation initiated.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FoUjGn4DFXqm9x87s27WH%2Fimage.png?alt=media&#x26;token=6970a44e-1174-45ec-9ef2-394423105779" alt=""><figcaption></figcaption></figure>
