Skip to content

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

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

ci: Add config file for CodeRabbit with custom rules#351
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

CI:

  • Configure CodeRabbit reviews with custom rules for PR titles, descriptions, and file-type-specific review guidelines.

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 review rules, conventions, and path-based instructions for Ansible roles, tests, templates, variables, Python code, and documentation.

File-Level Changes

Change Details Files
Introduce CodeRabbit configuration with global review behavior and PR metadata checks.
  • Configure global chat and reviews options, disabling cosmetic and automatic features such as poems, fortunes, auto-assignment, auto-labeling, and finishing touches unit-test prompts.
  • Define pre-merge checks that enforce Conventional Commit-style PR titles in warning mode.
  • Add a custom pre-merge description check requiring a structured PR template with Enhancement/Feature, Reason, Result, and optional Issue Tracker sections.
.coderabbit.yaml
Define path-specific CodeRabbit review instructions for Ansible tasks, handlers, tests, templates, variables, Python code, and README documentation.
  • Add detailed rules for Ansible tasks regarding no_log usage, OSTree-compatible package installation, third-party collections, idempotency, check mode, and mandatory test coverage for new tasks.
  • Specify handler rules for logging sensitive data, and strict test playbook invocation patterns using include_tasks wrappers with quality/idempotency expectations.
  • Enforce template headers, variable naming and file placement conventions for defaults/ and vars/, Python style requirements (PEP 8, Black, tox checks), and README requirements for documenting new user-facing variables and examples.
.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 .coderabbit.yaml embeds quite a lot of detailed, role-specific guidance (e.g., around timesync variables and test patterns); consider replacing some of the longer normative sections with links or short references to the canonical contributor docs to reduce the risk of them drifting out of sync.
  • Several instructions talk about enforcing test and documentation requirements (e.g., in tasks/**/*.yml and defaults/**/*.yml), which may be better expressed as warnings or suggestions in the wording so that CodeRabbit feedback doesn’t conflict with existing review policies when exceptions are needed.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `.coderabbit.yaml` embeds quite a lot of detailed, role-specific guidance (e.g., around timesync variables and test patterns); consider replacing some of the longer normative sections with links or short references to the canonical contributor docs to reduce the risk of them drifting out of sync.
- Several instructions talk about enforcing test and documentation requirements (e.g., in `tasks/**/*.yml` and `defaults/**/*.yml`), which may be better expressed as warnings or suggestions in the wording so that CodeRabbit feedback doesn’t conflict with existing review policies when exceptions are needed.

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 3c0783d into main May 19, 2026
31 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