feat(ai): add claude and coderabbit guardrails RHCLOUD-46102#762
feat(ai): add claude and coderabbit guardrails RHCLOUD-46102#762Hyperkid123 merged 1 commit intoRedHatInsights:masterfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a new root Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 6 | ❌ 2❌ Failed checks (2 inconclusive)
✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
CLAUDE.md (1)
51-61: Add language identifiers to fenced code blocks.These fenced blocks are missing a language tag, which triggers markdownlint
MD040and reduces readability.Also applies to: 166-188, 295-308
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CLAUDE.md` around lines 51 - 61, The fenced ASCII-art code blocks (the triple-backtick blocks containing the Chrome Shell / Your Application diagram that start with "┌─────────────────────────────────────────────────┐") are missing language identifiers; add a language tag (e.g., ```text or ```ascii) to each of those fenced code blocks so markdownlint MD040 is satisfied and readability is preserved—locate the triple-backtick delimiters around the diagram(s) and update them to include the chosen language identifier.
🤖 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.yml:
- Around line 77-81: The config has multiple schema violations: move
bot_path_filters under the reviews block or remove it since reviews schema
doesn't define it; replace pre_merge_checks.title and
pre_merge_checks.description keys that incorrectly use enabled/instructions with
the allowed mode and requirements fields within the pre_merge_checks object;
reduce custom_checks entries to at most 5 by removing or consolidating excess
checks in the custom_checks array; change knowledge_base.web_search from a
boolean to an object (e.g., web_search: { enabled: true }) to match the expected
shape; relocate the top-level tools key into reviews.tools so it sits under the
reviews section; and shorten tone_instructions to <=250 characters or split it
into multiple allowed fields so it meets the schema limit.
In `@CLAUDE.md`:
- Around line 142-144: The setup instructions in CLAUDE.md incorrectly tell
users to create `.coderabbit.md` instead of the actual config file
`.coderabbit.yml`; update the text to reference `.coderabbit.yml` (and any other
occurrences of `.coderabbit.md`) so new users create the correct CodeRabbit
config file name; verify similar references in README.md or other docs and
correct them to `.coderabbit.yml` as well.
---
Nitpick comments:
In `@CLAUDE.md`:
- Around line 51-61: The fenced ASCII-art code blocks (the triple-backtick
blocks containing the Chrome Shell / Your Application diagram that start with
"┌─────────────────────────────────────────────────┐") are missing language
identifiers; add a language tag (e.g., ```text or ```ascii) to each of those
fenced code blocks so markdownlint MD040 is satisfied and readability is
preserved—locate the triple-backtick delimiters around the diagram(s) and update
them to include the chosen language identifier.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f164b77c-74ea-4f87-8f5f-bb962803fc77
📒 Files selected for processing (2)
.coderabbit.ymlCLAUDE.md
3728641 to
fc486f3
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
.coderabbit.yml (1)
259-267:⚠️ Potential issue | 🔴 CriticalFix remaining schema-incompatible fields so settings are reliably applied.
There are still schema mismatches that can cause parts of this config to be ignored/rejected:
- Line 261:
pre_merge_checks.description.requirementsis not allowed (description supportsmodeonly).- Line 376:
reviews.tools.tscis not a recognized tool key in the provided schema.- Lines 398, 402, 407, 412, 417:
timeoutis unsupported for these tools (forgithub-checks, usetimeout_ms; for others, remove).- Lines 416-417:
ast-grepdoes not supportenabledortimeoutfields in this schema.Suggested patch
pre_merge_checks: @@ description: mode: "warning" - requirements: | - PR description should include: - - Brief summary of changes - - Why the change was needed - - How to test the changes - - Link to JIRA ticket (if applicable) - - Screenshots for UI changes (if applicable) @@ tools: @@ - # TypeScript compiler - tsc: - enabled: true - @@ gitleaks: enabled: true - timeout: 300 @@ trufflehog: enabled: true - timeout: 300 @@ semgrep: enabled: true - timeout: 300 @@ github-checks: enabled: true - timeout: 300 + timeout_ms: 300000 @@ ast-grep: - enabled: true - timeout: 300 + essential_rules: true#!/bin/bash set -euo pipefail python - <<'PY' from pathlib import Path import sys try: import yaml except Exception: import subprocess subprocess.check_call([sys.executable, "-m", "pip", "install", "pyyaml", "-q"]) import yaml cfg = yaml.safe_load(Path(".coderabbit.yml").read_text()) violations = [] desc = cfg.get("reviews", {}).get("pre_merge_checks", {}).get("description", {}) if isinstance(desc, dict) and "requirements" in desc: violations.append("reviews.pre_merge_checks.description.requirements is unsupported by schema") tools = cfg.get("reviews", {}).get("tools", {}) if "tsc" in tools: violations.append("reviews.tools.tsc is not present in schema tool list") for t in ("gitleaks", "trufflehog", "semgrep", "github-checks", "ast-grep"): v = tools.get(t, {}) if isinstance(v, dict) and "timeout" in v: violations.append(f"reviews.tools.{t}.timeout is unsupported") ag = tools.get("ast-grep", {}) if isinstance(ag, dict): for k in ("enabled", "timeout"): if k in ag: violations.append(f"reviews.tools.ast-grep.{k} is unsupported") if violations: print("Schema-shape violations found:") for v in violations: print("-", v) sys.exit(1) print("No targeted schema-shape violations found.") PYAlso applies to: 375-418
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.coderabbit.yml around lines 259 - 267, Remove the unsupported fields and keys to match the schema: delete reviews.pre_merge_checks.description.requirements (description only supports mode), remove or rename the reviews.tools.tsc entry to a schema-recognized tool key, change any reviews.tools."github-checks".timeout to timeout_ms, remove timeout from reviews.tools.gitleaks, trufflehog, semgrep (and any other non-github-checks tools), and remove both reviews.tools."ast-grep".enabled and reviews.tools."ast-grep".timeout since ast-grep does not support those fields; update the YAML accordingly so only schema-supported keys remain for each tool.
🤖 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.yml:
- Around line 62-76: The path_filters block currently excludes "playwright/**"
and "!**/*.spec.ts", which prevents any later Playwright/spec-specific rules
from ever running; update the path_filters to stop excluding those paths by
removing the "!playwright/**" and "!**/*.spec.ts" entries (or replace them with
positive include patterns "playwright/**" and "**/*.spec.ts" if using explicit
includes), so the Playwright and spec file review rules can match; adjust the
same change for the duplicate block referenced at lines 143-166 to keep behavior
consistent.
In `@CLAUDE.md`:
- Around line 51-61: The fenced code blocks in CLAUDE.md that contain ASCII
diagrams and directory trees (e.g., the block starting with
"┌─────────────────────────────────────────────────┐" and the blocks starting
"frontend-starter-app/" and "src/") lack a language identifier; update each
opening triple-backtick to ```text so markdownlint MD040 is satisfied for those
diagram/tree outputs and any other similar plain-text fenced blocks in the file.
---
Duplicate comments:
In @.coderabbit.yml:
- Around line 259-267: Remove the unsupported fields and keys to match the
schema: delete reviews.pre_merge_checks.description.requirements (description
only supports mode), remove or rename the reviews.tools.tsc entry to a
schema-recognized tool key, change any reviews.tools."github-checks".timeout to
timeout_ms, remove timeout from reviews.tools.gitleaks, trufflehog, semgrep (and
any other non-github-checks tools), and remove both
reviews.tools."ast-grep".enabled and reviews.tools."ast-grep".timeout since
ast-grep does not support those fields; update the YAML accordingly so only
schema-supported keys remain for each tool.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: ASSERTIVE
Plan: Pro
Run ID: bfa8b8ff-2e4e-487e-a6f4-0bc8a00cda14
📒 Files selected for processing (2)
.coderabbit.ymlCLAUDE.md
| ``` | ||
| ┌─────────────────────────────────────────────────┐ | ||
| │ Chrome Shell (Navigation, Auth, Services) │ | ||
| │ ┌───────────────────────────────────────────┐ │ | ||
| │ │ Your Application (Module Federation) │ │ | ||
| │ │ - Loaded dynamically │ │ | ||
| │ │ - Routes defined in FEO config │ │ | ||
| │ │ - Uses Scalprum for federation │ │ | ||
| │ └───────────────────────────────────────────┘ │ | ||
| └─────────────────────────────────────────────────┘ | ||
| ``` |
There was a problem hiding this comment.
Add language identifiers to fenced blocks to satisfy markdownlint (MD040).
Several fenced blocks are plain triple-backtick blocks without a language tag. Add text where content is diagrams/tree output.
Suggested patch
-```
+```text
┌─────────────────────────────────────────────────┐
│ Chrome Shell (Navigation, Auth, Services) │
│ ┌───────────────────────────────────────────┐ │
@@
-```
+```
-```
+```text
frontend-starter-app/
├── src/
│ ├── Components/ # Reusable React components
@@
-```
+```
-```
+```text
src/
├── Components/
│ └── MyComponent/
@@
-```
+```Also applies to: 166-188, 295-308
🧰 Tools
🪛 markdownlint-cli2 (0.22.0)
[warning] 51-51: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CLAUDE.md` around lines 51 - 61, The fenced code blocks in CLAUDE.md that
contain ASCII diagrams and directory trees (e.g., the block starting with
"┌─────────────────────────────────────────────────┐" and the blocks starting
"frontend-starter-app/" and "src/") lack a language identifier; update each
opening triple-backtick to ```text so markdownlint MD040 is satisfied for those
diagram/tree outputs and any other similar plain-text fenced blocks in the file.
fc486f3 to
4adbf4a
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
.coderabbit.yml (1)
377-379:⚠️ Potential issue | 🟡 MinorRemove the unsupported
tsctool configuration.The
tsctool is not part of CodeRabbit's supported tools. While CodeRabbit supports ESLint (with TypeScript plugin) and Biome for TypeScript checking, there is notsc(TypeScript compiler) integration available. This configuration block will be silently ignored, potentially creating a false impression that TypeScript compilation is being checked during reviews.Since your
eslint.config.jsalready includes@typescript-eslintrules, TypeScript checking is already configured through ESLint and doesn't require a separatetscblock.Suggested fix
- # TypeScript compiler - tsc: - enabled: true -🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.coderabbit.yml around lines 377 - 379, Remove the unsupported tsc tool block from the CodeRabbit configuration: locate the YAML mapping with the key "tsc" (the block containing "tsc:" and "enabled: true") and delete it so only supported tools (e.g., ESLint/Biome) remain; ensure no other references to "tsc" exist in the config to avoid misleading users about TypeScript compilation checks.
🤖 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.yml:
- Around line 398-419: The tool configs for gitleaks, trufflehog, semgrep, and
ast-grep are using an invalid "timeout" property and should be removed (these
tools only accept "enabled", and semgrep also accepts "config_file"); update
those blocks (gitleaks, trufflehog, semgrep, ast-grep) to drop the timeout
entries, and for github-checks replace "timeout: 300" with the correct key
"timeout_ms" and convert seconds to milliseconds (e.g., 300 -> 300000) so the
timeout is applied correctly.
In `@CLAUDE.md`:
- Around line 379-391: Change the import to use the named export useChrome
(replace the default-import syntax currently used for useChrome), and then
validate the example's use of auth: check whether useChrome() actually returns
an auth property and whether auth.getUser() is a synchronous call; if auth is
not part of the public API or getUser is asynchronous, remove the
auth/getUser().firstName usage from the example (or replace it with the correct
async/tokenized access pattern) while keeping the updateDocumentTitle call and
its useEffect as-is; locate these changes around the useChrome import and the
MyComponent destructuring (useChrome, auth, getUser, updateDocumentTitle).
---
Duplicate comments:
In @.coderabbit.yml:
- Around line 377-379: Remove the unsupported tsc tool block from the CodeRabbit
configuration: locate the YAML mapping with the key "tsc" (the block containing
"tsc:" and "enabled: true") and delete it so only supported tools (e.g.,
ESLint/Biome) remain; ensure no other references to "tsc" exist in the config to
avoid misleading users about TypeScript compilation checks.
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e4539981-06ba-4f73-a88d-d10b36552cfa
📒 Files selected for processing (2)
.coderabbit.ymlCLAUDE.md
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. ❌ Failed to clone repository into sandbox. Please try again. |
4adbf4a to
d152dbe
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.yml:
- Around line 377-379: Remove the unsupported tsc configuration from the
CodeRabbit config: delete the top-level "tsc" key and its enabled setting (the
entry shown as "tsc: enabled: true") since CodeRabbit does not support that
tool; instead ensure TypeScript checking is performed via your ESLint TypeScript
rules (already enabled) or add a CI step that runs "tsc --noEmit" and surface
results through the github-checks integration so type errors are still reported.
- Around line 260-269: The YAML uses an invalid property
description.requirements under pre_merge_checks; remove the unsupported
requirements key and instead move your PR description guidance into a supported
place—either add the guidance to path_instructions or implement a new custom
pre-merge check that validates the PR description (ensure you reference
pre_merge_checks.description for mode and create a custom check entry under
pre_merge_checks.custom_checks or similar). Alternatively consolidate checks so
you don’t exceed the max of 5 custom checks; keep title.requirements as-is if
you need structured enforcement for titles and use the new custom check to
enforce the summary/rationale/testing/JIRA/screenshot rules.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 57f34c9f-67f0-4596-991a-844883ef9406
📒 Files selected for processing (2)
.coderabbit.ymlCLAUDE.md
d152dbe to
59dcdc0
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (1)
CLAUDE.md (1)
51-61:⚠️ Potential issue | 🟡 MinorAdd language identifiers to plain-text fenced blocks.
Lines 51, 166, and 295 still use unlabeled triple backticks for diagrams/tree output. Use
textto satisfy markdownlint MD040 and keep docs lint-clean.Suggested patch
-``` +```text ┌─────────────────────────────────────────────────┐ ... -``` +``` -``` +```text frontend-starter-app/ ... -``` +``` -``` +```text src/ ... -``` +```Also applies to: 166-188, 295-308
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CLAUDE.md` around lines 51 - 61, The markdown contains unlabeled fenced code blocks used for ASCII diagrams (the block starting with "┌─────────────────────────────────────────────────┐" titled "Chrome Shell (Navigation, Auth, Services)" and the other two diagram blocks titled "frontend-starter-app/" and "src/"), which triggers markdownlint MD040; fix by replacing each opening ``` with ```text so the three diagram/code fence blocks are explicitly labeled as text (i.e., change the three unlabeled triple-backtick openings to triple-backtick + text for the Chrome Shell, frontend-starter-app/, and src/ diagram blocks).
🤖 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.yml:
- Around line 367-368: The Cypress flat-config block in eslint.config.js
currently places parser: '@typescript-eslint/parser' at the root instead of
under languageOptions, which breaks the flat-config API; update the Cypress
config object (the block that matches files
['cypress/**/*.ts','cypress/**/*.tsx']) to move the parser into languageOptions
(mirroring the TypeScript block pattern) and ensure plugins and rules remain at
the root of that config entry so ESLint correctly parses and lints Cypress
files.
- Around line 408-410: The comment claiming "Disable ASCII art/poems in chat
responses" is out of sync with the YAML block which only sets auto_reply; either
add the missing key chat.art: false to this block or change the comment to
accurately describe the setting (e.g., "Enable auto replies"); update the entry
that contains the auto_reply key so it and the comment consistently reflect
whether chat.art is disabled or not.
In `@CLAUDE.md`:
- Around line 89-97: The fenced JSON code block containing the "name",
"version", and "insights" keys is directly adjacent to surrounding text and
needs blank lines added before and after the triple-backtick fences to satisfy
markdownlint MD031; edit CLAUDE.md to insert a blank line immediately above the
opening ```json fence and a blank line immediately below the closing ``` fence
for that block (and do the same for the other fenced blocks referenced),
ensuring the fences are separated from neighboring list items or paragraphs.
---
Duplicate comments:
In `@CLAUDE.md`:
- Around line 51-61: The markdown contains unlabeled fenced code blocks used for
ASCII diagrams (the block starting with
"┌─────────────────────────────────────────────────┐" titled "Chrome Shell
(Navigation, Auth, Services)" and the other two diagram blocks titled
"frontend-starter-app/" and "src/"), which triggers markdownlint MD040; fix by
replacing each opening ``` with ```text so the three diagram/code fence blocks
are explicitly labeled as text (i.e., change the three unlabeled triple-backtick
openings to triple-backtick + text for the Chrome Shell, frontend-starter-app/,
and src/ diagram blocks).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5a13e279-b8a1-4a5b-b6e7-4aadb28a9316
📒 Files selected for processing (2)
.coderabbit.ymlCLAUDE.md
| ```json | ||
| { | ||
| "name": "my-new-app", // Change to your app name | ||
| "version": "0.1.0", // Start at 0.1.0 | ||
| "insights": { | ||
| "appname": "my-new-app" // Must match your app identifier | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Add blank lines around fenced code blocks (MD031).
Several fenced blocks are directly adjacent to surrounding text/list items (e.g., around Lines 89, 110, 197). Add a blank line before and after each fence for consistent markdownlint compliance.
Also applies to: 110-115, 197-203
🧰 Tools
🪛 markdownlint-cli2 (0.22.0)
[warning] 89-89: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CLAUDE.md` around lines 89 - 97, The fenced JSON code block containing the
"name", "version", and "insights" keys is directly adjacent to surrounding text
and needs blank lines added before and after the triple-backtick fences to
satisfy markdownlint MD031; edit CLAUDE.md to insert a blank line immediately
above the opening ```json fence and a blank line immediately below the closing
``` fence for that block (and do the same for the other fenced blocks
referenced), ensuring the fences are separated from neighboring list items or
paragraphs.
There was a problem hiding this comment.
Don't be so aggressive about things like this. It's an example in MD. Nobody cares.
There was a problem hiding this comment.
@Hyperkid123, fair point — that's overly pedantic for a documentation file. I'll dial back on minor markdown style warnings like blank lines around fenced code blocks going forward.
📝 Learnings were identified and not saved (knowledge base disabled). Enable
59dcdc0 to
ee0e5b7
Compare
AI being too strict in places where it does not matter.
|
/retest |
Description
Let's add Coderabbit config and CLAUDE.md files to have guardrails for others who use this repository as seed.
RHCLOUD-46102
Checklist ☑️
Summary by CodeRabbit
Documentation
Chores