Skip to content

ci: add CodeRabbit configuration for template-ui - #98

Merged
vishnusrichand merged 4 commits into
redhat-data-and-ai:mainfrom
NP-compete:ci/coderabbit-setup-main
Aug 20, 2026
Merged

ci: add CodeRabbit configuration for template-ui#98
vishnusrichand merged 4 commits into
redhat-data-and-ai:mainfrom
NP-compete:ci/coderabbit-setup-main

Conversation

@NP-compete

@NP-compete NP-compete commented Jul 28, 2026

Copy link
Copy Markdown
Member

Closes #155

Summary

  • Add .coderabbit.yaml with assertive profile for correctness-only automated reviews
  • Add 6 ast-grep rules for TypeScript/React patterns: no console.log, no dangerouslySetInnerHTML (XSS), no useEffect without deps, no direct process.env, no explicit any types, no floating promises
  • Configure auto review with draft/bot exclusions, slop detection, post-merge changelog, issue enrichment with auto-labeling, and cross-repo knowledge base (template-agent, template-mcp)

This PR targets main so CodeRabbit picks up the config from the default branch.

Test plan

  • Verify CodeRabbit triggers on new PRs after merge
  • Confirm ast-grep rules fire on matching patterns
  • Check slop detection flags AI-generated content

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>
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds 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 any, console.log, dangerouslySetInnerHTML, direct environment access, dependency-less useEffect, and unhandled promises.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The description directly explains the CodeRabbit configuration and six TypeScript/React rules.
Linked Issues check ✅ Passed The description references issue #155 with a closing keyword.
Out of Scope Changes check ✅ Passed All changes support the stated CodeRabbit configuration objectives.
Title check ✅ Passed The title clearly identifies the addition of the CodeRabbit configuration for template-ui.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
🚀 Post-Merge Actions
  • Update changelog

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

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 582750b and fb54e8e.

📒 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)

Comment thread .coderabbit.yaml
Comment thread .coderabbit/rules/no-console-log.yml
Comment thread .coderabbit/rules/no-unhandled-promise.yml
@NP-compete
NP-compete requested a review from a team as a code owner August 13, 2026 04:53
@NP-compete NP-compete closed this Aug 19, 2026
@NP-compete NP-compete reopened this Aug 19, 2026

@vishnusrichand vishnusrichand left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@vishnusrichand
vishnusrichand merged commit 8a2f9ee into redhat-data-and-ai:main Aug 20, 2026
12 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.

ci: add CodeRabbit configuration for automated code review

2 participants