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

Set up CodeRabbit for AI code reviews (Lombiq Technologies: OCORE-159) #15813

Merged
merged 8 commits into from
May 10, 2024

Conversation

Piedone
Copy link
Member

@Piedone Piedone commented Apr 23, 2024

Fixes #15439.

While I've set up CodeRabbit for the repository from the UI for now, so it'll work immediately, the long-term better option is to configure it from a file. So, here I'm adding that too (it'll take precedence over the UI config).

Copy link
Contributor

coderabbitai bot commented Apr 23, 2024

Walkthrough

This update integrates the CodeRabbit AI tool into the OrchardCore project, enhancing the code review process with AI capabilities. It includes configuration settings for early access and review workflows, and documentation updates to guide contributors on interacting with AI reviews.

Changes

File Path Change Summary
.coderabbit.yaml, OrchardCore.sln Introduced CodeRabbit configuration and added to Solution Items.
src/.../contributing/contributing-code.md Updated docs to include guidance on AI code reviews.

Possibly related issues


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Out of diff range and nitpick comments (2)
.coderabbit.yaml (1)

3-5: Consider adding more detailed documentation links directly related to each configuration section for better clarity.

src/docs/guides/contributing/contributing-code.md (1)

70-70: Clarify the expectations from contributors when interacting with CodeRabbit AI reviews, especially regarding the handling of potential inaccuracies.

@Piedone Piedone marked this pull request as draft April 23, 2024 23:07
@Piedone Piedone mentioned this pull request Apr 23, 2024
3 tasks
@MikeAlhayek
Copy link
Member

Your rabbit is limited :)

image

@Piedone
Copy link
Member Author

Piedone commented Apr 23, 2024

It's still young :( :D.

This can happen if you have two reviews close to each other, like if you open multiple PRs within a few minutes, or instruct it to review manually multiple times. Was this the case?

@MikeAlhayek
Copy link
Member

probably opened multiple PR with in close time.

@MikeAlhayek
Copy link
Member

Did you find this useful yet? So far it just extra unwelcome noise for me.

@lampersky
Copy link
Contributor

Did you find this useful yet? So far it just extra unwelcome noise for me.

same here 😀

@Piedone
Copy link
Member Author

Piedone commented Apr 24, 2024

It's a mixed bag. From where it actually added actionable comments (there were a few where it couldn't):

@Piedone
Copy link
Member Author

Piedone commented May 1, 2024

Please vote: #15935.

@Piedone Piedone changed the title Set up CodeRabbit for AI code reviews Set up CodeRabbit for AI code reviews (Lombiq Technologies: OCORE-159) May 3, 2024
@Piedone Piedone marked this pull request as ready for review May 3, 2024 17:55
Copy link
Contributor

github-actions bot commented May 5, 2024

This pull request has merge conflicts. Please resolve those before requesting a review.

# Conflicts:
#	src/docs/guides/contributing/reviewing-pull-requests.md
@hishamco
Copy link
Member

Can we let some workflows trigger when files within specific folders change, such as this PR I don't think there's a need to execute Build, Functional Tests while your change in docs

@Piedone
Copy link
Member Author

Piedone commented May 10, 2024

Yeah, some of the workflows already do that. A downside to not running the build is that we can't have a branch protection rule like currently to prevent merges if the build didn't complete.

@Piedone Piedone merged commit 649b740 into OrchardCMS:main May 10, 2024
11 checks passed
@Piedone
Copy link
Member Author

Piedone commented May 13, 2024

Actually, that's already the case for the fictional tests, just the CodeRabbit YAML file was an exception to the rule.

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.

CodeRabbit for AI code reviews
4 participants