Code Review

Pull Requests & Code Reviews

Pull Request (PR, for short) can be a confusing term. It means that a contributor to a repository is requesting for the maintainers of a repository to "pull" the contributors code into the maintainer's repository. In practice, it looks a lot more like a gated push. As a result, a simpler way to think about a pull request is as a "request for code review." Additionally, pull requests aren't first order features of Git. Rather, a convention that has been built up over time that are supported by platforms like Copia, but also Github, Gitlab, etc.
This topic is broken down into two sections:
  • Author: The person requesting a review
  • Reviewer: The person(s) or team(s) performing the review


This section covers the actions taken by the author (or creator) of a pull request.

Create a Pull Request (PR)

To create a pull request, you must already have followed the instructions in branching to create a branch and commit your changes.
Follow the standard workflow as explained in the Branching topic, but do not merge.
Publish a branch by clicking on Publish branch. This makes it so the server is aware of your branch.
You can continue to make change in your branch and commit/publish, but when you are done, press Create Pull Request (which can also be found in the top Menu, under Branch). This will cause you to leave the desktop app and be brought to the Copia web app.
Confirm the changes are correct in the bottom section of the screen, and if so, click the teal New Pull Request button.
When you open a new Pull Request, a number will appear next to the branch name in the desktop app. This number corresponds to the Pull Request number that is current open for that branch.
You will be taken to the next step, which is to provide some context for reviewers. It is good practice to add as much information about the reason for the change. When you're finished, click on Create Pull Request.

Request a Review

The next step, seen below, is to select who you would like to review the pull request.
Only collaborators on a repository can review a change. To see how to add collaborators, go to Adding Collaborators
Select the green button, +Assign Reviewers, to request collaborators to review the PR.
Start typing the reviewer name in the box, and when your choice(s) appear, select them to add them to the list. You can add individual Collaborators or Teams as Reviewers. Once finished adding reviewers, click outside the selection box to continue.
Collaborators will be notified by e-mail that a review has been requested. In addition, they will also show a "notification"
in the web app, as well.
If there is a merge conflict, you may choose to resolve this prior to leaving the screen and awaiting feedback from the reviewers.
When complete you can click Back to Pull Requests at the top, and you will see your PR listed on the Pull Requests screen
It's worth noting that sometimes people merge their changes (if they have permission, see Branch Protections) without requesting review or getting approvals. This can be a good option if you want to document a change, but don't need much feedback on it.

Updating your Pull Request (PR)

The Reviewer may Request Changes or Comments during the review process. If so, you can access the PR on the Pull Request page to respond to a comment or conversation. If changes are required, follow the normal modification and commit flow.
  1. 1.
    Modify your project locally as you would normally, making sure to be working in the proper branch.
  2. 2.
    Commit your change to your local branch.
  3. 3.
    Push your changes to the remote version of your branch.
Once your PR has been approved, you may proceed to Merge your PR.


Commenting on a Pull Request (PR)

As a Reviewer (or Author) you can provide general feedback and comments on a PR. Reviewers will be notified by e-mail and in the Copia Web app that a review has been requested. You can access the PR by following the link in the notification, or going to the Pull Requests tab in the web app and selecting the open PR for review.


Reviewers (or authors) can comment on a PR directly by clicking on the Conversation tab. It is a helpful tool to allow discussion and feedback on the PR.
This does not start the review, and neither blocks nor accepts the PR, but just passively allows for discussion and feedback.

Reviewing a Pull Request (PR)

To perform the actual review, open the PR, and click the Files for Review tab at the top of the PR. You can now review the changes that were made in this PR.
There are two ways to "start" the review, which will be explained in the sections below:

Code Commenting

If the type of file supports Code Commenting, you may be able to start the review by adding comments directly on the code in the graphical display, and clicking Start Review (see more information in the Vendor Integrations section, if the filetype supports this feature).
You can then continue to add comments, as needed. Once done you will need to click the green Submit Review button.

Submit Review

If either the filetype does not support Code Commenting, you prefer not to add Code Comments or if you are done adding Code Comments, it is time to click the Submit Review button. This will open a dialog for you to add comments and either Approve, Comment or Request Changes.
Of course, if you do not approve the change, a new review may be required after additional discussion/comments or changes are performed.
If approved, the Author may continue on to Merge the PR.
Last modified 22d ago