Skip to content

feat(chore): CodeRabbit rules set#115

Merged
Meyanis95 merged 4 commits intomasterfrom
feat/ci_cd_contributing_checks
Mar 18, 2026
Merged

feat(chore): CodeRabbit rules set#115
Meyanis95 merged 4 commits intomasterfrom
feat/ci_cd_contributing_checks

Conversation

@Meyanis95
Copy link
Copy Markdown
Collaborator

@Meyanis95 Meyanis95 commented Mar 18, 2026

This is a test to check is coderabbit review is triggered.

Summary by CodeRabbit

  • Chores

    • Added an automated review governance configuration with global language/tone controls, auto-review and auto-reply behavior, path-based rules, and category-specific guidance.
  • Documentation

    • Introduced a new crops_profile metadata option (including an "n/a" choice) and refined pattern guidance and table formatting for clarity.
  • Bug Fixes

    • Strengthened frontmatter validation and error reporting to surface missing or invalid metadata during checks.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 18, 2026

📝 Walkthrough

Walkthrough

Adds a repository auto-review configuration and enforces a new required frontmatter field crops_profile by updating the JSON schema and the pattern validation script; also adds crops_profile: "n/a" to one pattern markdown and adjusts its table formatting.

Changes

Cohort / File(s) Summary
Auto-review configuration
./.coderabbit.yaml
Adds repository-level auto-review governance: global language/tone, auto_review enabled (drafts disabled), base-branch/workflow options, path_filters, detailed path_instructions with structure/frontmatter/word-limit/tone/CROPS validation rules, and chat.auto_reply enabled.
Pattern document metadata
patterns/pattern-l2-privacy-evaluation.md
Adds crops_profile: "n/a" to frontmatter and tweaks table/header formatting (presentation/metadata-only changes).
Pattern schema
scripts/schemas/pattern.json
Adds crops_profile as a required top-level field and changes its schema to a oneOf: the string "n/a" or a strict object with required cr, os, privacy, security enums and additionalProperties: false; updates root required list.
Pattern validation logic
scripts/validate-patterns.js
Enforces new crops_profile frontmatter rules (errors when missing or invalid unless "n/a"), adds validation for sub-fields when object-form is used, and refines JSON Schema error handling and message formatting to elevate certain crops-related violations to errors.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Author
participant CI as CodeRabbit_AutoReview
participant Validator as validate-patterns.js
participant Schema as scripts/schemas/pattern.json
participant Pattern as patterns/*.md
Author->>CI: push PR
CI->>Validator: run validation
Validator->>Pattern: read frontmatter
Validator->>Schema: validate against schema (crops_profile required)
Schema-->>Validator: validation result (errors/warnings)
Validator-->>CI: emit report (errors/warnings)
CI-->>Author: review status / comments

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hopped through YAML, nudged a field in place,
Cr, OS, privacy — tidy in their space,
Validators hum, schema guards the gate,
Patterns now check, no surprises wait,
A tiny rabbit cheers the updated chase!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal and does not follow the provided template structure, lacking proper categorization, detailed description, or completion of the checklist items. Complete the description template by selecting a category, providing a detailed explanation of changes, and checking off relevant checklist items.
Title check ❓ Inconclusive The title 'feat(chore): CodeRabbit rules set' is vague and does not clearly convey the main purpose of the changes, which is to configure CodeRabbit review governance and add pattern validation for CROPS profiles. Clarify the title to reflect the primary change, such as 'Add CodeRabbit review governance configuration and CROPS profile validation' or 'Configure automated review rules and pattern schema updates'.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ci_cd_contributing_checks
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
.coderabbit.yaml (1)

102-103: Make approach cross-reference checks deterministic.

The rule is good, but without a fixed section/link format in approaches/_template.md, reviewers will apply it inconsistently. Define exactly where links must appear and accepted formats.

♻️ Proposed fix
         Approach cards MUST link to both the use case they address and the patterns they combine.
-        Flag if no pattern or use case cross-references are present.
+        Required location: `## Architecture and Design Choices`.
+        Required format: at least one markdown link to `use-cases/*.md` and one to `patterns/*.md`.
+        Flag if either link type is missing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.coderabbit.yaml:
- Line 51: Update the patterns rule block in .coderabbit.yaml so its tone/source
reference points to the correct patterns style document (or the global style
doc) instead of referencing "vendors/README.md"; locate the patterns rule block
(the entry containing the "Tone:" guidance) and replace the "vendors/README.md"
reference with the proper patterns style source identifier to prevent reviewer
confusion.
- Around line 39-46: The CI rule requiring a crops_profile in frontmatter
disagrees with the code validators; make the requirement consistent by: update
the JSON schema named "pattern" to add "crops_profile" to the required array and
define its properties (cr, os, privacy, security) with the exact enums (cr:
high|medium|low|none, os: yes|partial|no, privacy: full|partial|none, security:
high|medium|low); update the validator function validatePatterns (or equivalent
in the patterns validation script) to either rely on the updated schema
validation or add an explicit check that frontmatter.crops_profile exists and
its fields match the enums, emitting a clear error message; and adjust the CI
rule text in the CROPS section of .coderabbit.yaml to match this enforced
requirement and error wording so CI, schema, and review guidance stay aligned.
- Around line 31-32: The current glob "patterns/**/*.md" in .coderabbit.yaml
(the path entry under path: "patterns/**/*.md" with the instructions field) is
too broad and matches template/README files; update the path patterns themselves
rather than the informational instructions: either use negation (if
path_instructions supports it) by adding exclusions like
"!patterns/**/_template.md" and "!patterns/**/README.md", or tighten the include
pattern to exclude leading underscores/README (e.g., only match files not
starting with "_" or not named README) so that files like _template.md and
README.md are not matched by patterns/**/*.md.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 45176f5c-6a93-4eab-a901-ff814947c2be

