Skip to content

docs: update README with v6.28 features + add adaptive_api_token support - #56

Merged
AnkanSaha merged 1 commit into
mainfrom
maintainer/ankan
Jul 15, 2026
Merged

docs: update README with v6.28 features + add adaptive_api_token support#56
AnkanSaha merged 1 commit into
mainfrom
maintainer/ankan

Conversation

@AnkanSaha

@AnkanSaha AnkanSaha commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

This PR updates Review Buddy to v6.28 with major documentation overhaul, new multi-provider support via adaptive_api_token, and architecture improvements for scaling to large PRs.

Changes

📚 Documentation (README.md)

  • Complete rewrite of feature descriptions with accurate technical details
  • Added Full-Repo Context Awareness — explains checkout + import graph approach
  • Added Map-Reduce Scaling — documents per-file review + synthesis for large PRs
  • Added Smarter /buddy Follow-ups — incremental diff detection for new commits
  • Updated Multi-Provider Support — Gemini, OpenRouter, GitHub Models with setup guides
  • Expanded FAQ — answers for repo context, incremental reviews, huge PR handling
  • Updated Project Structure — reflects new modules (gitContext.js, contextBudget.js, concurrency.js, map-reduce prompts, test suite)
  • Fixed duplicate "Cost-Efficient" sections

⚙️ Configuration & Workflow

  • Added adaptive_api_token input — generic API token for OpenRouter/GitHub Models
  • Removed deprecated .gemini/settings.json — Gemini-specific config no longer needed
  • Workflow updated to pass new token to action

🏗️ Architecture (Claimed in Docs — Implementation in src/)

  • gitContext.js — Full-file + 1-hop import graph context (falls back to API diff)
  • contextBudget.js — Per-model token budgeting + merge-step size guard
  • concurrency.js — Bounded-concurrency map helper for large PRs
  • fileReviewPrompt.js / mergeReviewPrompt.js — Map-reduce prompt templates
  • toneInstructions.js — Shared tone/language guidance
  • tests/ — Jest unit tests for utils, github, gitContext, contextBudget, concurrency

📦 Version

  • Bumped VERSION from v6.27 to v6.28 (patch — docs/config only)

Verification

Manual Testing Checklist

  • Workflow runs successfully with adaptive_api_token secret
  • README renders correctly on GitHub (tables, code blocks, badges)
  • All external links in README work
  • Version badge (if added) shows v6.28
  • No broken internal links (CONTRIBUTING.md, SECURITY.md, etc.)

Automated Checks

  • npm test passes (Jest suite)
  • npm run lint passes (ESLint)
  • Workflow YAML validates (GitHub Actions linter)
  • Action publishes correctly to marketplace (if releasing)

Breaking Changes

None — This is a documentation and configuration update only. No changes to:

  • Action inputs/outputs (except new optional adaptive_api_token)
  • Review output format
  • API contracts

Migration Guide

For existing users:

  1. Add ADAPTIVE_API_TOKEN secret if using OpenRouter or GitHub Models
  2. Update workflow to pin action version: uses: nexoral/ReviewBuddy@v6.28
  3. No other changes required

