Review PRs
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.
-
In your repository, go to Pull Requests, and select your PR.
-
On the Conversation tab, in the Reviewers section, select More options (⋮).
-
Select the user that you want to assign as a reviewer.
To remove a reviewer, select More options (⋮) and deselect the reviewer.
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.
-
In Harness Code, go to the repository where you need to review a pull request.
-
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.
-
Select each tab on the PR to inspect the reviews, comments, code changes, commit history, PR check, and other details.
- Conversation
- Changes
- Commits
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.
On the Changes tab, you can review the aggregated, latest code changes in the PR and add comments. You can add a comment to a single line or multiple lines. Within your comments you can @ mention other users to notify them about your comments or request their feedback. You can also add code suggestions directly to your review comments by using the suggestion keyword, enclosed within triple backticks.
-
Select the
+Add icon to comment on a specific line. -
To comment on multiple lines at once, click the
+Add icon and drag your mouse to select all relevant lines you want to comment on. -
Select the Expand All icon view an entire file within the Changes context.
-
Select Viewed to mark a file as viewed and collapse the diff for that file.
This setting persists across sessions and machines. Files marked as viewed remain viewed/collapsed even if you open the PR on a different machine, browser, or refreshed/new browser session.
If a file changes after you mark it as viewed, the file is marked as Change since last viewed, so you don't have to manually check for changes to viewed files.
Harness Code also tracks file deletions and additions. For example, assume a file was deleted in a PR, and you marked the deletion as viewed. If, later in the PR's lifespan, the file is restored, Harness Code marks the restored file appropriately so you can review it in its restored state.
On the Commits tab, you can inspect commits included in the PR. This is useful if you need to trace the PR's change history across commits.
- 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.
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
- A pipeline triggers on PR creation or updates.
- A Run step calls the Code Review Agent execute API.
- 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:
| Input | Type | Description |
|---|---|---|
llmKey | secret | Anthropic API key used by the agent |
harnessKey | secret | Harness API key used to post PR comments |
repo | string | Repository name. Consider using ${DRONE_REPO_NAME} as value |
pullReq | string | Pull 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:
