Skip to content

ci: Add config file for CodeRabbit with custom rules#312

Merged
spetrosi merged 1 commit into
mainfrom
coderabbit-init
May 19, 2026
Merged

ci: Add config file for CodeRabbit with custom rules#312
spetrosi merged 1 commit into
mainfrom
coderabbit-init

Conversation

@spetrosi
Copy link
Copy Markdown
Collaborator

@spetrosi spetrosi commented May 19, 2026

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 CodeRabbit configuration to enforce repository-specific contribution and review conventions.

CI:

  • Configure CodeRabbit review settings to disable non-essential features and automate pre-merge title and description checks based on project conventions.

Documentation:

  • Define contribution-related guidance in CodeRabbit path-specific instructions to ensure tasks, tests, variables, templates, and README usage stay aligned with documented best practices.

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>
@spetrosi spetrosi self-assigned this May 19, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 19, 2026

Reviewer's Guide

Adds a new .coderabbit.yaml configuration file to integrate CodeRabbit code review automation with this repository, encoding project-specific conventions and review rules for Ansible roles, tests, templates, variables, Python code, and PR metadata.

File-Level Changes

Change Details Files
Introduce CodeRabbit configuration to control review behavior and encode repository conventions.
  • Add .coderabbit.yaml with global chat and review feature toggles, disabling non-essential or decorative features and auto-automation behaviors.
  • Define pre-merge checks that enforce Conventional Commits-style PR titles and a structured PR description template via warnings.
  • Add path-specific review instructions for Ansible tasks, handlers, tests, templates, defaults/vars variable naming, Python code style, and README documentation expectations, tailored to linux-system-roles conventions.
.coderabbit.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Several path-specific instructions in .coderabbit.yaml (e.g., kernel_settings_* variables, system_role:kernel_settings fingerprint, __kernel_settings_is_ostree) appear tightly coupled to the kernel_settings role; if this repo is for a different role, consider parameterizing or generalizing these to avoid misleading or incorrect guidance.
  • The test playbook instructions hardcode the use of tasks/run_role_with_clear_facts.yml and a specific invocation pattern; double-check that this wrapper and naming convention exist in this repository to prevent CodeRabbit from repeatedly flagging valid role invocation patterns as violations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Several path-specific instructions in `.coderabbit.yaml` (e.g., `kernel_settings_*` variables, `system_role:kernel_settings` fingerprint, `__kernel_settings_is_ostree`) appear tightly coupled to the `kernel_settings` role; if this repo is for a different role, consider parameterizing or generalizing these to avoid misleading or incorrect guidance.
- The test playbook instructions hardcode the use of `tasks/run_role_with_clear_facts.yml` and a specific invocation pattern; double-check that this wrapper and naming convention exist in this repository to prevent CodeRabbit from repeatedly flagging valid role invocation patterns as violations.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@spetrosi spetrosi merged commit b69bffa into main May 19, 2026
46 checks passed
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