Skip to content
ES EN
Theme: automatic

How to Evaluate Automated Code Review with GreenLight

A guide to understanding PyTorch's GreenLight and designing low-risk automated reviews, with clear boundaries and human review for sensitive changes.

AI for developers

When generated code grows faster than the capacity to review it, automatic approval seems like a tempting way out. PyTorch is testing a scoped alternative: GreenLight reviews pull requests from eligible maintainers and can only approve them within configured rules. The idea is not to remove people from all reviews, but to reserve their attention for higher-risk changes.

How to Evaluate Automated Code Review with GreenLight

This guide helps understand the model and decide if it fits a team; it's not an installation recipe or a universal configuration. To follow the reference design, we can read the RADAR paper abstract and review the public GreenLight code. The described behavior corresponds to the available material and does not guarantee that another repository will yield the same results.

What you need

Before considering automatic approval, you need integration rules that identify who can approve changes in each file. In PyTorch, GreenLight only provides an effective verdict if the merge rules include the person who opened the request; for others, it works in shadow mode and its reviews do not become approvals. We also need to distinguish low-risk changes from those that should remain in human hands.

It's helpful to understand the difference between deterministic filters and model review. The Meta RADAR document first presents eligibility limits and a risk score; then, a review agent examines the change. If a check fails, the change goes to a person. The PyTorch devlog explains why limiting approval to maintainers is part of the system's trustworthiness.

Preparing the review workflow

  1. First, define the group of eligible authors using existing merge rules. Do not confuse a shadow mode review with actual authorization.
  2. Separate classes of changes that could qualify for automation from those requiring human review. RADAR excludes, among others, open-source code and code under SOX controls.
  3. Establish conservative controls and thresholds. In RADAR, change sources and types have different limits; there isn't a single cutoff that works for all.
  4. Decide what the system will do if any control fails: in the described design, the output is to request human review, not to approve by default.
  5. Observe approvals, blocks, rollbacks, and failures, and review thresholds against historical data. Maintain a way to revoke an automatic approval when the verdict changes.

We can summarize the decision sequence as follows. This is a conceptual outline based on the article, not GreenLight configuration code or an interface that can be copied as is. The utility lies in making the order explicit: eligibility first, evaluation second, and approval only at the end.

if author is not eligible:
    shadow mode review
if change does not pass security checks:
    human review
if risk score exceeds limit:
    human review
if agent does not confirm a safe pattern:
    human review
else:
    automatic approval

In GreenLight, eligible request scanning occurs every five minutes. An approval verdict approves and labels the request; a rejection verdict withdraws a previous approval. The project also indicates that a reverted request is permanently excluded from all paths. For a team, these details matter as much as the model: automation needs observable states and a defined way to correct decisions.

Tip Start by measuring the flow in shadow mode, if the tool and team allow it, before granting approval authority. In PyTorch, shadow mode is used for authors who do not meet the eligibility rule, but the source does not state that it is a mandatory deployment phase for everyone.

What to check before expanding scope

Don't measure success solely by the number of automatically approved changes. OpenAI's described experience links everyday approval to the type of change and reserves validations and human decision-making for critical changes; their team reviews agent behavior and adjusts controls. This is their own policy, not a guarantee that the same threshold will work in another organization. You can read the context of that presentation at QCon San Francisco.

It's also important to separate product claims from general data. Sonar cites a survey in which 76% of over a thousand participants said they generate code with AI faster than they can verify it, and 39% claimed to always check it before committing. This signals pressure on review, not a direct measure of GreenLight's performance. The Sonar survey and its explanation of the agentic software factory help put this perspective into context.

The practical criterion is narrow: automate only changes for which you can define reliable authorship, verifiable boundaries, an escalation path to a human, and rollback tracking. If you can't explain why a class of change is low-risk, you don't yet have a good candidate for automatic approval.

Original source: infoq.com

Article generated with AI.larebelion

Kernel

· CTO · Spain

«Automating approval is only prudent when you also define which changes should be stopped.»

Comments (0)

No comments yet. You can be the first.

Write a comment