Skip to content

chore: add CodeRabbit config and CI#32

Open
omarespejel wants to merge 5 commits intomainfrom
chore/coderabbit
Open

chore: add CodeRabbit config and CI#32
omarespejel wants to merge 5 commits intomainfrom
chore/coderabbit

Conversation

@omarespejel
Copy link

Closes #31.

This PR adds a repo-tuned CodeRabbit configuration plus baseline CI checks so automated reviews can rely on deterministic results.

What changed

  • .coderabbit.yaml

    • Auto-review enabled for non-draft PRs targeting main.
    • Excludes generated/noisy paths from review context (dist, docs/api, lockfiles, etc.).
    • Repo-specific review guidance, with extra focus on packages/mcp-server/** security.
    • Disables poems/fortune and other noisy tooling by default.
  • .github/workflows/ci.yml

    • Runs typecheck, lint, build, and unit tests on PRs and main pushes.
    • Uses Node version from .nvmrc.
  • .github/pull_request_template.md

    • Adds @coderabbitai summary and a minimal checklist.

Notes

  • This PR doesn't install the CodeRabbit GitHub App (org/repo admin action). After merge, install the app and limit access to this repo.
  • Also includes Prettier normalization for docs.json + Mintlify json configs (these were failing prettier --check locally).

@omarespejel
Copy link
Author

omarespejel commented Feb 18, 2026

Removed the PR template file (.github/pull_request_template.md) per preference; CodeRabbit + CI remain.

@omarespejel
Copy link
Author

omarespejel commented Feb 18, 2026

CI was failing at npm ci with Node 24.13.0 / npm 11.6.2 due to a lockfile sync check (missing node-gyp-build@4.8.4). Updated package-lock.json so npm ci succeeds on npm 11.6.2.

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Streamlined CI/CD pipeline with improved job execution efficiency, conditional draft PR handling, timeout controls, and enhanced npm package caching
    • Established automated code review configuration system for improved code quality oversight and feedback
    • Implemented comprehensive security and quality gates framework with strict type checking, security validations, and best practice enforcement

Walkthrough

The changes introduce CodeRabbit and Greptile configuration files for automated code review, along with GitHub Actions CI workflow updates. These modifications establish automated PR reviews with tool configurations, path-based artifact exclusions, review policies, and deterministic CI checks (typecheck, lint, build, unit tests) to enforce security and code quality standards.

Changes

Cohort / File(s) Summary
CodeRabbit Configuration
.coderabbit.yaml
New configuration file establishing automated review behavior, defining reviewer profiles, excluding noisy artifacts (dist, docs, node_modules, lockfiles), configuring review tools (GitHub checks, eslint, actionlint, gitleaks, trufflehog), and setting path-based instructions for MCP server, SDK, and tests.
CI Workflow Updates
.github/workflows/ci.yml
Refactored CI workflow: renamed job from checks to test, added draft PR skip condition, 15-minute timeout, concurrency controls, and workflow_dispatch trigger. Reorganized build steps to include Lint, Format check, Build, and Unit tests while removing example-specific jobs. Added npm cache support.
Code Quality Configuration
.greptile.yaml
New configuration file defining comprehensive security and quality gates with TypeScript rules (strict null checks, no implicit any, error handling), security patterns (forbidden hardcoded secrets, API keys, shell injections), context files for critical paths (SDK wallet/staking, MCP server core), and PR automation with auto_review and block_on_critical enforcement.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: add CodeRabbit config and CI' accurately and concisely summarizes the main changes: adding CodeRabbit configuration and CI workflow files.
Description check ✅ Passed The description clearly explains the PR's purpose, details the three main file additions (.coderabbit.yaml, .github/workflows/ci.yml, and PR template), and notes implementation requirements post-merge.
Linked Issues check ✅ Passed The PR fully addresses issue #31 by implementing all three core requirements: CodeRabbit configuration with repo-specific guidance, CI workflow with typecheck/lint/build/unit tests, and artifact exclusion from review context.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #31 requirements. The Prettier normalization for docs.json and lockfile fixes are supporting changes needed for CI success, not out-of-scope additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/coderabbit

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

@0xsisyfos 0xsisyfos requested a review from ZackAttax March 3, 2026 14:48
Copy link

@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: 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.yaml:
- Around line 18-26: The config lists "main" under base_branches which per the
schema is only for non-default branches; check the repository's default branch
and if it is "main" remove "main" from the base_branches array (or leave a short
comment explaining why you intentionally listed it), otherwise keep it; update
the base_branches key accordingly and ensure enabled: true remains as-is so
CodeRabbit continues reviewing default-branch PRs automatically.

In @.greptile.yaml:
- Around line 1-25: The repository contains a Greptile config in YAML format
with top-level keys like "version", "review", "severity", and "categories"
(currently in .greptile.yaml); Greptile requires JSON, so migrate this YAML into
the supported JSON layout by creating either a greptile.json at repo root or
splitting into .greptile/config.json, .greptile/rules.md and
.greptile/files.json, preserving the same settings (version,
review.comprehensive, review.context_files, review.severity, review.categories)
and validate against the greptile.json schema from the Greptile docs to ensure
the format is correct and will be picked up by the tool.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7bff405 and 838871b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
📒 Files selected for processing (3)
  • .coderabbit.yaml
  • .github/workflows/ci.yml
  • .greptile.yaml
📜 Review details
🔇 Additional comments (11)
.coderabbit.yaml (4)

1-16: LGTM! Configuration structure is valid and well-documented.

The top-level settings and review options are correctly configured:

  • language: en-US and early_access: false are valid per schema
  • profile: assertive aligns with PR objectives for thorough reviews
  • Disabling poem and in_progress_fortune reduces noise as intended
  • Summary settings (high_level_summary_in_walkthrough: true) avoid editing PR bodies

28-35: LGTM! Path filters correctly exclude generated artifacts.

The exclusion patterns align with PR objectives:

  • Build outputs (dist/**, **/*.tgz)
  • Documentation artifacts (docs/api/**, docs/export/**)
  • Dependencies and lockfiles (node_modules/**, **/package-lock.json)

