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

feat: added bedrock ai pr reviewer #1

Merged
merged 4 commits into from
Oct 2, 2024
Merged

feat: added bedrock ai pr reviewer #1

merged 4 commits into from
Oct 2, 2024

Conversation

wolivera
Copy link
Contributor

@wolivera wolivera commented Oct 2, 2024

Summary (generated)

Release Notes:

  • New Feature: Implemented GitHub Actions workflow for automated pull request reviews using Bedrock AI PR Reviewer.
  • Chore: Added configuration for AWS credentials in the workflow.
  • New Feature: Enabled automatic "LGTM" comments for simple changes.
  • New Feature: Configured specific Bedrock AI models for PR reviews.

This update introduces an automated PR review process, enhancing code quality and streamlining the development workflow. Users can expect faster feedback on their contributions and improved consistency in code reviews.

Copy link

github-actions bot commented Oct 2, 2024

Walkthrough

This change introduces a GitHub Actions workflow for automated pull request reviews using Bedrock AI. The workflow is triggered by pull request events and review comments. It sets up AWS credentials and utilizes the Bedrock PR Reviewer action to analyze changes, potentially leaving "LGTM" comments for simple modifications. This automation aims to streamline the code review process and enhance overall development efficiency.

Changes

Files Summary
.github/workflows/ai-pr-reviewer.yml Adds a new GitHub Actions workflow for automated PR reviews using Bedrock AI, configuring AWS credentials and specifying review options.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Commits Files that changed from the base of the PR and between 7e2a96a and 7476c12 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 bedrock)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with AI reviewer (/reviewbot)

  • 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 /reviewbot 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 /reviewbot: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Commits Files that changed from the base of the PR and between 7476c12 and cf021a7 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 bedrock)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with AI reviewer (/reviewbot)

  • 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 /reviewbot 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 /reviewbot: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Commits Files that changed from the base of the PR and between cf021a7 and 8c4493e 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 bedrock)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with AI reviewer (/reviewbot)

  • 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 /reviewbot 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 /reviewbot: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Commits Files that changed from the base of the PR and between 7e2a96a and 8c4493e 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 bedrock)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with AI reviewer (/reviewbot)

  • 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 /reviewbot 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 /reviewbot: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Commits Files that changed from the base of the PR and between 8c4493e and 9c331ae commits.
Files selected (1)
  • .github/workflows/ai-pr-reviewer.yml (1)
Review comments generated (3)
  • Review: 3
  • LGTM: 0

Tips

Chat with AI reviewer (/reviewbot)

  • 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 /reviewbot 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 /reviewbot: ignore anywhere in the PR description to pause further reviews from the bot.

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
Copy link

Choose a reason for hiding this comment

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

The AWS_ROLE_ARN secret is being used here. Ensure that this secret is properly set in your repository's secrets settings to avoid deployment issues.

- name: PR review
uses: tmokmss/bedrock-pr-reviewer@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link

Choose a reason for hiding this comment

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

Using secrets.GITHUB_TOKEN is generally safe, but make sure the permissions set at the top of the workflow file (lines 3-6) are the minimum required for the action to function properly.

Comment on lines +37 to +38
bedrock_light_model: 'us.anthropic.claude-3-haiku-20240307-v1:0'
bedrock_heavy_model: 'us.anthropic.claude-3-5-sonnet-20240620-v1:0'
Copy link

Choose a reason for hiding this comment

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

The Bedrock model versions are hardcoded. Consider using variables or repository secrets for these values to make it easier to update in the future without changing the workflow file.

@wolivera wolivera merged commit 5f859d1 into main Oct 2, 2024
1 check passed
@wolivera wolivera deleted the feat/pr-reviewer branch October 2, 2024 13:54
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