Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 3.47 KB

REVIEW.md

File metadata and controls

57 lines (42 loc) · 3.47 KB

Review Tool

The review tool scans the PR code changes, and automatically generates a PR review. It can be invoked manually by commenting on any PR:

/review

For example:

The review tool can also be triggered automatically every time a new PR is opened. See examples for automatic triggers for GitHub App and GitHub Action

Configuration options

Under the section 'pr_reviewer', the configuration file contains options to customize the 'review' tool:

  • require_focused_review: if set to true, the tool will add a section - 'is the PR a focused one'. Default is false.
  • require_score_review: if set to true, the tool will add a section that scores the PR. Default is false.
  • require_tests_review: if set to true, the tool will add a section that checks if the PR contains tests. Default is true.
  • require_security_review: if set to true, the tool will add a section that checks if the PR contains security issues. Default is true.
  • require_estimate_effort_to_review: if set to true, the tool will add a section that estimates thed effort needed to review the PR. Default is true.
  • num_code_suggestions: number of code suggestions provided by the 'review' tool. Default is 4.
  • inline_code_comments: if set to true, the tool will publish the code suggestions as comments on the code diff. Default is false.
  • automatic_review: if set to false, no automatic reviews will be done. Default is true.
  • extra_instructions: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".

Incremental Mode

For an incremental review, which only considers changes since the last PR-Agent review, this can be useful when working on the PR in an iterative manner, and you want to focus on the changes since the last review instead of reviewing the entire PR again, the following command can be used:

/improve -i

Note that the incremental mode is only available for GitHub.

PR Reflection

By invoking:

/reflect_and_review

The tool will first ask the author questions about the PR, and will guide the review based on his answers.

A note on code suggestions quality

  • With current level of AI for code (GPT-4), mistakes can happen. Not all the suggestions will be perfect, and a user should not accept all of them automatically.

  • Suggestions are not meant to be simplistic. Instead, they aim to give deep feedback and raise questions, ideas and thoughts to the user, who can then use his judgment, experience, and understanding of the code base.

  • Recommended to use the 'extra_instructions' field to guide the model to suggestions that are more relevant to the specific needs of the project.

  • Unlike the 'review' feature, which does a lot of things, the 'improve --extended' feature is dedicated only to suggestions, and usually gives better results.