37-57: LGTM! Path instructions provide targeted, security-focused guidance.

The instructions appropriately prioritize:

  • MCP server: Defense-in-depth for fund-handling code (write gating, amount caps, secret protection)
  • SDK: API stability and deterministic behavior
  • Tests: Preference for stable unit tests over flaky integration tests

This aligns well with the PR objective to "standardize review focus for security-sensitive areas."


59-79: LGTM! Tool configuration is well-reasoned.

Enabled tools provide good coverage:

  • github-checks with 5-minute timeout for CI integration
  • eslint for JS/TS linting (complements CI)
  • actionlint for workflow validation
  • gitleaks and trufflehog for secret scanning (critical for MCP server security)

Disabling biome avoids duplicate linting since eslint is already enabled. The timeout_ms: 300000 (5 minutes) is reasonable and within the schema maximum.

.github/workflows/ci.yml (4)

3-15: LGTM! Workflow triggers are well-configured.

The trigger configuration:

  • Includes ready_for_review type to re-run CI when a draft PR becomes ready
  • Enables workflow_dispatch for manual runs
  • Targets main branch for both PRs and pushes

This aligns with the auto_review.drafts: false setting in .coderabbit.yaml.


20-22: LGTM! Concurrency configuration prevents redundant CI runs.

Using cancel-in-progress: true with a ref-based group ensures that new pushes cancel stale runs, reducing CI resource waste.


24-31: LGTM! Job configuration with draft PR handling.

