Skip to content

feat: v0.5.0 — viral improvements (personas, complexity, SAST, notifications, i18n)#26

Merged
mara-werils merged 31 commits into
mainfrom
feat/viral-improvements
May 15, 2026
Merged

feat: v0.5.0 — viral improvements (personas, complexity, SAST, notifications, i18n)#26
mara-werils merged 31 commits into
mainfrom
feat/viral-improvements

Conversation

@mara-werils
Copy link
Copy Markdown
Owner

Summary

Major release targeting viral growth and feature parity with paid competitors. 31 commits across 42 files (+3,281 lines), 428 tests all passing.

New Features

  • Review personas — 6 built-in reviewer personalities (security-hawk, mentor, nitpicker, quick-scan, dora) configurable via YAML or action input
  • PR complexity scoring — algorithmic 1-100 score (size, spread, language mix, coupling, risk, churn) — zero LLM cost
  • 15 new SAST rules — now 35+ built-in security rules (prototype pollution, XXE, ReDoS, timing attacks, mass assignment, CSRF, etc.)
  • Slack/Discord/Teams notifications — webhook alerts when risk exceeds threshold
  • Diff-aware review cache — skip unchanged files, reduce LLM costs 30-70%
  • Setup wizard (pr-reviewer init) — interactive config and workflow generator
  • Review quality benchmarks — golden dataset with 8 scenarios, CI-integrated
  • Team report card — weekly/monthly analytics digest with health score
  • 15-language support — added Arabic, Turkish, Italian, Polish, Dutch, Chinese Traditional, Brazilian Portuguese
  • Rule packs — ready-to-use YAML rules for Django, React, Go
  • CLI: --dry-run, --persona, --json — CI-friendly structured output
  • Migration guides — step-by-step from CodeRabbit and PR-Agent

Community & Virality

  • GitHub Discussion templates (show-and-tell, custom rules)
  • Improved issue templates with dropdown selectors
  • Rewritten CONTRIBUTING.md with contribution paths
  • 20 GitHub topics for discoverability
  • Blog: "Best Free AI Code Review Tools in 2026"
  • Launch materials: Product Hunt, Reddit (r/programming, r/devops, r/selfhosted)
  • PyPI SEO: 18 keywords, Production/Stable classifier

Housekeeping

  • Removed unused src/context/ and src/server/ modules
  • Bumped to v0.5.0
  • Updated README, CHANGELOG, action.yml, .pr-reviewer.yml

Test plan

  • All 428 unit tests pass (pytest tests/unit/ -v)
  • Security scanner benchmark passes (57% recall, 100% precision)
  • New modules have dedicated test suites (complexity: 12, personas: 11, cache: 8, notifications: 7, i18n: 10)
  • Manual test: pr-reviewer init wizard flow
  • Manual test: persona override in action.yml
  • Manual test: Slack webhook notification delivery

… badges

Replace placeholder Discord/stats badges with PyPI downloads, Python version,
and concrete value props. Reposition tagline as "open-source CodeRabbit replacement"
for better SEO and immediate clarity on what the project does.
…d custom rules

Encourage community engagement with structured discussion templates:
- Show & Tell: users share their setups and results (social proof for README)
- Custom Rules: users share and request review rules (builds ecosystem)
…d fields

