Pull request reviews
A security review of every new commit on a pull request, with the findings posted on the pull request.
With reviews on, Interopt reviews the code each pull request changes and posts the result on the pull request: a check, a summary comment, and an inline comment on the line of each finding. Reviews work on GitHub, GitLab and Bitbucket.
Turning reviews on
For every repository
In Settings → General, under Pull request reviews, turn on Review pull requests. It applies to every repository connected through a code host, including ones you add later, unless a repository sets its own.
Fail the check at sets when the check fails: Critical, High and above, Medium and above, or Low and above. With Never, the default, the check passes whatever the review finds, so findings never block a merge.
For one repository
Open the repository in Dashboard → Assets and open Settings → Scanning.
Set Review pull requests to On or Off. Workspace default follows Settings → General.
Optionally, choose Fail the check at for this repository, or leave it on Workspace default.
Optionally, fill in Additional context: trusted services, how sign-in works, risks you accept. Every review and every scan of the repository reads it; it's the same text as Additional context on the New scan form.
Reviews run on repositories connected through a code host, not on uploaded code. When a workspace has the same repository added twice, each pull request is reviewed once.
Rules in the repository
A .interopt/rules.md file on the default branch also reaches the reviewer:
how your app's authorization works, which services are trusted, what to leave
out. Interopt reads it from the default branch only, so a pull request can't
change the rules for its own review.
When a review runs
A pull request is reviewed when it is opened, reopened, gets new commits, or leaves draft. A new commit pushed before the previous one's review starts replaces it.
These are not reviewed on their own:
- Drafts.
- Pull requests from forks.
- Bots, including the fix pull requests Interopt opens.
- Authors outside the repository. On GitHub the author must be an owner, member or collaborator; on GitLab a project member with the Developer role or above; on Bitbucket a member of the workspace.
To review one of these anyway, comment @interopt review or !review on the
pull request. The commenter must meet the same rule as an author. Pull requests
from forks are not reviewed, even on request.
What a review covers
A review reads the change from the commit where the branch left its target branch up to the latest commit, along with the code the change calls into, the repository's additional context and the rules file. Every finding it reports runs through a line the pull request changed.
Nothing in the pull request is run. The review runs without internet access, and the pull request's code is only read.
On the pull request
- The check, named Interopt security review. It fails only when a finding reaches the severity chosen under Fail the check at. A review that could not run or finish never fails the check; it says why instead, for example Not enough credits to review this pull request.
- The summary comment, edited in place on every review: the findings by severity, each linked to its page in Interopt. Findings outside the changed lines, in code the change reaches, have their own section. With none, it says No issues found in the changed code.
- An inline comment on the changed line of each finding, with a link to its proof. On GitHub and GitLab, when the fix Interopt drafted changes at most 30 lines, all of them in the pull request's changes, the comment carries it as a suggested change you can commit from the pull request. On Bitbucket, the comment links to the fix in Interopt.
- Resolved threads. Each review resolves the thread of a finding that is fixed at the latest commit, marked a false positive, or accepted, and says which.
On a public repository the summary gives the number of findings by severity and a link to the review in Interopt, and no inline comments are posted.
Replying to a finding
Reply under an inline comment with a command, or say the same in your own words:
| Reply | What happens |
|---|---|
!fp <reason> | The finding is marked a false positive, with your reason as its justification, and the thread is resolved. |
!accepted_risk <reason> | The risk is accepted for 90 days and the thread is resolved. The reason is added to the repository's additional context, which later reviews and scans read. |
!fix | Interopt opens its drafted fix as a pull request on top of your branch. With no fix drafted, the reply links to the finding's page, where you can ask for one. |
!why | Interopt replies with why the finding matters, and a link to its proof. |
On GitHub, the first three need an Interopt account you signed in to with the same GitHub account, and the right to change findings in the workspace. A workspace that requires two-factor authentication or a specific sign-in method refuses them, because a reply doesn't come with a signed-in session; triage on the finding's page instead.
On GitLab and Bitbucket, Interopt can't tell which Interopt user wrote a
comment, so !why is answered and the others get a link to the finding's page,
where you can triage it. See
Triage and status.
Findings stay with the branch
Findings from a review belong to the pull request's branch. A review never closes or reopens a finding that a scan of your production code found. When a pull request is closed without merging, its branch's open findings close with it, and reviews of it that haven't started are stopped.
Cost
| Plan | A review costs |
|---|---|
| Free and Starter | Its changed lines, from the monthly changed-line budget |
| Team and above | 3 credits |
Another review of the same pull request within 24 hours of a charged one is free and draws no changed lines. When the credits or the budget left don't cover a review, it doesn't run, and the check and summary comment say so. See Billing and usage.
Permissions
Reviews use the permissions listed under Code hosts → Permissions. On GitHub, an organization owner accepts the app's updated permissions once, from the installation's settings. Until then, no check appears and replies go unanswered.