Skip to content

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

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

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

Conversation

@spetrosi

@spetrosi spetrosi commented May 19, 2026

Copy link
Copy Markdown
Contributor

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 defining review behavior, PR requirements, and repository-specific conventions.

CI:

  • Configure CodeRabbit review bot with disabled auto-features and tailored review settings for this repository.

Documentation:

  • Capture contribution and review conventions in a machine-readable .coderabbit.yaml for automated enforcement during code review.

Chores:

  • Document path-specific review rules for tasks, handlers, tests, templates, variables, Python code, and README to align automated reviews with project standards.

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

sourcery-ai Bot commented May 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

.coderabbit.yaml configuration file is added to define how CodeRabbit should review this repository, disabling nonessential features and encoding linux-system-roles conventions, PR metadata requirements, and detailed path-based review instructions for Ansible tasks, tests, templates, variables, Python code, and documentation.

File-Level Changes

Change Details Files
Introduce CodeRabbit configuration and disable nonessential/"fun" review features while turning off automatic actions.
  • Create a new .coderabbit.yaml file at the repo root using CodeRabbit schema v2.
  • Disable chat art, poems, fortunes, and various auto-features such as auto labels, auto reviewer assignment, and request-changes workflow.
  • Turn off advanced review extras such as sequence diagrams, effort estimation, suggested labels, and high-level walkthrough summaries.
  • Disable finishing-touches unit test suggestions.
.coderabbit.yaml
Enforce PR title and description conventions via CodeRabbit pre-merge checks.
  • Add a title pre_merge_check that warns when PR titles do not follow Conventional Commits format, referring to the local commitlint configuration for valid types.
  • Add a custom description-format check requiring Enhancement/Feature, Reason, Result, and optional Issue Tracker sections aligned with the repository pull request template.
.coderabbit.yaml
Add path-specific CodeRabbit instructions to encode linux-system-roles best practices for Ansible tasks, handlers, tests, templates, variables, Python code, and documentation.
  • Define guidance for tasks/ files covering no_log usage, OSTree-safe package installation with ansible.builtin.package, avoiding third-party collections, idempotency, check-mode support, and test coverage expectations.
  • Specify handler rules for sensitive data logging, test playbook rules enforcing a central include_tasks wrapper and idempotent, assert-based tests, and template header requirements including ansible_managed and system_role fingerprint.
  • Define naming and placement conventions for defaults/ (user-facing nbde_server_ vars) and vars/ (_nbde_server internal vars), as well as Python style requirements (PEP8, Black via tox) and README.md documentation expectations for new variables and features.
.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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

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 configuration is highly nbde_server-specific (variable prefixes, role fingerprint, examples, wrapper task names), so if this file is meant to be centrally managed for multiple roles it may be worth double-checking that all role-specific identifiers are correct for this repository and will not need per-repo overrides.
  • Several rules reference external files and conventions (e.g., .commitlintrc.js, .github/pull_request_template.md, tests/tests_*.yml, tasks/run_role_with_clear_facts.yml); verify these paths and filenames actually exist in this repo so the bot’s guidance does not become misleading or generate false warnings.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The configuration is highly nbde_server-specific (variable prefixes, role fingerprint, examples, wrapper task names), so if this file is meant to be centrally managed for multiple roles it may be worth double-checking that all role-specific identifiers are correct for this repository and will not need per-repo overrides.
- Several rules reference external files and conventions (e.g., .commitlintrc.js, .github/pull_request_template.md, tests/tests_*.yml, tasks/run_role_with_clear_facts.yml); verify these paths and filenames actually exist in this repo so the bot’s guidance does not become misleading or generate false warnings.

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 f5ab7a7 into main May 19, 2026
41 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