📥 Commits

Reviewing files that changed from the base of the PR and between e550f5c and 0be856b.

📒 Files selected for processing (1)
  • .coderabbit.yaml

Comment thread .coderabbit.yaml Outdated
Comment thread .coderabbit.yaml
Comment thread .coderabbit.yaml Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.coderabbit.yaml (1)

54-55: ⚠️ Potential issue | 🟠 Major

The README/_template bleed-through is still present in the non-pattern rules.

Lines 54, 81, 95, and 108 still use **/*.md, so the vendor/use-case/approach/jurisdiction card instructions will also apply to each directory’s README.md and _template.md. Tighten these includes to real card files, or give the non-card docs their own path rules.

Also applies to: 81-82, 95-96, 108-109

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.coderabbit.yaml around lines 54 - 55, The rule globs like "vendors/**/*.md"
are too broad and include README.md and _template.md; update each non-pattern
rule (the entries currently using "**/*.md") to either target only actual card
files (e.g., change to a more specific pattern that matches your card filenames
or folders such as a dedicated cards/ subdir or filename pattern) or add
explicit excludes for README.md and _template.md (negated globs like excluding
"**/README.md" and "**/_template.md"); apply the same change to the other
similar entries that use "**/*.md" so vendor/use-case/approach/jurisdiction card
instructions no longer bleed into non-card docs.
🧹 Nitpick comments (1)
scripts/validate-patterns.js (1)

301-317: Avoid hard-coding the CROPS enums in two places.

Lines 304-309 duplicate the allowed values already defined in scripts/schemas/pattern.json, so the schema and validator can drift apart later. I’d treat the schema as the single source of truth here and keep only the contextual checks that Ajv cannot express.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/validate-patterns.js` around lines 301 - 317, Currently the allowed
CROPS enums are hard-coded in the cropsFields object in validate-patterns.js
(the cp variable and its loop pushing to fileErrors), which duplicates
scripts/schemas/pattern.json; change the validator to read the allowed lists
from the schema instead of defining cropsFields inline: load the pattern schema
(from scripts/schemas/pattern.json), extract the enum arrays for
crops_profile.cr, crops_profile.os, crops_profile.privacy, and
crops_profile.security, and use those arrays in the existing loop that checks
cp[field] and pushes to fileErrors so the schema remains the single source of
truth while keeping any contextual checks Ajv can’t express.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/validate-patterns.js`:
- Around line 331-343: The code currently treats all additionalProperties errors
as warnings (fileWarnings) before the crops_profile path check can mark them as
errors; update the additionalProperties branch in the validator so it promotes
unexpected fields under crops_profile to errors: inside the error.keyword ===
'additionalProperties' case, inspect errorPath (and/or error.instancePath) and
if it startsWith('/crops_profile') push to fileErrors (e.g.,
fileErrors.push(`Schema: unexpected field '${error.params.additionalProperty}'
in frontmatter`)) otherwise keep the existing fileWarnings behavior; you can
also alternatively move the isRequiredField check above the additionalProperties
branch and use the isRequiredField boolean to decide between fileErrors and
fileWarnings.

---

Duplicate comments:
In @.coderabbit.yaml:
- Around line 54-55: The rule globs like "vendors/**/*.md" are too broad and
include README.md and _template.md; update each non-pattern rule (the entries
currently using "**/*.md") to either target only actual card files (e.g., change
to a more specific pattern that matches your card filenames or folders such as a
dedicated cards/ subdir or filename pattern) or add explicit excludes for
README.md and _template.md (negated globs like excluding "**/README.md" and
"**/_template.md"); apply the same change to the other similar entries that use
"**/*.md" so vendor/use-case/approach/jurisdiction card instructions no longer
bleed into non-card docs.

---

Nitpick comments:
In `@scripts/validate-patterns.js`:
- Around line 301-317: Currently the allowed CROPS enums are hard-coded in the
cropsFields object in validate-patterns.js (the cp variable and its loop pushing
to fileErrors), which duplicates scripts/schemas/pattern.json; change the
validator to read the allowed lists from the schema instead of defining
cropsFields inline: load the pattern schema (from scripts/schemas/pattern.json),
extract the enum arrays for crops_profile.cr, crops_profile.os,
crops_profile.privacy, and crops_profile.security, and use those arrays in the
existing loop that checks cp[field] and pushes to fileErrors so the schema
remains the single source of truth while keeping any contextual checks Ajv can’t
express.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 99a1f602-7227-41de-bc82-caf4a4ebaad6

📥 Commits

Reviewing files that changed from the base of the PR and between 0be856b and bbc4e8d.

📒 Files selected for processing (4)
  • .coderabbit.yaml
  • patterns/pattern-l2-privacy-evaluation.md
  • scripts/schemas/pattern.json
  • scripts/validate-patterns.js

Comment thread scripts/validate-patterns.js
@Meyanis95 Meyanis95 requested review from oskarth and rymnc March 18, 2026 09:46
@Meyanis95 Meyanis95 changed the title chore: check if code rabbit is triggered feat(chore): CodeRabbit rules set Mar 18, 2026
@Meyanis95 Meyanis95 merged commit 48c9f0e into master Mar 18, 2026
7 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.

2 participants