The condition github.event_name != 'pull_request' || github.event.pull_request.draft == false correctly:

  • Skips CI for draft PRs (aligns with CodeRabbit's drafts: false)
  • Always runs on push and workflow_dispatch events

The 15-minute timeout provides a reasonable ceiling for the CI steps.


32-59: LGTM! CI steps follow a logical order with proper caching.

The workflow:

  1. Uses .nvmrc for consistent Node version
  2. Enables npm caching for faster installs
  3. Runs checks in a sensible order: typecheck → lint → format → build → test
  4. Uses -s flag for cleaner output

This fulfills the PR objective for "deterministic CI checks (typecheck, lint, build, unit tests)."

.greptile.yaml (3)

26-32: LGTM! Strict TypeScript settings enforce type safety.

These settings align with the project's emphasis on correctness for fund-handling code:

  • strict_null_checks and no_any prevent common type errors
  • require_error_handling and no_empty_catch ensure errors aren't silently swallowed

34-51: LGTM! Context section aligns with CodeRabbit path instructions.

The key_files list appropriately highlights critical entry points for the SDK and MCP server. The patterns reinforce the same security principles from .coderabbit.yaml:

  • Address validation
  • Opt-in writes for state changes
  • Amount caps and sanitized errors

This provides consistent guidance across both review tools.


53-64: LGTM! Security and PR settings provide strong guardrails.

The security section covers critical concerns for fund-handling code:

  • Secret/key detection (no_hardcoded_secrets, no_api_keys_in_code)
  • Input validation requirements
  • Code injection prevention (no_eval, no_shell_injection)

block_on_critical: true adds enforcement beyond CodeRabbit's advisory reviews, though note that actual blocking depends on branch protection rules.

Comment on lines +18 to +26
auto_review:
enabled: true
drafts: false
base_branches:
- main
ignore_title_keywords:
- wip
- draft
- do not review
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider whether main needs to be in base_branches.

Per the schema, base_branches is for "base branches (other than the default branch) to review." If main is already the repository's default branch, this entry is redundant (CodeRabbit reviews PRs targeting the default branch automatically when enabled: true).

However, explicitly listing it doesn't cause harm and documents intent clearly.

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

In @.coderabbit.yaml around lines 18 - 26, The config lists "main" under
base_branches which per the schema is only for non-default branches; check the
repository's default branch and if it is "main" remove "main" from the
base_branches array (or leave a short comment explaining why you intentionally
listed it), otherwise keep it; update the base_branches key accordingly and
ensure enabled: true remains as-is so CodeRabbit continues reviewing
default-branch PRs automatically.

Comment on lines +1 to +25
# Greptile configuration for StarkZap SDK + MCP server
# https://docs.greptile.com/config

version: 1

review:
comprehensive: true
context_files: true

severity:
- critical
- high
- medium
- low

categories:
- security
- correctness
- performance
- maintainability
- best-practices
- error-handling
- type-safety
- documentation

Copy link

@coderabbitai coderabbitai bot Mar 3, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Greptile yaml configuration schema version 1 documentation

💡 Result:

Greptile does not publish a “YAML configuration schema version 1” for its code-review configuration. Greptile’s repo-based configuration is JSON-based, via either:

  • greptile.json (single file, repo root) — full reference documentation is here. (greptile.com)
  • A .greptile/ folder using:
    • .greptile/config.json
    • .greptile/rules.md
    • .greptile/files.json — complete schema/reference is here. (greptile.com)

If you meant a different Greptile YAML (e.g., self-hosting/Helm values.yaml, or another product area), tell me the filename you’re looking at and I’ll track down the matching docs.

Citations:


Greptile requires JSON configuration, not YAML.

Greptile does not support .greptile.yaml. According to the official documentation, Greptile's code-review configuration must be in JSON format using either:

  • greptile.json in the repository root, or
  • .greptile/config.json, .greptile/rules.md, and .greptile/files.json

The current .greptile.yaml file will not be recognized or used by Greptile. Migrate the configuration to the proper JSON format referenced in the greptile.json documentation.

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

In @.greptile.yaml around lines 1 - 25, The repository contains a Greptile
config in YAML format with top-level keys like "version", "review", "severity",
and "categories" (currently in .greptile.yaml); Greptile requires JSON, so
migrate this YAML into the supported JSON layout by creating either a
greptile.json at repo root or splitting into .greptile/config.json,
.greptile/rules.md and .greptile/files.json, preserving the same settings
(version, review.comprehensive, review.context_files, review.severity,
review.categories) and validate against the greptile.json schema from the
Greptile docs to ensure the format is correct and will be picked up by the tool.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Choose a reason for hiding this comment

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

Checked the docs and greptile doesn't support yaml

- name: Unit Tests
run: npm run -s test

examples:

Choose a reason for hiding this comment

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

Why aren't we checking the examples in the ci?

Comment on lines +49 to 54
- name: Lint
run: npm run -s lint

- name: Build Flappy-Bird Example
run: npm run -s build --workspace examples/flappy-bird
- name: Format check
run: npm run -s prettier:check

Choose a reason for hiding this comment

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

Why are we changing the order of the lint, format, and unit test?

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.

Adopt CodeRabbit for PR reviews (with CI + safe defaults)

3 participants