Add dropdown selectors for platform, provider, command, and feature area.
Makes triage faster and helps identify patterns in bug reports.
Algorithmic complexity analysis based on 6 metrics: size, spread,
language diversity, cross-module coupling, sensitive files, and code churn.
Helps teams enforce small, reviewable PRs. No LLM call needed — instant.
Cover scoring edge cases: empty PRs, multi-language amplification,
sensitive file detection, high churn ratios, and format output.
6 built-in personas: default, security-hawk, mentor, nitpicker, quick-scan, dora.
Each bundles review style, priorities, tone, and max comments.
Teams can set persona: security-hawk in .pr-reviewer.yml instead of
writing custom_instructions from scratch. No competitor has this.
Cover all 6 built-in personas, case-insensitive lookup, prompt modification,
and default persona pass-through behavior.
- --persona: select review persona (security-hawk, mentor, etc.) from CLI
- --json: output review as structured JSON for CI pipeline integration
- --dry-run: explicit flag for no-post mode (documents existing behavior)
Guided setup that generates .pr-reviewer.yml and workflow YAML.
Asks for provider, persona, review style, custom instructions.
Auto-detects frameworks (Next.js, venv) to add smart ignore paths.
Zero-friction onboarding for new users.
8 curated test cases covering SQL injection, XSS, secrets, N+1 queries,
race conditions, eval injection, and clean code. Measures recall/precision
of the security scanner. Baseline: 57% recall, 100% precision.
New coverage: path traversal via os.path.join, timing attacks,
prototype pollution, open redirect, XXE, ReDoS, JWT secret,
mass assignment, file upload, CSRF, insecure cookies, log leaks,
hardcoded IPs, TypeScript any abuse, Go defer-in-loop.
Hashes file patches and caches per PR. On subsequent pushes, only
files with changed patches go to LLM. Can reduce costs 30-70% on
iterative PRs. Cache stored at ~/.pr-reviewer/cache/.
Send review summaries to team channels when risk level exceeds threshold.
Configurable via .pr-reviewer.yml notifications block. Rich formatting
with risk colors, comment counts, and direct PR links.
Weekly/monthly analytics digest: total PRs, risk distribution,
severity breakdown, cost trends, top authors, and a 0-100 team
health score. Outputs markdown for posting to Slack or GitHub Discussions.
Step-by-step migration with config translation tables, command mapping,
and comparison charts. Captures users searching "CodeRabbit alternative"
or "switch from PR-Agent".
Add Chinese Traditional, Brazilian Portuguese, Italian, Turkish, Polish,
Dutch, and Arabic. Structured language injection into system prompt
ensures JSON keys stay English while review text uses target language.
Drop-in rule packs that teams can copy to .pr-reviewer-rules.yml:
- Python/Django: ORM enforcement, migration review, debug detection
- TypeScript/React: no-any, XSS protection, key-as-index, component tests
- Go API: SQL injection, panic handling, error ignoring, TLS verification
Both contained only empty __init__.py files with no code.
Reduces confusion for new contributors.
…ucture

Add good-first-issue guidance, step-by-step paths for adding security rules,
LLM providers, rule packs, and personas. Updated project structure to reflect
all new modules (complexity, personas, cache, i18n, notifications).
Runs the golden dataset benchmark when security.py or eval files change.
Posts recall/precision results as a PR comment for visibility.
New action inputs allow selecting review persona and configuring
notification webhooks directly in workflow YAML without .pr-reviewer.yml.
Also expanded language list to 15 supported languages.
…ation sections

Major README expansion: document 6 review personas with comparison table,
PR complexity scoring explanation, Slack/Discord/Teams notification setup,
migration guides from CodeRabbit and PR-Agent, updated feature comparison
table and roadmap reflecting all new features.
Add high-traffic keywords (coderabbit-alternative, security-scanner,
github-action, devtools). Upgrade status to Production/Stable.
Expand description to mention Bitbucket and position as CodeRabbit alt.
…nd i18n

Comprehensive config example showing all new features: persona selection,
15-language support, notification webhooks, and organized sections.
Topics cover all major search terms: ai, code-review, github-action,
llm, sast, coderabbit-alternative, developer-tools, etc.
SEO-optimized comparison of all major AI code review tools with honest
pros/cons, pricing, and setup time. Targets high-traffic search queries.
Updated PH listing with all new features (personas, /fix, SAST, complexity).
Added targeted Reddit posts for r/programming, r/devops, and r/selfhosted
with different angles for each community.
Additional funding channel alongside GitHub Sponsors.
7 notification tests: summary formatting, risk threshold filtering,
empty/null config handling. 8 cache tests: hash consistency, file
change detection, cache persistence, missing cache.
Cover all 15 languages, case-insensitive lookup, English passthrough,
empty code handling, and language prompt injection content.
Comprehensive changelog covering all 30+ commits: personas, complexity
scoring, 15 new SAST rules, notifications, cache, benchmarks, wizard,
rule packs, i18n expansion, migration guides, and community improvements.
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

AI Code Review

This PR introduces significant improvements to the AI Code Reviewer, including new features, security enhancements, and performance optimizations. The changes are extensive, covering 42 files and adding over 3,000 lines of code. Overall, the PR appears well-structured and thoroughly tested.

Feature | Risk: [MEDIUM] Medium

3 comments: [WARNING] 1 warning · [SUGGESTION] 1 suggestion · [INFO] 1 info


