ci: add CodeRabbit configuration for template-ui - #98
Conversation
Configure CodeRabbit with assertive profile for correctness-only reviews. Includes ast-grep rules for TypeScript/React patterns (XSS, floating promises, console.log, useEffect deps, any types, direct env access), auto review with draft/bot exclusions, slop detection, post-merge changelog, issue enrichment with auto-labeling, and cross-repo knowledge base linking. Signed-off-by: Soham Dutta <19648293+NP-compete@users.noreply.github.com>
📝 WalkthroughWalkthroughAdds a complete CodeRabbit configuration with review defaults, automation, path-based instructions, lint and security tooling, changelog updates, chat replies, issue enrichment, knowledge sources, and guideline patterns. Adds six TypeScript rules covering explicit 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
🚀 Post-Merge Actions
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.coderabbit.yaml:
- Line 44: Update the dotenv exclusion pattern in the ignore configuration from
the root-only form to a recursive pattern that excludes matching .env files in
all directories, using !**/.env*.
In @.coderabbit/rules/no-console-log.yml:
- Around line 3-10: Remove the access-token logging statement from the client
router around the token log at line 30, rather than replacing console.log with a
structured logger. Preserve the surrounding request and authentication behavior
while ensuring the token value is never logged.
In @.coderabbit/rules/no-unhandled-promise.yml:
- Around line 6-18: Replace the structural AST pattern in the
no-unhandled-promise rule with a type-aware floating-promise check that
identifies calls returning promises without requiring then, catch, or finally
handling. Ensure it covers async arrow callbacks as well as async function
declarations, while excluding intentional void-returning calls such as
logger.info().
🪄 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.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a9926e80-64a1-46ab-a5f5-69334bb62168
📒 Files selected for processing (7)
.coderabbit.yaml.coderabbit/rules/no-any-type-annotation.yml.coderabbit/rules/no-console-log.yml.coderabbit/rules/no-dangerously-set-innerhtml.yml.coderabbit/rules/no-direct-env-access.yml.coderabbit/rules/no-empty-useeffect-deps.yml.coderabbit/rules/no-unhandled-promise.yml
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
redhat-data-and-ai/template-agent(manual)redhat-data-and-ai/template-mcp(manual)
Closes #155
Summary
.coderabbit.yamlwith assertive profile for correctness-only automated reviewsanytypes, no floating promisesThis PR targets main so CodeRabbit picks up the config from the default branch.
Test plan