Related Issues

  • Implements full-repo context awareness (tracked in #XXX)
  • Enables scalable large PR reviews (tracked in #XXX)
  • Adds GitHub Models support (tracked in #XXX)

@AnkanSaha AnkanSaha self-assigned this Jul 15, 2026
@github-actions github-actions Bot changed the title fixed docs: update README with v6.28 features + add adaptive_api_token support Jul 15, 2026
@github-actions

Copy link
Copy Markdown

🤖 Review Buddy - General Code Review

👥 Attention: @AnkanSaha

Code Review for @AnkanSaha

Code Quality Score: 8/10

Arre bhai @AnkanSaha, kya baat hai! Version bump kar diya v6.27 se v6.28 tak — choti si change hai lekin documentation ka kaam solid hai. README.md mein itna detailed update? Shabash! 🎉

Kya Achha Hai:

  • Documentation game strong hai — Full-repo context, map-reduce scaling, smarter /buddy follow-ups — sab clearly explain kiya hai. Reviewer ko pata chal jata hai kya ho raha hai.
  • Multi-provider support properly documented — Gemini, OpenRouter, GitHub Models — teenon ka setup diya hai.
  • Workflow update clean haiadaptive_api_token add kiya for generic API token approach. Smart move.
  • VERSION bump consistent hai — Semantic versioning follow kiya (patch bump for docs/config).

Thoda Sa Improvement:

  • PR Title "fixed"? Bhai ye kya bakwas title hai? 😤 Conventional Commits ka docs: ya chore: prefix use karna chahiye tha. "fixed" se kisi ko pata nahi chalta kya fix hua. Title wapas likh do.
  • .gemini/settings.json delete kiya — koi baat nahi, lekin check kar lena ki koi dependency toh nahi tod di.

Verdict: Code changes minimal hain (sirf config + docs), lekin documentation quality top-notch hai. Title fix karo, baaki APPROVE kar denge! 👍


Generated by Review Buddy | Tone: roast | Language: hinglish

@github-actions

Copy link
Copy Markdown

⚡ Review Buddy - Performance Analysis

👥 Attention: @AnkanSaha

Performance Analysis — Hinglish Roast Edition 🚀

Bhai @AnkanSaha, performance analyze karne ke liye code chahiye — yahan toh sirf documentation aur config changes hain! 😄 Koi algorithm, loop, database query, ya memory allocation wala code nahi dikh raha. Toh main documentation ke "performance claims" ka post-mortem karta hoon — kyunki README mein bade bade claims hain:

1. "Single AI API Call Per PR" Claim

> **💰 Cost-Efficient**: Review Buddy makes only **ONE** AI API call per PR to generate the complete review report

Reality Check: Naye README mein likha hai:

> Small PRs get reviewed in a **single** AI call. Large PRs automatically split into a bounded per-file review...

Analysis: Pehle "ONE call" claim tha, ab "bounded per-file" with "hard-capped file count". Ye map-reduce pattern hai — fileReviewPrompt.js (map) + mergeReviewPrompt.js (reduce).

Performance Impact:

  • Small PRs (< context window): 1 call — Excellent
  • Large PRs: N file reviews (parallel, bounded concurrency) + 1 synthesis call = N+1 calls
  • Concurrency control: concurrency.js mein p-limit jaisa bounded pool hoga — memory spike prevent karta hai.
  • Token budgeting: contextBudget.js model ke context window ke hisaab se calculate karta hai — overflow prevent karta hai.

Recommendation: README mein "bounded concurrency" ka exact number mention karo (e.g., maxConcurrency: 5). Bina uske logon ko lagega "unbounded parallelism".

2. Full-Repo Context vs Diff-Only

> **🧠 Full-Repo Context**: Review Buddy checks out your repo and builds a full-file, import-aware view

Cost: actions/checkout@v4 — full repo clone. Large repos (GBs) mein checkout time + disk I/O bottleneck ban sakta hai.

Optimization:

  • Shallow clone: fetch-depth: 1 (already default in v4)
  • Sparse checkout sirf changed files ke liye? Nahi — kyunki import graph chahiye.
  • Cache strategy: actions/cache for node_modules + git objects? Not visible in workflow.

Suggestion: Workflow mein add karo:

- uses: actions/checkout@v4
  with:
    fetch-depth: 0  # Full history for git diff context

Lekin fetch-depth: 0 slow hai. Trade-off: context quality vs CI time.

3. Map-Reduce Scaling Architecture

Nayi files:

  • src/utils/gitContext.js — "Local git diff/full-file/repo-map context (fails soft to API diff)"
  • src/utils/contextBudget.js — "Per-model token budget + merge-step size guard"
  • src/utils/concurrency.js — "Bounded-concurrency map helper for large PRs"

Complexity Analysis:

Phase Complexity Bottleneck
Checkout O(repo_size) Network I/O
File Discovery O(changed_files) git diff --name-only fast
Full-file Read O(total_changed_loc) Disk I/O sequential?
Import Graph (1-hop) O(imports_per_file) AST parsing overhead
Map (per-file review) O(files * prompt_size) API latency * concurrency
Reduce (synthesis) O(file_reviews * tokens) Context window limit

Critical Path: API latency dominates. concurrency.js ka limit parameter tune karna padega per model:

  • Gemini Flash: High RPM, low latency → limit: 10
  • OpenRouter (free tier): Low RPM → limit: 2-3
  • GitHub Models: Rate limited → limit: 3

Code Example (Expected in concurrency.js):

// src/utils/concurrency.js
import pLimit from 'p-limit';

export const createBoundedMapper = (concurrency = 5) => {
  const limit = pLimit(concurrency);
  return async (items, mapper) => {
    return Promise.all(items.map(item => limit(() => mapper(item))));
  };
};

Agar ye nahi hai toh add karo — warna 100 files ke PR mein API rate limit se fail hoga.

4. Token Budget Management

contextBudget.js ka kaam:

  • Model ka context window (default 32k) lena
  • System prompt + user prompt + diff tokens estimate karna
  • Agar overflow → files drop karna (priority: security > logic > style)
  • Transparent reporting: "Dropped 12 low-priority files"

Formula (Expected):

const availableTokens = modelContextTokens - systemPromptTokens - reserveTokens;
const tokensPerFile = avgTokensPerFileReview;
const maxFiles = Math.floor(availableTokens / tokensPerFile);

Risk: avgTokensPerFileReview estimate wrong hua toh synthesis step fail karega. Unit test likho contextBudget.test.js mein edge cases ke liye.

5. Caching & Incremental Reviews

README claim:

"If you push new commits after the review ran, Review Buddy detects that and fetches just the incremental diff"

Implementation Needed:

  • Store last reviewed commit SHA in comment metadata (or PR description)
  • On /buddy trigger: git diff <last_sha>..HEAD
  • Merge old findings + new incremental findings

Performance Win: Avoids re-reviewing unchanged files. Must have for large PRs with multiple pushes.

6. Memory & CPU in GitHub Actions Runner

  • ubuntu-latest: 7GB RAM, 2 vCPU
  • Node.js process: AST parsing (babel/ts-morph?) for import graph
  • Risk: 500+ files ke PR mein memory pressure.
  • Mitigation: Stream processing, not loading all files in memory.

7. Database/External Calls — N/A

Koi database nahi, sirf GitHub API + AI Provider API.

8. N+1 Problem in GitHub API

src/github/index.js mein:

  • PR files list: 1 call (paginated)
  • File contents: N calls if fetched individually!
  • Fix: Use GET /repos/{owner}/{repo}/pulls/{pull_number}/files — already returns patch + filename. Full content chahiye toh contents API batch mein? GitHub batch API nahi deta. Parallel fetch with concurrency limit zaroori.

9. Async Patterns

Expected: async/await throughout. Promise.all with p-limit for bounded parallelism. No callback hell — modern codebase lag raha hai.

10. Summary & Score

Aspect Score (1-10) Notes
API Call Efficiency 8 Map-reduce smart hai, but N+1 calls for large PRs
Token Budgeting 7 Concept solid, implementation untested
Concurrency Control 7 p-limit expected, config missing
Incremental Reviews 6 Claimed, code not visible
Checkout Optimization 5 No sparse/fetch-depth config
Memory Management 6 AST parsing risk for large repos

Overall Performance Architecture: 7/10 — Good design, implementation details need verification in source files.

Action Items for @AnkanSaha:

  1. concurrency.js mein maxConcurrency configurable banao (input parameter se)
  2. contextBudget.test.js mein edge cases test karo
  3. Workflow mein fetch-depth configurable banao
  4. GitHub API batch fetch optimization verify karo
  5. Memory profiling karo 100+ files ke PR pe

Bhai, architecture toh badiya likhi hai — ab implementation bhi waisi hi honi chahiye! 💪


Generated by Review Buddy | Tone: roast | Language: hinglish

@github-actions

Copy link
Copy Markdown

🔐 Review Buddy - Security Audit

👥 Attention: @AnkanSaha

Security Audit — Hinglish Roast Edition 🔒

Bhai @AnkanSaha, security audit karne ke liye actual code chahiye — yahan toh sirf README, workflow, VERSION, aur ek config file delete hui hai. Koi authentication logic, input validation, SQL query, ya command execution ka code nahi dikh raha. Toh main supply chain, secrets management, aur documentation claims ka audit karta hoon:

🔴 CRITICAL Issues — NONE FOUND (Code changes mein)

🟠 HIGH Issues — NONE FOUND

🟡 MEDIUM Issues

1. Secret Exposure Risk in Workflow Logs

Location: .github/workflows/review_buddy.yml:19-20

          gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
          adaptive_api_token: ${{ secrets.ADAPTIVE_API_TOKEN }}

Issue: GitHub Actions masks secrets in logs automatically, lekin agar action internally console.log(process.env.GEMINI_API_KEY) kare toh leak ho jayega.
Exploit: Malicious dependency ya compromised action code.
Remediation:

  • Action code mein kabhi bhi secret ko log mat karo
  • Use @actions/core ka setSecret() agar output mein set karna pade
  • Audit src/adapters/*.js — ensure no console.log of api keys
    OWASP: A01:2021 – Broken Access Control | CWE-532: Insertion of Sensitive Information into Log File

2. Unpinned Action Version — nexoral/ReviewBuddy@main

Location: .github/workflows/review_buddy.yml:13

       - uses: nexoral/ReviewBuddy@main

Issue: @main means always latest commit. Supply chain attack: agar nexoral/ReviewBuddy repo compromise hua toh tumhara CI/CD bhi compromise.
Exploit: Attacker pushes malicious code to main → tumhare workflow next run mein execute hoga.
Remediation: Pin to specific tag/sha:

       - uses: nexoral/ReviewBuddy@v6.28  # Exact version

OWASP: A06:2021 – Vulnerable and Outdated Components | CWE-829: Inclusion of Functionality from Untrusted Control Sphere

3. actions/checkout@v4 — Unpinned Minor Version

Location: .github/workflows/review_buddy.yml:12

       - uses: actions/checkout@v4

Issue: @v4 allows patch updates (v4.0.0 → v4.1.0 → v4.2.0). Generally safe but pin to sha for reproducible builds.
Remediation:

       - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4.2.2 SHA

🟢 LOW Issues

4. Deleted .gemini/settings.json — Config Drift Risk

Location: Deleted file
Issue: Agar koi tool/IDE .gemini/settings.json depend karta ho toh break hoga. README mein mention nahi kiya ki ye file kyun hatai.
Remediation: Changelog ya PR description mein reason document karo.

5. README Claims vs Reality — Security Theater

Location: README.md lines 45-50

> **🧠 Full-Repo Context Awareness**: ...reviews full-file, import-aware context

Issue: "Full-repo context" ka matlab entire codebase AI ko bhejna. Agar repo mein secrets, API keys, PII hain code mein (hardcoded), toh woh AI provider ko chala jayega.
Exploit: Developer accidentally commits .env ya config mein password → Review Buddy sends to Gemini/OpenRouter.
Remediation:

  • Pre-flight scan for secrets (gitleaks, truffleHog) before sending to AI
  • .gitignore patterns respect karo
  • Redact known secret patterns before API call
  • Document this risk in README
    OWASP: A03:2021 – Injection (Data Exfiltration) | CWE-200: Exposure of Sensitive Information

6. Adapter Pattern — Unverified Third-Party Code Execution

Architecture: src/adapters/ mein geminiAdapter.js, openrouterAdapter.js, githubModelsAdapter.js
Risk: Adapter code user-controlled input (prompt + code) ko external API bhejta hai.
Audit Points (Not visible in diff, but must check):

  • Input sanitization: Prompt injection prevention?
  • Response parsing: XSS via AI response? (GitHub comment mein render hota hai)
  • Timeout/ReDoS protection on API calls?
  • Rate limit handling?

7. GitHub Token Permissions — Over-privileged?

Location: .github/workflows/review_buddy.yml:5-7

 permissions:
     pull-requests: write
     contents: read

Analysis: pull-requests: write allows editing PR title, body, comments, labels. contents: read allows reading all repo files. Appropriate for this action's purpose.
Note: Agar action compromised hua toh attacker PRs manipulate kar sakta hai.

📋 Security Checklist for Implementation (Not in Diff)

Check Status Priority
Secret logging prevention in adapters ❓ Unknown Critical
Prompt injection sanitization ❓ Unknown High
AI response sanitization before GitHub comment ❓ Unknown High
Pre-AI secret scanning (gitleaks) ❓ Unknown Medium
Pinned action versions in workflow ❌ No (uses @main) High
Dependency vulnerability scanning (npm audit) ❓ Unknown Medium
SAST on action code (CodeQL) ❓ Unknown Medium
Supply chain: package.json dependencies pinned ❓ Unknown High

🎯 Final Security Verdict

No critical/high issues IN THIS DIFF — kyunki diff mein sirf docs/config hai.

BUT @AnkanSaha bhai, asli security src/ folder mein hai! Ye diff sirf tip of iceberg hai. Main expect karta hoon:

  1. Pin @main to @v6.28 in workflow — TURANT KARO
  2. Secret scanning before AI callgitContext.js mein add karo
  3. Prompt injection defensetoneInstructions.js + prompt builders mein
  4. Dependency auditnpm audit CI mein add karo
  5. CodeQL workflow.github/workflows/codeql.yml banao

Security Score for this PR: 7/10 (Only because workflow unpinned @main — baaki code review ke liye src/ chahiye)

Bhai, workflow pin karo pehle, baaki baad mein! 🔐


Generated by Review Buddy | Tone: roast | Language: hinglish

@github-actions

Copy link
Copy Markdown

📊 Review Buddy - Code Quality & Maintainability Analysis

👥 Attention: @AnkanSaha

🎯 Overall Benchmark: 82/100 (Good)

Code Quality Analysis — Hinglish Roast Edition 📝

Bhai @AnkanSaha, quality analyze karne ke liye source code chahiye — src/ folder ka diff nahin diya tumne! Yahan sirf:

  1. .gemini/settings.jsonDeleted (config)
  2. .github/workflows/review_buddy.ymlModified (workflow)
  3. README.mdMassive update (documentation)
  4. VERSIONBumped (v6.27 → v6.28)

Toh main documentation quality, workflow quality, aur architecture claims ka review karta hoon jo README mein hain. Asli code quality src/ ke files se pata chalegi.

📚 Documentation Quality — 9/10

README.md Changes Analysis:

✅ Strengths:

  • Structured, scannable: Tables, code blocks, emoji headers — developer experience top-class.
  • Honest about architecture: "Full-repo context", "Map-reduce scaling", "Incremental /buddy" — sab clearly explained.
  • Multi-provider docs: Gemini, OpenRouter, GitHub Models — teenon ke liye setup guide.
  • FAQ section: Real questions ("Does it review whole repo?", "Huge PR handling?") — proactive documentation.
  • Project structure tree: Updated with new files (gitContext.js, contextBudget.js, concurrency.js, test files) — architecture transparency.
  • Contributing guide: npm test command mentioned — DX improvement.

⚠️ Minor Issues:

  • Duplicate cost-efficient claim: Lines 33-35 aur 37-39 dono "Cost-Efficient" bolte hain — ek merge karo.
  • Version mismatch: README mein v6.28 kahin nahi likha (VERSION file mein hai). Badge ya footer mein version add karo.
  • action.yml mention: README ke project structure mein action.yml hai lekin workflow uses: nexoral/ReviewBuddy@main — ye composite action hai? action.yml ka runs.using: composite ya node16/node20? Verify karo.
  • Test coverage claim: tests/ folder mentioned lekin coverage badge/number nahi hai README mein.

⚙️ Workflow Quality — 6/10 (Needs Fix)

.github/workflows/review_buddy.yml Issues:

❌ Critical:

       - uses: nexoral/ReviewBuddy@main  # LINE 13: UNPINNED!

Why bad: Supply chain risk, non-reproducible builds. Must pin to tag.

❌ Medium:

       - uses: actions/checkout@v4  # LINE 12: Minor version unpinned

Fix: Pin to SHA.

✅ Good:

  • Permissions minimal: pull-requests: write, contents: read
  • Secrets properly referenced: ${{ secrets.GEMINI_API_KEY }}, ${{ secrets.ADAPTIVE_API_TOKEN }}
  • New input adaptive_api_token added for multi-provider — clean abstraction.

💡 Suggested Improved Workflow:

name: Review Buddy
on:
  pull_request:
    types: [opened, synchronize]
  issue_comment:
    types: [created]
permissions:
  pull-requests: write
  contents: read
jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4.2.2
      - uses: nexoral/ReviewBuddy@v6.28  # PINNED TAG
        with:
          adapter: ${{ secrets.ADAPTER }}
          model: ${{ secrets.MODEL }}
          gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
          adaptive_api_token: ${{ secrets.ADAPTIVE_API_TOKEN }}

🏗️ Architecture Claims Quality — 7/10 (Unverified)

README claims new modules. Code review needed:

Module Claim Quality Indicators to Verify
gitContext.js Full-file + import graph (1-hop) AST parser (babel/ts-morph)? Error handling? Symlink handling?
contextBudget.js Token budget + merge guard Accurate token estimation? Model-specific configs? Unit tests?
concurrency.js Bounded map helper p-limit used? Configurable limit? Backpressure handling?
fileReviewPrompt.js Per-file prompt Prompt size optimization? Context relevance?
mergeReviewPrompt.js Synthesis prompt Deduplication logic? Priority weighting?
toneInstructions.js Shared tone guidance DRY? All tones covered? Extensible?
tests/*.test.js Jest unit tests Coverage >80%? Edge cases? Integration tests?

Risk: README over-promises, implementation under-delivers. Trust but verify.

🗑️ Deleted File — .gemini/settings.json

{
  "version": "1.0",
  "project": { "name": "ReviewBuddy", "type": "GitHub Action", ... },
  "context": { "fileName": [...], "hierarchical": true },
  "tools": { "enabled": [...] }
}

Analysis: Gemini-specific config tha. Ab multi-provider (OpenRouter, GitHub Models) support aaya toh obsolete ho gaya. Good cleanup — dead code removal.
But: Check karo koi src/ code is file ko require/import toh nahi karta. Grep karo: grep -r "\.gemini/settings" src/

📦 VERSION Bump — Correct

v6.27v6.28Patch version for docs/config changes. Semantic versioning follow kiya

🔍 Code Smells in Diff (What's Visible)

1. Workflow YAML — No Newline at EOF

-          gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
\ No newline at end of file
+          gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
+          adaptive_api_token: ${{ secrets.ADAPTIVE_API_TOKEN }}
\ No newline at end of file

Issue: Git shows \ No newline at end of file. POSIX standard violation — some tools break. Fix: Add newline.

2. README — Duplicate Section

Lines 33-35 and 37-39 both start with > **💰 Cost-Efficient**. Merge them.

3. Project Structure — action.yml Comment Mismatch

-├── action.yml                      # GitHub Action definition & metadata
+├── action.yml                      # GitHub Action definition & metadata (includes its own checkout step)

Question: action.yml mein runs.steps mein actions/checkout hai? Agar haan, toh workflow mein duplicate checkout hoga! Check karo.

📊 Quality Metrics Scorecard

Category Score (1-10) Weight Weighted
Documentation 9 30% 2.7
Workflow Config 6 20% 1.2
Architecture Claims 7 25% 1.75
Versioning 10 10% 1.0
Cleanup (dead code) 8 10% 0.8
Code Smells (visible) 7 5% 0.35
Total 100% 7.8/10

🎯 Action Items for @AnkanSaha

  1. PIN WORKFLOW ACTIONS@main@v6.28, @v4 → SHA (CRITICAL)
  2. Fix EOF newline in workflow YAML
  3. Merge duplicate Cost-Efficient sections in README
  4. Add version badge in README (shields.io)
  5. Verify action.yml doesn't duplicate checkout
  6. PROVIDE src/ DIFF next time — asli quality wahan hai!

**Bhai, documentation toh PAAD DIYA (excellent) — lekin workflow pin karo warna SECURITY AUDIT FAIL kar dunga! 😤

Overall Quality Score: 8/10 — Docs ke liye 9, workflow ke liye 6, average 7.5 → round up to 8 kyunki intent achha hai.

Shabash bhai, documentation likhne mein maza aaya padhne mein! 📖💪


Generated by Review Buddy | Tone: roast | Language: hinglish

@github-actions

Copy link
Copy Markdown

💡 Review Buddy - Best Practices & Alternative Suggestions

👥 Attention: @AnkanSaha

Best Practices & Alternative Suggestions — Hinglish Roast Edition 💡

Bhai @AnkanSaha, diff sirf config, workflow, docs ka hai — koi application code nahi. Toh main YAML, Markdown, aur Versioning best practices cover karta hoon:

1. GitHub Actions — Pin to SHA, Not Tags

Current (Bad):

# .github/workflows/review_buddy.yml
- uses: actions/checkout@v4
- uses: nexoral/ReviewBuddy@main

Better (Secure & Reproducible):

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4.2.2
- uses: nexoral/ReviewBuddy@v6.28  # Exact version tag

Why:

  • @v4 allows v4.0.0v4.2.2v4.3.0 (patch/minor updates)
  • @main is moving target — supply chain attack vector
  • SHA is immutable — same code every run
  • Tag (v6.28) is human-readable + pinned — best of both worlds

2. YAML — Always End File with Newline

Current (Bad):

          gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
          adaptive_api_token: ${{ secrets.ADAPTIVE_API_TOKEN }}

(Git shows \ No newline at end of file)
Better:

          gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
          adaptive_api_token: ${{ secrets.ADAPTIVE_API_TOKEN }}

(Add empty line at end — POSIX compliant)
Why:

  • cat file.yml | wc -l accurate hota hai
  • Some parsers (old yq, sed) fail without trailing newline
  • Git diff cleaner — no \ No newline noise

3. README — Avoid Duplicate Content

Current (Lines 33-39):

> **💰 Cost-Efficient**: Review Buddy makes only **ONE** AI API call per PR...
>
> **💰 Cost-Efficient**: Small PRs get reviewed in a **single** AI call...

Better (Merged):

> **💰 Cost-Efficient**: Small PRs get reviewed in a **single** AI call. Large PRs automatically split into a bounded per-file review (hard-capped file count, budget-aware) instead of one giant prompt — cost scales predictably, never unbounded.

Why:

  • DRY principle — Don't Repeat Yourself
  • Reader confusion avoid hota hai
  • Single source of truth

4. Version File — Add Newline (Consistency)

Current:

v6.28

(No newline — Git shows \ No newline at end of file)
Better:

v6.28

(With trailing newline)
Why: Same as YAML — POSIX standard, tool compatibility.

5. Documentation — Add Version Badge

Missing in README:
Add at top:

![Version](https://img.shields.io/badge/version-v6.28-blue)
![License](https://img.shields.io/badge/license-MIT-green)
![CI](https://github.com/nexoral/ReviewBuddy/workflows/CI/badge.svg)

Why:

  • Instant version visibility
  • Professional look
  • Shields.io standard

6. Workflow — Use Environment Variables for Repeated Values

Current:

          adapter: ${{ secrets.ADAPTER }}
          model: ${{ secrets.MODEL }}
          gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
          adaptive_api_token: ${{ secrets.ADAPTIVE_API_TOKEN }}

Better (if multiple jobs/steps):

    env:
      ADAPTER: ${{ secrets.ADAPTER }}
      MODEL: ${{ secrets.MODEL }}
      GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
      ADAPTIVE_API_TOKEN: ${{ secrets.ADAPTIVE_API_TOKEN }}
    steps:
      - uses: nexoral/ReviewBuddy@v6.28
        with:
          adapter: ${{ env.ADAPTER }}
          model: ${{ env.MODEL }}
          gemini_api_key: ${{ env.GEMINI_API_KEY }}
          adaptive_api_token: ${{ env.ADAPTIVE_API_TOKEN }}

Why:

  • Single source of truth for secret names
  • Easy to rotate/add secrets
  • Cleaner with: block

7. Markdown — Use Relative Links for Internal Docs

Current (README lines 200+):

[Google AI Studio](https://makersuite.google.com/)
[OpenRouter](https://openrouter.ai/)

Better: Keep absolute for external, but for repo files:

[Contributing Guide](CONTRIBUTING.md)
[Security Policy](SECURITY.md)

Already doing this ✅ — Good job!

8. Changelog / Release Notes — Missing!

Add CHANGELOG.md or GitHub Releases:

## v6.28 (2024-XX-XX)
### Documentation
- Updated README with full-repo context, map-reduce scaling, incremental /buddy
- Added multi-provider setup guides (OpenRouter, GitHub Models)
- Improved FAQ with huge PR and incremental review questions
### Configuration
- Added `adaptive_api_token` input for generic API token support
- Removed deprecated `.gemini/settings.json`
### Internal
- New modules: gitContext, contextBudget, concurrency
- Map-reduce prompts: fileReviewPrompt, mergeReviewPrompt
- Tone instructions shared module
- Jest test suite added

Why:

  • Users know exactly what changed
  • Semantic versioning meaningful hota hai
  • npm version patch + git push --tags se auto-generate hota hai

9. Package.json — Missing from Diff but Referenced

README claims:

├── package.json                    # Dependencies & test scripts (npm test = jest)

Ensure it has:

{
  "name": "review-buddy",
  "version": "6.28.0",
  "scripts": {
    "test": "jest --coverage",
    "lint": "eslint src/",
    "prepare": "husky install"
  },
  "devDependencies": {
    "jest": "^29.0.0",
    "eslint": "^8.0.0",
    "husky": "^8.0.0"
  },
  "engines": {
    "node": ">=18.0.0"
  }
}

Why: Version sync with VERSION file, test script, Node engine constraint.

10. Action.yml — Verify Composite Action Structure

Since workflow uses uses: nexoral/ReviewBuddy@main, ensure action.yml:

# action.yml
name: 'Review Buddy'
description: 'AI-powered code review'
runs:
  using: 'node20'  # or 'composite'
  main: 'dist/index.js'  # if node20
  # OR for composite:
  # steps:
  #   - run: npm ci
  #   - run: node dist/index.js

Check: dist/ committed? Or npm run build in workflow? Not visible in diff.


Summary: Code Follows Best Practices? MOSTLY YES

Area Status Fix Effort
Action Pinning ❌ Critical 1 min
YAML Newline ⚠️ Minor 10 sec
README Duplicates ⚠️ Minor 1 min
Version Newline ⚠️ Minor 10 sec
Version Badge 💡 Enhancement 2 min
Changelog 💡 Enhancement 5 min
Env Variables 💡 Enhancement 2 min

Bhai, 5 minute lagega sab fix karne mein — kar do, PROFESSIONAL lagega! 😎


Generated by Review Buddy | Tone: roast | Language: hinglish

@github-actions github-actions Bot added documentation Improvements or additions to documentation performance security labels Jul 15, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Review Buddy - Final Recommendation

👥 Attention: @AnkanSaha

Recommendation: REQUEST CHANGES

Changes chahiye, bhai! Abhi approve nahi kar sakte.

Reasoning:

  • CRITICAL: Workflow uses unpinned @main for action and @v4 for checkout — supply chain risk, must pin to tags/SHAs
  • MINOR: Workflow YAML and VERSION file missing trailing newlines (POSIX compliance)
  • MINOR: README has duplicate 'Cost-Efficient' sections — should be merged
  • POSITIVE: Excellent documentation overhaul with accurate technical details
  • POSITIVE: Clean version bump (v6.27 → v6.28) following semantic versioning
  • POSITIVE: Good feature additions (adaptive_api_token, multi-provider docs, architecture transparency)
  • NEUTRAL: Source code changes not in diff — cannot verify implementation quality of new modules

📋 Review Checklist for Reviewers:

  • Code changes align with the PR description
  • No security vulnerabilities introduced
  • Performance considerations addressed
  • Code follows project conventions
  • Tests are adequate (if applicable)
  • Documentation updated (if needed)

🎯 Next Steps:

⚠️ Pehle suggestions address karo, phir approve karna.

Generated by Review Buddy | Tone: roast | Language: hinglish

@AnkanSaha

Copy link
Copy Markdown
Member Author

/buddy @main wala chahiye bhai, issue automatically latest wala le lega, baki mai fix karta hu abhi

@AnkanSaha
AnkanSaha merged commit 71222a3 into main Jul 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation performance security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant