Skip to content

Commit

Permalink
update readme (coderabbitai#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
harjotgill authored Apr 23, 2023
1 parent 7751de6 commit a2a2f26
Showing 1 changed file with 35 additions and 50 deletions.
85 changes: 35 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,29 @@ This [OpenAI ChatGPT-based](https://platform.openai.com/docs/guides/chat) GitHub
Action provides a summary, release notes and review of pull requests. The unique
features of this action are:

- Unlike other approaches that provide a simple summary and/or conversation,
this action reviews the changes line by line and provides code change
suggestions that can be directly committed from the GitHub UI. The prompts
have been tuned carefully to comment on exact lines within changed hunks of
code.
- Continuous, yet incremental, reviews on each commit with a pull request. This
is unlike other approaches that provide a one-time review on the entire pull
request when requested by the user.
- Incremental reviews save on OpenAI costs while also reducing noise. Changed
files are tracked between commits and the base of the pull request
- The action is designed to be used with a "light" summarization model (e.g.
`gpt-3.5-turbo`) and a "heavy" review model (e.g. `gpt-4`). This allows for a
cheaper and faster summarization process and a more accurate review process.
**For best results, setting `gpt-4` as the "heavy" model instead of the
`gpt-3.5-turbo` (default) is highly recommended.**
- This action supports a conversation with the bot in the context of lines of
code or entire files. Useful for providing further context to the bot for its
next review, to generate test cases, to reduce complexity of the code and so
on.
- By default, the action is configured to skip more in-depth review when the
changes are simple (e.g. typo fixes). This is based on the triage done during
the summarization stage. This feature can be disabled by setting
`review_simple_changes` to `true`.
- By default, the action is configured to skip adding review comments when the
changes look good for the most part. This feature can be disabled by setting
`review_comment_lgtm` to `true`.
- You can tailor the following prompts:
- `system_message`: Defines the objective and the personality of the bot. You
can change this prompt to focus on or ignore certain aspects of the review
process, e.g. documentation, code quality, etc. Furthermore, you can even
change the bot to do marketing material review instead of code review.
- `summarize`: Summarizes the pull request into a table of changes etc.
- `summarize_release_notes`: Summarize the changes in the pull request for
release notes purposes.
- You can altogether skip the reviews, setting the `summary_only` to `true`. But
that defeats the main purpose of this action. Other tools such as GitHub's
[Copliot for Pull Requests](https://githubnext.com/projects/copilot-for-pull-requests)
may be a cheaper and good enough alternative in that case.

NOTES:

- Your code (files, diff, PR title/description) will be sent to OpenAI's servers
for processing. Please check with your compliance team before using this on
your private code repositories.
- OpenAI's API is used instead of ChatGPT session on their portal. OpenAI API
has a
[more conservative data usage policy](https://openai.com/policies/api-data-usage-policies)
compared to their ChatGPT offering.
- This action is not affiliated with OpenAI.
- **Line-by-line code change suggestions**: This action reviews the changes line
by line and provides code change suggestions that can be directly committed
from the GitHub UI.
- **Continuous, incremental reviews**: Reviews are performed on each commit
within a pull request, rather than a one-time review on the entire pull
request.
- **Cost-effective and reduced noise**: Incremental reviews save on OpenAI costs
and reduce noise by tracking changed files between commits and the base of the
pull request.
- **"Light" model for summary**: Designed to be used with a "light"
summarization model (e.g. `gpt-3.5-turbo`) and a "heavy" review model (e.g.
`gpt-4`). _For best results, use `gpt-4` as the "heavy" model, as thorough
code review needs strong reasoning abilities._
- **Chat with bot**: Supports conversation with the bot in the context of lines
of code or entire files, useful for providing context, generating test cases,
and reducing code complexity.
- **Smart review skipping**: By default, skips in-depth review for simple
changes (e.g. typo fixes) and when changes look good for the most part. It can
be disabled by setting `review_simple_changes` and `review_comment_lgtm` to
`true`.
- **Customizable prompts**: Tailor the `system_message`, `summarize`, and
`summarize_release_notes` prompts to focus on specific aspects of the review
process or even change the review objective.

## Usage

Expand Down Expand Up @@ -136,7 +110,7 @@ To ignore a PR, add the following keyword in the PR description:
- `OPENAI_API_KEY`: use this to authenticate with OpenAI API. You can get one
[here](https://platform.openai.com/account/api-keys). Please add this key to
your GitHub Action secrets.
- `OPENAI_API_ORG`: (optional) use this to use the specified organisation with
- `OPENAI_API_ORG`: (optional) use this to use the specified organization with
OpenAI API if you have multiple. Please add this key to your GitHub Action
secrets.

Expand Down Expand Up @@ -265,3 +239,14 @@ https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows

Set `debug: true` in the workflow file to enable debug mode, which will show the
messages

### Disclaimer

- Your code (files, diff, PR title/description) will be sent to OpenAI's servers
for processing. Please check with your compliance team before using this on
your private code repositories.
- OpenAI's API is used instead of ChatGPT session on their portal. OpenAI API
has a
[more conservative data usage policy](https://openai.com/policies/api-data-usage-policies)
compared to their ChatGPT offering.
- This action is not affiliated with OpenAI.

0 comments on commit a2a2f26

Please sign in to comment.