Skip to content

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

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

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

Conversation

@spetrosi
Copy link
Copy Markdown
Contributor

@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 initial CodeRabbit configuration to enforce repository-specific PR conventions and Ansible role best practices.

New Features:

  • Introduce a .coderabbit.yaml configuration file to enable CodeRabbit reviews for this repository with customized behavior and disabled nonessential features.

Enhancements:

  • Define repository-specific PR title and description requirements aligned with existing contribution guidelines.
  • Add path-based review instructions covering Ansible tasks, handlers, tests, templates, variable files, Python code, and documentation to standardize code and documentation quality expectations.

Documentation:

  • Capture contribution and documentation expectations for variables and README updates within the automated review configuration.

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 requested a review from richm as a code owner May 19, 2026 08:40
@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 CodeRabbit configuration file tailored for linux-system-roles, defining review behavior, disabling nonessential AI features, enforcing PR metadata conventions, and providing path-specific review instructions for Ansible roles, tests, templates, variables, Python code, and documentation.

File-Level Changes

Change Details Files
Introduce repository-wide CodeRabbit configuration to control review behavior and metadata requirements.
  • Add .coderabbit.yaml with top-level chat and reviews configuration
  • Disable fun, auto, and additional review features to keep reviews focused and deterministic
  • Configure finishing_touches to skip unit test suggestions
  • Define pre-merge checks for Conventional Commit-style PR titles and structured PR descriptions based on the existing template
.coderabbit.yaml
Define path-specific CodeRabbit review instructions aligned with linux-system-roles best practices.
  • Add Ansible tasks guidance covering no_log usage, OSTree-compatible package installation, idempotency, check mode support, and test coverage expectations
  • Add handlers, tests, templates, defaults, and vars instructions enforcing sudo role conventions (naming, invocation patterns, required headers, and documentation of user-facing variables)
  • Add Python review rules requiring PEP 8 and Black formatting with tox checks
  • Add README review rules to ensure documentation and usage examples for new user-facing variables
.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:

  • The **/*.yml path patterns (e.g., tasks/**/*.yml, handlers/**/*.yml, etc.) may not match top‑level files like tasks/main.yml depending on CodeRabbit’s glob semantics; consider adding explicit tasks/*.yml, handlers/*.yml, etc., if needed to ensure coverage.
  • If the repository uses .yaml files in addition to .yml (for tasks, vars, tests, etc.), you may want to mirror each *.yml path with a corresponding *.yaml pattern so the same review rules apply consistently.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `**/*.yml` path patterns (e.g., `tasks/**/*.yml`, `handlers/**/*.yml`, etc.) may not match top‑level files like `tasks/main.yml` depending on CodeRabbit’s glob semantics; consider adding explicit `tasks/*.yml`, `handlers/*.yml`, etc., if needed to ensure coverage.
- If the repository uses `.yaml` files in addition to `.yml` (for tasks, vars, tests, etc.), you may want to mirror each `*.yml` path with a corresponding `*.yaml` pattern so the same review rules apply consistently.

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 9772f53 into main May 19, 2026
38 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