From 649b7404d3b1d387be936d2d77430e387c5aee20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 10 May 2024 15:30:59 +0200 Subject: [PATCH] Set up CodeRabbit for AI code reviews (#15813) --- .coderabbit.yaml | 26 +++++++++++++++++++ OrchardCore.sln | 1 + .../guides/contributing/contributing-code.md | 1 + .../contributing/reviewing-pull-requests.md | 1 + 4 files changed, 29 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000000..1f8f1dfa992 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,26 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json + +# Schema with docs on the properties: https://coderabbit.ai/integrations/coderabbit-overrides.v2.json. Docs: +# https://docs.coderabbit.ai/guides/configure-coderabbit. This only includes overrides for defaults and mandatory +# elements. + +early_access: true +reviews: + # This would allow the bot to approve a PR. Since we always need a human to approve (and merge), we don't use this, + # so it doesn't add noise to the pull request filters like + # https://github.com/OrchardCMS/OrchardCore/pulls?q=is%3Apr+is%3Aopen+review%3Anone. + request_changes_workflow: false + # Very rarely contains useful info, mostly is just noise. + high_level_summary: false + # We really don't need a poem. + poem: false + # The review status comment is useful for debugging but not otherwise. + review_status: false + # The code walkthrough's text may take a lot of space, so collapsing it is nicer UX. + collapse_walkthrough: true + # On-demand reviews are available but PRs are not reviewed automatically. + auto_review: + enabled: false + drafts: false +chat: + auto_reply: true diff --git a/OrchardCore.sln b/OrchardCore.sln index 7f6448239cd..e98e52723f4 100644 --- a/OrchardCore.sln +++ b/OrchardCore.sln @@ -252,6 +252,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Workflows.Abstr EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{68F6113F-2F08-4412-B5E7-41B7164A0C7F}" ProjectSection(SolutionItems) = preProject + .coderabbit.yaml = .coderabbit.yaml .editorconfig = .editorconfig gulpfile.js = gulpfile.js package.json = package.json diff --git a/src/docs/guides/contributing/contributing-code.md b/src/docs/guides/contributing/contributing-code.md index 4da2c94fd97..a2cc0b07ed9 100644 --- a/src/docs/guides/contributing/contributing-code.md +++ b/src/docs/guides/contributing/contributing-code.md @@ -67,6 +67,7 @@ All code submissions will be reviewed and tested by the core team, and only thos - Feel free to mark conversations that you addressed to keep track of them with an emoji or otherwise, just don't resolve them. - Please keep conversations happening in line comments in those convos, otherwise, communication will be a mess. If you have trouble finding them, see [this video](https://github.com/OrchardCMS/OrchardCore/pull/14749#issuecomment-1917976028). - When you're done addressing all feedback of a review, click ["Re-request review"](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/incorporating-feedback-in-your-pull-request#re-requesting-a-review) in the top-right corner for each reviewer when you're ready for another round of review, so they know that you're done. +- [CodeRabbit](https://coderabbit.ai/) is available for AI on-demand code reviews, which they graciously provide for us as an open-source project for free. You can ask the bot for a code review with a `@coderabbitai review` comment under any pull request. You can have a conversation with it under its comments too. Note that AI code reviews can help, but are frequently incorrect; use your best judgment. !!! tip Do you want to demo what you've done to others, to showcase your work and to gather feedback? Join one of [our meetings](../../resources/meeting/README.md). diff --git a/src/docs/guides/contributing/reviewing-pull-requests.md b/src/docs/guides/contributing/reviewing-pull-requests.md index 44bc52da582..7424d02d438 100644 --- a/src/docs/guides/contributing/reviewing-pull-requests.md +++ b/src/docs/guides/contributing/reviewing-pull-requests.md @@ -24,6 +24,7 @@ If the PR is coming from a fork, working with its code locally won't be as trivi - Be sure to merge PRs that don't need a second opinion. This is especially important for external contributors who can't merge their PRs. Keeping PRs open will make them collect merge conflicts and make the contributor demotivated. - Be especially patient and encouraging with first-time contributors. This is indicated by such a flag on the PR. - You can add the [Feedback section](contributing-code.md) to your review comment (i.e. the one that you send your per-line comments with) to remind the author about the practices. +- You can ask [CodeRabbit](https://coderabbit.ai/) for an AI code review with a `@coderabbitai review` comment under any PR. ## Backporting Pull Requests to Another Branch