Preventing Pull Requests from Being Merged Without Proper Review
Code reviews are a critical safeguard for code quality. Even highly experienced developers can overlook issues after working on the same code for an extended period. A proper review introduces a fresβ¦
Code reviews are a critical safeguard for code quality. Even highly experienced developers can overlook issues after working on the same code for an extended period. A proper review introduces a fresh perspective that often uncovers problems missed during self-testing.
Skipping reviews for pull requests with a non-trivial number of code changes significantly increases the risk of defects, regressions, and production issues being introduced into the codebase.
Why merging pull requests without review is a problem
A thorough review process frequently identifies critical quality issues before code is deployed. When this step is skipped or reduced to a basic review:
- Important defects may go unnoticed
- Code quality and maintainability suffer
- Delivery risk increases significantly
- Problems are discovered later, when they are harder to fix
How to identify pull requests merged without review
To find pull requests that were merged without review:
- Open the Activity tab.
- Select Pull Requests.
- Click the Filter menu.
- Select Merged w/o Review.
This view can be filtered across all teams or narrowed down to pull requests submitted by specific teams.
The PRs merged without review metric is also available in the Quality Metrics Report under the Metrics tab.
You can also build a custom metrics dashboard to track unreviewed merges by team or repository. Learn more about building custom metrics dashboards .
Get alerted when a pull request is merged without review
LinearB Goals can be used to alert your team whenever a pull request is merged without review. Alerts are delivered through the WorkerB app to Slack or Microsoft Teams.
Learn how to connect WorkerB:
Team goal alerts can be configured to trigger:
- Whenever any pull request is merged without review
- Only when pull requests above a defined number of code changes are merged without review
Alerts include:
- The number of code changes merged without review
- The remaining allowed threshold before breaching the team goal
- A direct link to the pull request that triggered the alert
- Select the team you want to configure.
- Click the gear icon and open Team Settings.
- Navigate to the Goals tab.
- Locate the Merge only reviewed requests goal and click Edit.
- Set the acceptable threshold for code changes that can be merged without review.
-
Click the alert
icon to enable Slack or Microsoft Teams notifications.
Ways to remediate unreviewed merges
To reduce the quality risk introduced by pull requests merged without review, consider one or more of the following actions.
Revert the pull request
Git allows pull requests to be reverted, restoring the base branch to its pre-merge state. The branch can then be reviewed properly before being merged again.
Retroactively review the changes
Even after a pull request is merged, the changes can still be reviewed. If issues are identified, open a new branch to apply the necessary fixes.
Educate the team about the risks
When this behavior occurs, discuss it with the team and explain the risks associated with merging code without proper review.
How did we do?
Managing Large Pull Requests to Reduce Review Friction and Risk
Reducing High Pull Request Review Time