AI Code Reviewer$0.0031 | 2.4s | llama-3.3-70b-versatile
**Free & open source** — Works with GPT, Claude, Llama, Gemini, Ollama. [Add to your repo in 30s](https://github.com/mara-werils/ai-code-reviewer#quick-start) · [Star on GitHub](https://github.com/mara-werils/ai-code-reviewer)

PR Complexity

Complexity: 78/100 (HIGH 4/5)

Breakdown: Lines changed: +30 | Files touched: +15 | Language mix: +3 | Cross-module: +15 | Sensitive files: +15

This PR changes 3375 lines. Consider splitting into smaller, focused PRs for easier review.
This PR touches 42 files across the codebase. Large surface area increases risk of unintended side effects.
Sensitive files changed: .github/workflows/bench.yml, pyproject.toml. Extra review attention recommended.

Security Scan

Found 5 security issues:

  • HIGH: 2
  • MEDIUM: 3

Categories: auth (1), crypto (1), secrets (2), xss (1)

- Anthropic (Claude)
- Google (Gemini)
- Ollama (local)
- Azure OpenAI
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[WARNING] Warning

[WARNING] Potential Information Leak: The workflow field in the bug report template may expose sensitive information. Consider adding a note to remind users to remove secrets.

Suggested fix:

Suggested change
- Azure OpenAI
attributes:
label: Configuration
description: Paste your workflow YAML or .pr-reviewer.yml (remove secrets and sensitive information).

- uses: actions/setup-python@v5
with:
python-version: '3.11'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[SUGGESTION] Suggestion

[SUGGESTION] Improve Benchmark Workflow: Consider adding a step to handle potential failures during the benchmark run, ensuring the workflow doesn't fail unnecessarily.

Suggested fix:

Suggested change
- name: Run security scanner benchmark
run: python -m tests.eval.bench || echo 'Benchmark failed, but continuing workflow...'

Comment thread .pr-reviewer.yml

# Maximum number of comments per review
# max_comments: 15

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[INFO] Info

[INFO] Configuration Update: The updated .pr-reviewer.yml file includes new settings. Ensure these are properly documented and understood by users.

No code changes suggested.

Comment thread src/review/security.py
SecurityRule(
id="SEC083",
name="CSRF protection disabled",
pattern=r"""(?:csrf_exempt|@csrf_exempt|WTF_CSRF_ENABLED\s*=\s*False|CSRF_ENABLED\s*=\s*False)""",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[HIGH] Security: CSRF protection disabled (SEC083)

CSRF protection disabled. State-changing endpoints are vulnerable to CSRF attacks.

Fix: Enable CSRF protection. Use token-based CSRF for APIs, SameSite cookies for sessions.

Matched: csrf_exempt

Comment thread src/wizard.py
- uses: actions/checkout@v4
- uses: mara-werils/ai-code-reviewer@v1
env:
{api_key_env}: ${{{{ secrets.{api_key_secret} }}}}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[HIGH] Security: Cross-Site Scripting (template unescaped) (SEC012)

Unescaped template output can lead to XSS.

Fix: Use escaped output. Avoid mark_safe() and |safe unless content is trusted.

Matched: {{{{ secrets.{api_key_secret} }}}}

Comment thread src/review/cache.py
current_hash = _hash_patch(f.patch)
cached_hash = cached.file_hashes.get(f.filename, "")

if current_hash == cached_hash:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MEDIUM] Security: Timing attack (string comparison of secrets) (SEC052)

String comparison of secrets is vulnerable to timing attacks.

Fix: Use hmac.compare_digest() (Python) or crypto.timingSafeEqual() (Node.js).

Matched: hash ==

Comment thread src/wizard.py

print("\n Next steps:")
if info["env"]:
print(f" 1. Add {info['env']} to GitHub repo secrets")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MEDIUM] Security: Sensitive data in logs (SEC091)

Sensitive data (password, token, etc.) may be written to logs.

Fix: Redact sensitive fields before logging. Use structured logging with field filtering.

Matched: print(f" 1. Add {info['env']} to GitHub repo secret

Comment thread src/wizard.py
print("\n Next steps:")
if info["env"]:
print(f" 1. Add {info['env']} to GitHub repo secrets")
print(f" Settings > Secrets > Actions > New repository secret")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[MEDIUM] Security: Sensitive data in logs (SEC091)

Sensitive data (password, token, etc.) may be written to logs.

Fix: Redact sensitive fields before logging. Use structured logging with field filtering.

Matched: print(f" Settings > Secrets > Actions > New repository secret

@mara-werils mara-werils merged commit d7886cf into main May 15, 2026
4 of 6 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.

1 participant