ci: Add config file for CodeRabbit with custom rules#333
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>
Reviewer's GuideAdds a repository-wide CodeRabbit configuration (.coderabbit.yaml) that encodes linux-system-roles conventions, disables non-essential CodeRabbit features, and defines path-specific review rules for Ansible tasks, tests, templates, variables, Python code, and documentation. Flow diagram for CodeRabbit review using .coderabbit.yamlflowchart TD
A[GitHub_PR_opened] --> B[CodeRabbit_reviews]
B --> C[Load_coderabbit_yaml]
C --> D[Apply_pre_merge_checks]
D --> D1[Check_PR_title_format]
D --> D2[Check_PR_description_template]
C --> E[Apply_path_instructions]
E --> E1[Review_tasks_yml_rules]
E --> E2[Review_tests_yml_rules]
E --> E3[Review_templates_j2_rules]
E --> E4[Review_defaults_vars_yml_rules]
E --> E5[Review_python_files_rules]
E --> E6[Review_README_md_rules]
C --> F[Disable_nonessential_features]
F --> F1[Disable_auto_labels_and_reviewers]
F --> F2[Disable_sequence_diagrams_and_summaries]
F --> F3[Disable_finishing_touches_unit_tests]
D1 --> G[Emit_warnings_if_violations]
D2 --> G
E1 --> G
E2 --> G
E3 --> G
E4 --> G
E5 --> G
E6 --> G
G --> H[Post_review_comments_on_PR]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".coderabbit.yaml" line_range="203-204" />
<code_context>
+ - All variables MUST be stored in the file defaults/main.yml, Ansible
+ doesn't include variables from other files.
+ - These are user-facing API variables
+ - For every new variable introduced in this file, verify that it is
+ documented in README.md with a description and a usage example.
+ If it is missing from README.md, flag it and request that it be added.
+
</code_context>
<issue_to_address>
**suggestion:** Clarify scope of the statement about Ansible not including variables from other files.
The phrase `Ansible doesn't include variables from other files.` is accurate for role defaults (only `defaults/main.yml` is auto-loaded) but can be misread as a general rule about all Ansible variables. Please narrow it to something like `Ansible only auto-loads role defaults from defaults/main.yml` to avoid confusion with mechanisms like `include_vars`.
```suggestion
- All variables MUST be stored in the file defaults/main.yml, Ansible
only auto-loads role defaults from defaults/main.yml and does not
automatically include variables from other files.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| - All variables MUST be stored in the file defaults/main.yml, Ansible | ||
| doesn't include variables from other files. |
There was a problem hiding this comment.
suggestion: Clarify scope of the statement about Ansible not including variables from other files.
The phrase Ansible doesn't include variables from other files. is accurate for role defaults (only defaults/main.yml is auto-loaded) but can be misread as a general rule about all Ansible variables. Please narrow it to something like Ansible only auto-loads role defaults from defaults/main.yml to avoid confusion with mechanisms like include_vars.
| - All variables MUST be stored in the file defaults/main.yml, Ansible | |
| doesn't include variables from other files. | |
| - All variables MUST be stored in the file defaults/main.yml, Ansible | |
| only auto-loads role defaults from defaults/main.yml and does not | |
| automatically include variables from other files. |
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
Add a CodeRabbit configuration file to standardize automated PR reviews and enforce project-specific conventions for this repository.
CI:
Documentation:
Chores: