ci: Add config file for CodeRabbit with custom rules#291
Merged
Conversation
Sourcery that we currently use cannot read documentation files and best practices, it's rather a refactoring tool. So I want to introduce CodeRabbit that allows creating .coderabbit.yaml with custom rules and conventions. Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
Contributor
Reviewer's GuideAdds a CodeRabbit configuration file (.coderabbit.yaml) tailored for this repository, disabling nonessential AI review features, enforcing PR title/description conventions, and defining path-specific review instructions for Ansible tasks, handlers, tests, templates, variables, Python, and documentation in line with linux-system-roles best practices. Flow diagram for CodeRabbit review using .coderabbit.yamlflowchart TD
A[PR opened/updated] --> B[CodeRabbit triggered]
B --> C[Load .coderabbit.yaml]
C --> D[Apply global review settings
- fun features disabled
- auto features disabled]
C --> E[Run pre_merge_checks
- title format
- description template]
C --> F[Evaluate changed files
by path]
F --> G[tasks/**/*.yml
Check no_log, package, tests]
F --> H[handlers/**/*.yml
Check no_log usage]
F --> I[tests/tests_*.yml
Check role invocation
and test quality]
F --> J[templates/**/*.j2
Check required headers]
F --> K[defaults/**/*.yml
Check kdump_ vars
documented]
F --> L[vars/**/*.yml
Check __kdump_ vars]
F --> M[**/*.py
Check PEP8/Black]
F --> N[README.md
Check new vars documented]
D --> O[Review report with warnings]
E --> O
G --> O
H --> O
I --> O
J --> O
K --> O
L --> O
M --> O
N --> O
O --> P[Posted as CodeRabbit review
comments on PR]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The path instructions are very kdump-specific (e.g.,
kdump_secure_logging,__kdump_is_ostree,system_role:kdump), which may not generalize well to other linux-system-roles if this config is meant to be reused globally; consider parameterizing or templating these role-specific names. - The tasks section instructs reviewers to enforce test coverage, while
finishing_touches.unit_tests.enabledis disabled; if the intent is to avoid automated test-related suggestions, consider aligning these settings or clarifying which mechanism should actually enforce test expectations.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The path instructions are very kdump-specific (e.g., `kdump_secure_logging`, `__kdump_is_ostree`, `system_role:kdump`), which may not generalize well to other linux-system-roles if this config is meant to be reused globally; consider parameterizing or templating these role-specific names.
- The tasks section instructs reviewers to enforce test coverage, while `finishing_touches.unit_tests.enabled` is disabled; if the intent is to avoid automated test-related suggestions, consider aligning these settings or clarifying which mechanism should actually enforce test expectations.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sourcery that we currently use cannot read documentation files and best
practices, it's rather a refactoring tool.
So I want to introduce CodeRabbit that allows creating .coderabbit.yaml with
custom rules and conventions.
Signed-off-by: Sergei Petrosian spetrosi@redhat.com
Summary by Sourcery
Introduce a CodeRabbit configuration file to standardize automated review behavior and enforce repository-specific contribution conventions.
CI:
Documentation:
Chores: