DORKAG Help

Work with Azure DevOps pull requests

Pull requests are used in open-source projects or in some corporate workflows to manage changes from contributors and to initiate code review before such changes are merged.

By creating a pull request, you tell others about the changes you want to push to the original repository, so that the maintainers of that repository can review your changes, discuss them, and integrate them into the base branch.

Create a Pull Request

  1. In the main menu, go to Git | Azure DevOps | Create Pull Request. The Pull Requests tool window opens with a pull request draft.

    create_pr_draft

    Alternatively, open the Pull Requests tool window and click add Create Pull Request in the top-right corner.

    In the New Pull Request Tab, the repository on the left is the target repository that will receive the updates. The repository on the right is the source repository with the changes that will be added to the target repository.

  2. Click the name of the target repository on the left. In the popup that opens, specify the branch to which you want to apply your changes.

    click_target_name_pr_create

  3. Click the name of the source repository on the right. In the popup that opens, specify the branch that contains the changes you want to apply.

    click_source_name_pr_create

    If you have a project that uses multiple remote repositories, you can change the head repository in this popup as well.

  4. Specify the name for your pull request in the Title field, and, optionally, provide a description of the changes to be applied through your request.

  5. Optionally, add reviewers, assign your pull request to someone or add a label to your pull request.

  6. Click Create Pull Request.

    If you are not yet ready to push your pull request, you can save it as a draft.

    • Click on down next to the Create Pull Request button.

    • In the menu that opens, select Create Draft Pull Request

Manage incoming pull requests

If you're a project maintainer, and you have an Azure DevOps remote configured for your project, you can view and manage incoming pull requests directly from Jetbrains' IDEA.

To view incoming pull requests, select Git | Azure DevOps | View Pull Requests from the main menu.

manage_pr_list

Use the Azure DevOps Pull Requests toolwindow to:

  • Filter requests by state, author, assignee, and review status.

  • Jump to a pull request on Azure DevOps: select a pull request and choose Open on Azure DevOps from the context menu.

  • View diff between the suggested changes and the base revision: click the name of a pull request, select a file and double-click it or press ⌘Cmd D.

  • Create a local branch based on incoming changes: open a pull request, click the branch with incoming changes and choose Checkout 'branch name'… in the context menu.

    create_local_branch_based_on_source

View and apply the suggested changes

If the maintainers of the original repository left comments or made suggestions with regard to your changes, you can view and apply them directly from Jetbrains' IDEA.

  1. In the main menu, go to Git | Azure DevOps | View Pull Requests.

  2. In the list of pull requests, select the one you want to work with and double-click it.

    The IDE opens an overview of the selected pull request.

    view_and_apply_single_pr

    • Next to the title, there is the pull request id number. Click it if you want to open the pull request on Azure DevOps.

    • Click the View Timeline button to open the pull request timeline.

    • To filter the list of changed files, select the commit you want to investigate in Changes from.

    • Right-click any file to open the context menu for this file.

    • In case a reviewer has left any comments or suggestions, there is a counter with the number of comments in the list of files.

  3. Double-click a file to view the suggested changes and comments.

  4. You can either resolve a comment, reply to it or add or remove a Like emoji like.

    comment_in_editor_diff

    If you are the comment author, you can Edit or Delete the comment as well.

  5. If the reviewer has left a suggestion, you'll see the diff between your code and suggested one and can either Apply locally (applies a patch to the working copy) or Commit (opens a commit message pop-up).

    apply_suggestion_diff_editor

  6. After you finished working on the pull request, you can re-request review, vote by approving or rejecting the pull request, merge pull request or close it.

    vote_status_options

Pull Request Timeline

The timeline provides a chronological overview of significant events and interactions within a pull request. It's a key tool for tracking the progress, understanding the history, and identifying areas of discussion or contention in a pull request.

  1. Accessing the Timeline

    • Open a pull request to view its details.

    • Navigate to the 'Timeline' file editor.

  2. Understanding Timeline Entries

    The timeline will display a variety of events, including:

    • Comments and replies made by reviewers and contributors.

    • Commits added or associated with the pull request.

    • Status updates, such as when a pull request is opened, reviewed, or merged.

    • System notifications, like CI/CD results or automated checks.

    • Manual events like label additions or changes in assignees.

  3. Interacting with Timeline Entries

    • You can click on specific timeline entries to view more details or jump to related files or discussions.

    • Some entries allow for direct interaction, like replying to comments or viewing commit diffs.

    The pull request timeline is an invaluable tool for staying updated on the progression and discussions surrounding your code changes.

Pull Request Status

When you are reviewing a pull request, you can see the status of the pull request in the Pull Requests tool window.

The status of a pull request is displayed based on the checks that are configured in the Azure DevOps repository.

For example, you can see the following statuses:

  • Build and Check status

    An Action link is attached to this status when clicked a clickable list of Azure DevOps pipelines are presented. Click on one of them to open them in the browser.

  • Work Items linked to the pull request

    If your Project's admin has set a blocking merge for unlinked work items, you will see an error in the pull request status.

  • Reviewers votes

  • Other statuses

Last modified: 28 August 2024