Skip to main content

Review PRs

Last updated on

After creating a PR, you can request review from one or more reviewers within your organization. Once approved by the reviewers, you can merge the PR.

Assign reviewers

To request PR reviews from other users in your Harness project.

  1. In your repository, go to Pull Requests, and select your PR.

  2. On the Conversation tab, in the Reviewers section, select More options (⋮).

  3. Select the user that you want to assign as a reviewer.

    To remove a reviewer, select More options (⋮) and deselect the reviewer.

tip

When reviewers leave comments on your PR, you can reply and resolve comments on either the Conversation or Changes tabs.

Submit reviews

When you review a PR, you can leave feedback, mention other users to collaborate, request changes, or approve the PR.

  1. In Harness Code, go to the repository where you need to review a pull request.

  2. Go to Pull Requests, and select the PR you need to review.

    If you need to review multiple PRs, you can right-click and open the PRs in separate windows or tabs.

  3. Select each tab on the PR to inspect the reviews, comments, code changes, commit history, PR check, and other details.

On the Conversation tab, you can read the PR description, comment history (including code comments), commit activity, and all other activity on the PR.

You can add images and videos to your PR comments. Videos must be 10MB or less. Harness Code supports and tests the following video file formats: .3gpp, .avi, .flv, .mkv, .mov, .mp4, and .webm. Other formats might work, but support isn't guaranteed.

If you need to share a comment with someone else, you can mention them directly with @username or you can copy the PR comment's direct link.

  1. If everything looks good, select Approve to approve the PR for merge. To request changes, select the dropdown next to Approve and select Request changes.

AI Code Review

You can automate an AI-powered review on pull requests by triggering a Harness pipeline on PR create/update events. The pipeline can call the Code Review Agent and post feedback as PR comments.

note

AI Code Review Summary requires Harness AI to be enabled in your account settings and may take a few to generate based on the size of your PR diff.

How it works

  1. A pipeline triggers on PR creation or updates.
  2. A Run step calls the Code Review Agent execute API.
  3. The agent analyzes the PR and posts review feedback back to the PR.

Example: Call the Code Review Agent from a Run step

Use a Run step (for example, curl) to invoke the agent:

POST https://app.harness.io/gateway/agents/api/v1/agents/Code%20Review/execute

The request body must include an inputs_yaml payload containing the following keys:

InputTypeDescription
llmKeysecretAnthropic API key used by the agent
harnessKeysecretHarness API key used to post PR comments
repostringRepository name. Consider using ${DRONE_REPO_NAME} as value
pullReqstringPull request number to review. Consider using <+codebase.prNumber> as value

The Code Review Agent analyzes the pull request and automatically posts structured feedback directly on the PR. The feedback appears as review comments with explanations and suggested code changes that can be committed from the PR UI.

The following example shows an AI-generated review comment with a suggested fix: