Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ai-pr-reviewer.yml #92

Closed
wants to merge 3 commits into from
Closed

Create ai-pr-reviewer.yml #92

wants to merge 3 commits into from

Conversation

italux
Copy link
Owner

@italux italux commented Apr 28, 2024

Description

CodeRabbit ai-pr-reviewer is an AI-based code reviewer and summarizer for GitHub pull requests using OpenAI's gpt-3.5-turbo and gpt-4 models. It is designed to be used as a GitHub Action and can be configured to run on every pull request and review comments

Checklist

  • All tests are passing
  • New tests were created to address changes in pr (and tests are passing)
  • Updated README and/or documentation, if necessary

@italux
Copy link
Owner Author

italux commented Apr 28, 2024

Image description CodeRabbit


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

Copy link
Owner Author

@italux italux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 24bb288 and 888b676 commits.
Files selected (1)
  • .github/workflows/ai-pr-reviewer.yml (1)
Files not summarized due to errors (1)
  • .github/workflows/ai-pr-reviewer.yml (nothing obtained from openai)
Files not reviewed due to errors (1)
  • .github/workflows/ai-pr-reviewer.yml (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link
Owner Author

@italux italux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 24bb288 and 888b676 commits.
Files selected (1)
  • .github/workflows/ai-pr-reviewer.yml (1)
Files not summarized due to errors (1)
  • .github/workflows/ai-pr-reviewer.yml (nothing obtained from openai)
Review comments generated (1)
  • Review: 1
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines +1 to +30
name: Code Review

permissions:
contents: read
pull-requests: write

on:
pull_request:
pull_request_review_comment:
types: [created]

concurrency:
group:
${{ github.repository }}-${{ github.event.number || github.head_ref ||
github.sha }}-${{ github.workflow }}-${{ github.event_name ==
'pull_request_review_comment' && 'pr_comment' || 'pr' }}
cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }}

jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: coderabbitai/ai-pr-reviewer@latest
env:
GITHUB_TOKEN: ${{ secrets.AI_PR_GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.AI_PR_OPENAI_API_KEY }}
with:
debug: false
review_simple_changes: false
review_comment_lgtm: false
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The workflow file seems to be well structured and follows the standard GitHub Actions format. However, there are a few points that need attention:

  1. The permissions section is set to read contents and write pull requests. This is good for security as it limits the scope of what this action can do.

  2. The concurrency section is used to ensure that only one instance of this workflow runs at a time per pull request. This is a good practice to prevent race conditions.

  3. The jobs section specifies that this workflow will run on the latest version of Ubuntu and uses the coderabbitai/ai-pr-reviewer@latest. It's generally recommended to pin actions to a specific commit or version for stability and security reasons. Using latest could potentially introduce breaking changes or vulnerabilities if the action is updated.

  4. The environment variables GITHUB_TOKEN and OPENAI_API_KEY are fetched from secrets which is a secure way to handle sensitive data.

  5. In the with section, debug, review_simple_changes, and review_comment_lgtm are all set to false. Depending on your needs, you might want to enable some of these options. For example, setting review_simple_changes to true would make the bot review even simple changes, which could be useful for catching small mistakes.

Here's a suggested change to pin the action to a specific version:

-       - uses: coderabbitai/ai-pr-reviewer@latest
+       - uses: coderabbitai/ai-pr-reviewer@v1.0.0

@italux
Copy link
Owner Author

italux commented Sep 22, 2024

Use Pro version

@italux italux closed this Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant