Skip to content

Releases: derailed-dash/gemini-review-action

v1.6.3: Prompt Hardening & Sweeping Claims Guard

Choose a tag to compare

@derailed-dash derailed-dash released this 19 Aug 07:46
9ba8b88

What's Changed in v1.6.3

🛡️ Prompt Hardening Against Unverified Sweeping Claims

  • No Unverified Universal Affirmations: Explicitly instructs Gemini to avoid making sweeping, universal, or exhaustive assertions (such as "all actions/dependencies are pinned to SHAs" or "all endpoints validate input") in prose fields (summary and general_feedback) unless verified across every occurrence in the diff (#43, #45).
  • Zero-Cost & Zero-Latency Quality Guard: Fixes unanchored praise directly at the prompt/instruction level, eliminating false-positive compliments without introducing the latency penalty or $2\times$ token cost multiplier of a multi-pass verification critic loop.
  • Synchronised Fallback & Test Coverage: Updated both gemini-review.toml and the default fallback base prompt in load_system_instruction, backed by unit test coverage.

📜 Rolled-In Highlights from Previous Releases

v1.6.2: Vertex AI Billing Cost Attribution & Commit Status De-duplication

  • Vertex AI Billing Labels: Automatically attaches component=gemini-review-action and repo=owner_repo labels to Vertex AI API requests for direct Cloud Billing cost attribution and export aggregation.
  • GitHub API Exponential Backoff & Retry: Adds automatic retries for transient GitHub 5xx server errors and network resets.
  • Accurate Commit Status Signals: Eliminates duplicate Commit Status API calls during standard pull_request runs while preserving updates for slash-command /gemini-review retries.
  • Pricing Refinements: Zero-rate cache read pricing support and storage caveats for token-based cache pricing models.

v1.6.1: Cost Estimation Telemetry & Fork PR Security

  • Dollar Cost Reporting: Automatically calculates and reports estimated review costs directly in the tokenomics summary table based on published rates, cached input discounts, and promotional pricing.
  • Fork PR Security Workflow: Gracefully skips automatic PR runs from external forks where secrets are inaccessible, guiding maintainers to trigger reviews securely via /gemini-review.
  • No Silent Drops: Validates that GitHub accepted review payloads and fails loudly in CI if delivery fails.

v1.6.0: Dynamic Context Selection in Sparse Mode

  • AI-Powered Dynamic Context Selection: When repository size exceeds the sparse threshold (1.5 MB), Gemini dynamically evaluates candidate files and selects up to 8 of the most relevant modules (callers, dependencies, tests, utilities) to include in full context.
  • Core Safeguard Budget: Guaranteed inclusion of core config and documentation files (README.md, pyproject.toml, package.json, etc.).

v1.5.2: Default Model Upgrade to Gemini 3.7 Flash

  • Upgraded default model across reviews and issue triaging to gemini-3.7-flash.

v1.5.1: Code Suggestion Sanitisation & Auto-Indentation

  • Sanitised inline code suggestion formatting by stripping outer fences, line-number prefixes, and auto-aligning indentation to match target code nesting.

v1.5.0: Multi-Axis Code Quality Review Directives

  • Enhanced review prompt directives with senior engineering evaluation standards, constructive structural remedies, and refined dependency discipline.

Full Changelog: v1.6.2...v1.6.3

v1.6.2: Vertex AI Billing Labels, Network & API Retries, Commit Status De-duplication

Choose a tag to compare

@derailed-dash derailed-dash released this 18 Aug 21:52
827d741

🌟 What's New in v1.6.2

🏷️ Cloud Billing Label Attribution on Vertex AI

  • Cost Attribution in GCP Billing: Automatically attaches Google Cloud Billing request labels (component: gemini-review-action, repo: <owner_repo>) on Vertex AI runs so that review costs can be grouped and analysed directly in GCP Cloud Billing exports (#38 by @SaschaHeyer).
  • Customisable Labels: Supports custom key-value pairs via the billing_labels input (GEMINI_BILLING_LABELS="team=platform,cost_centre=dev"), automatically sanitising keys and values to comply with GCP label regex and length requirements.

🔄 Resilient Delivery & Network Error Retries

  • Transient API Retry Logic: Introduces post_with_retry to automatically retry review submissions on transient GitHub API hiccups (HTTP 5xx server errors and 429 rate limits) with tight exponential backoff (1s, 3s) (#36 by @SaschaHeyer).
  • Network Exception Handling: Catches connection resets and socket timeouts (requests.exceptions.RequestException), ensuring momentary network flaps do not drop reviews or waste token spend.
  • Fast Failure on Client Errors: Fails fast on permanent client errors (403, 422) without pointless retries.

🎯 Accurate Commit Status Signals & De-duplication

  • Eliminate Duplicate Status Checks: Suppresses redundant Commit Status API calls during standard pull_request workflow runs where GitHub Actions already tracks and reports check runs natively (#44).
  • Clean Retry Checks: Preserves explicit commit status updates for manual slash-command re-runs (/gemini-review on issue_comment events) so that PR checkmarks update cleanly on retry.
  • Dynamic Workflow Context: Dynamically derives commit status context names from GITHUB_WORKFLOW.

💵 Token Pricing & Cache Valuation Refinements

  • Zero-Rate Cache Reads: Accurately honours cache_read = 0.0 for providers with free cache reads rather than falling back to default multipliers (#37 by @SaschaHeyer).
  • Refined Storage Caveats: Improves context-cache storage caveats for token-based cache pricing models like Gemini 3.7 Flash.

📊 Action Usage Tracking & Best Practice Documentation

  • Usage Telemetry Badge: Added workflow and endpoint badge tracking public action usage and active consumer count (#39).
  • Security Guidance: Recommends full commit SHA pinning and adds caveats regarding workflow-level concurrency cancellation (#41 by @SaschaHeyer).

📜 Rolled-In Highlights from Previous Releases

v1.6.1: Cost Estimation Telemetry & Fork PR Security
  • Dollar Cost Reporting: Automatically calculates and reports estimated review costs directly in the tokenomics summary table based on official published rates, cached input discounts, and time-boxed promotional pricing.
  • Fork PR Workflow Security: Skips automatic pull_request triggers from external forks where secrets are inaccessible, routing maintainers to trigger reviews securely via /gemini-review.
  • No Silent Drops: Verifies that GitHub accepted review payloads and fails loudly in CI if delivery fails completely.
v1.6.0: Dynamic Context Selection in Sparse Mode
  • AI-Powered Dynamic Context Selection: When repository size exceeds the sparse threshold (1.5 MB), Gemini dynamically evaluates candidate repository files and selects up to 8 of the most relevant modules (callers, dependencies, tests, utilities) to include in full context.
  • Core Safeguard Budget: Guaranteed inclusion of core config and documentation files (README.md, pyproject.toml, package.json, etc.).
v1.5.2: Default Model Upgrade to Gemini 3.7 Flash
  • Upgraded default model across reviews and issue triaging to gemini-3.7-flash.
v1.5.1: Code Suggestion Sanitisation & Auto-Indentation
  • Sanitised inline code suggestion formatting by stripping outer fences, line-number prefixes, and auto-aligning indentation to match target code nesting.
v1.5.0: Multi-Axis Code Quality Review Directives
  • Enhanced review prompt directives with senior engineering evaluation standards, constructive structural remedies, and refined dependency discipline.
v1.4.5: Line Range Accuracy & Discussion Tracking
  • Multi-line suggestion targeting, automatic PR comment history and conversation thread tracking, and suppression of redundant re-reviews on inline fixes.

Full Changelog: v1.6.1...v1.6.2

v1.6.1: Cost Estimation Telemetry, Fork PR Security & Resilient Error Handling

Choose a tag to compare

@derailed-dash derailed-dash released this 17 Aug 17:54
5ae319e

🌟 What's New in v1.6.1

💰 Automated Cost Estimation & Pricing Telemetry

  • Dollar Cost Reporting: Automatically calculates and reports estimated review costs directly in the tokenomics summary table based on official published rates, cached input discounts, and time-boxed promotional pricing (#33 by @SaschaHeyer).
  • Decoupled Pricing Module: Clean pricing.py architecture supporting custom token rates via environment variables (GEMINI_RATE_INPUT, GEMINI_RATE_OUTPUT) or gemini-review.toml.
  • Accurate Input Billing: Properly bills prior PR comment history tokens at full input rates rather than silently dropping them.
  • Gemini 3.7 Flash Cache Read Pricing: Introduces support for Gemini 3.7 Flash cache read pricing multipliers (DEFAULT_CACHE_READ_MULTIPLIER = 0.1).

🛡️ Fork PR Workflow Security & Slash Command Routing

  • Skipping Fork PR Failures: Restricts automatic pull_request workflow triggers to internal repository branches, cleanly skipping fork PRs where repository secrets are inaccessible by GitHub design (#34).
  • Slash Command Execution (/gemini-review): Repository maintainers can securely trigger reviews on external fork PRs by commenting /gemini-review, ensuring safe execution with full access to GEMINI_API_KEY.
  • PR Template: Added .github/pull_request_template.md with contributor checklists and maintainer slash-command guidance.
  • Contribution Guide: Updated CONTRIBUTING.md with comprehensive workflow lifecycle guidance and linking to exemplar PRs.

⚡ Resilient Error Handling & Visible Failure Signals

  • No More Silent Drops: post_review now verifies if review comments were accepted by GitHub API. If posting fails completely, it raises a RuntimeError and sets the commit status to failure, alerting maintainers immediately in CI.

📜 Rolled-In Highlights from Previous Releases

v1.6.0: Dynamic Context Selection in Sparse Mode
  • AI-Powered Dynamic Context Selection: When repository size exceeds the sparse threshold (1.5 MB), Gemini dynamically evaluates candidate repository files and selects up to 8 of the most relevant modules (callers, dependencies, tests, utilities) to include in full context.
  • Core Safeguard Budget: Guaranteed inclusion of core config and documentation files (README.md, pyproject.toml, package.json, etc.).
v1.5.2: Default Model Upgrade to Gemini 3.7 Flash
  • Upgraded default model across reviews and issue triaging to gemini-3.7-flash.
v1.5.1: Code Suggestion Sanitisation & Auto-Indentation
  • Sanitised inline code suggestion formatting by stripping outer fences, line-number prefixes, and auto-aligning indentation to match target code nesting.
v1.5.0: Multi-Axis Code Quality Review Directives
  • Enhanced review prompt directives with senior engineering evaluation standards, constructive structural remedies, and refined dependency discipline.
v1.4.5: Line Range Accuracy & Discussion Tracking
  • Multi-line suggestion targeting, automatic PR comment history and conversation thread tracking, and suppression of redundant re-reviews on inline fixes.

Full Changelog: v1.6.0...v1.6.1

v1.6.0 - Dynamic Context Selection in Sparse Mode

Choose a tag to compare

@derailed-dash derailed-dash released this 15 Aug 18:25
0e99825

What's Changed

  • feat(context): add dynamic codebase context selection in sparse mode … by @derailed-dash in #32

Full Changelog: v1.5.2...v1.6.0

Release v1.5.2: Upgrade default model to Gemini 3.7 Flash

Choose a tag to compare

@derailed-dash derailed-dash released this 14 Aug 16:24
b617adf

Changes in v1.5.2

  • Upgrade default model to gemini-3.7-flash across PR reviews and Issue Triage workflows.

v1.5.1: Code Suggestion Sanitisation & Automatic Indentation Alignment

Choose a tag to compare

@derailed-dash derailed-dash released this 04 Aug 20:40
aaf0094

🚀 What's New in v1.5.1

This point release fixes inline code suggestion formatting issues by automatically sanitising line-number prefixes, stripping outer markdown block fences, and dynamically auto-aligning indentation levels across all code depth nesting.


✏️ Code Suggestion Sanitisation & Line-Number Prefix Stripping

  • Line-Number Prefix Filtering: Added sanitize_code_suggestion() to automatically strip line-number prefixes (e.g., 105 | , 105 + |, L105:) from inline code suggestions before posting to GitHub.
  • Strict Regex Matching: Differentiates pipe-delimited plain number prefixes (105 | ) from valid Python dictionary keys ({105: "foo"}) or switch labels (case 105:), preserving valid code structures.
  • Markdown Block Fence Clean-Up: Automatically strips outer markdown fences (``` or ```suggestion) if emitted by Gemini inside code_suggestion.

📐 Automatic Indentation Alignment across All Nesting Depths

  • Dynamic Target Indentation Matching: Added _auto_align_suggestion_indentation() to measure the exact leading indentation (spaces or tabs) of target source lines in the repository file.
  • Under-Indentation Delta Calculation: Automatically calculates indentation offsets ($$\text{delta} = \text{target_indent} - \text{first_s_indent}$$) and prepends proper leading whitespace to suggestions starting with 0 or partial indentation.
  • Supports All Indentation Depths: Correctly aligns suggestions across any nesting level (2, 4, 8, 12, 16+ spaces or tabs) while preserving relative multi-line block indentation.

📋 System Instruction & Schema Rules

  • Prompt Reinforcement: Updated suggestion_instruction in prompts.py to explicitly direct Gemini to avoid line numbers, line prefixes, or code block fences.
  • Schema Documentation: Updated InlineComment.code_suggestion description in schemas.py for stricter structural formatting guidance.

🧪 Test Suite & Quality Assurance

  • Added unit tests for sanitize_code_suggestion and multi-level indentation alignment (test_auto_align_suggestion_indentation_deep_nesting, test_auto_align_suggestion_indentation_tabs).
  • 75 total unit tests passing cleanly.
  • Verified with codespell and ruff.

v1.5.0: Multi-Axis Code Quality Review Directives & Documentation

Choose a tag to compare

@derailed-dash derailed-dash released this 30 Jul 11:42

🌟 What's New in v1.5.0

This release introduces comprehensive multi-axis code quality directives into starter-examples/gemini-review.toml, enhancing Gemini's review capabilities with senior engineering evaluation standards, constructive structural remedies, and refined dependency discipline.


🎯 Multi-Axis Quality Review Directives

  • Five-Axis Quality Axes: Systematic technical review criteria across Correctness & Verification, Readability & Simplicity, Architecture & System Design, Security & Data Hardening, and Performance & Efficiency.
  • Constructive Structural Remedies: Directives instructing Gemini to propose named restructurings (e.g. replacing conditional chains with typed dispatchers, collapsing duplicate branches, separating orchestration from business logic).
  • Review Philosophy ("Lead with Leverage"): Introduced Code Health Improvement standards and prioritization rules (correctness, security, and structural regressions first; cosmetic nits last).
  • Dependency & Refactoring Discipline: Added strict guidance against niche dependencies, changelog and lockfile diff reviews, and rules for identifying dead code artifacts.
  • Common Rationalisations: Instructed Gemini to actively reject superficial excuses ("it works so it's good enough", "relocating code made it cleaner").

📚 Documentation & Process Updates

  • Refined multiline prompt formatting and line-wrapping across TOML example templates.
  • Updated release procedures and GitHub Marketplace metadata synchronization guidelines in README.md and docs/architecture.md.

v1.4.5: Line Range Accuracy, Re-Review Suppression & Input Parameter Standards

Choose a tag to compare

@derailed-dash derailed-dash released this 26 Jul 16:21

🚀 What's New in v1.4.5

This release introduces accurate inline code suggestion line range targeting, suppresses redundant re-review loops on inline fixes, establishes clear Action input parameter standards, and consolidates all 1.4.x features and bug fixes.


✏️ Line Range Accuracy & Inline Fix Duplication Fix (v1.4.5)

  • Inline Suggestion Range Auto-Correction: Added _auto_correct_suggestion_range to filter_review_comments. When code_suggestion contains multi-line original code and start_line was omitted (None), the action inspects file diff lines using contiguous sequential matching and automatically sets start_line and line range bounds.
  • Eliminate Duplicated Code Blocks: Prevents GitHub's inline "Commit suggestion" button from replacing single lines with multi-line blocks that duplicate surrounding code.
  • System Instruction Guidance: Updated InlineComment schema docstrings and system instructions to explicitly mandate [start_line..line] range bounds whenever multi-line original code is included in suggestions.

🔕 Re-Review Suppression on Inline Suggestion Commits (v1.4.5)

  • Ignore GitHub UI Suggestion Commits: Added is_inline_suggestion_commit() to detect commits created when developers click "Commit suggestion" in GitHub UI (web-flow / noreply@github.com committer with suggestion commit patterns).
  • Graceful Skip: On pull_request: synchronize events, if the commit was created by accepting an inline suggestion, gemini_pr_review.py logs a skip notice and exits gracefully (sys.exit(0)), preventing noisy and unneeded immediate re-review passes.
  • Configurable Input: Controlled via skip_inline_suggestions: 'true' in action.yml inputs and GEMINI_SKIP_INLINE_SUGGESTIONS env var (default: 'true').

⚙️ Action Input Parameter Standards & AGENTS.md Rule (v1.4.5)

  • Workflow Input Parameter Architecture: Operational configuration parameters (such as skip_inline_suggestions, include_comment_history, language, persona, timeout) MUST be configured via action input parameters in action.yml, workflow .yml files, and environment variables (GEMINI_*).
  • TOML Prompt Scope: gemini-review.toml is strictly reserved for prompt text templates and custom prompt overrides.
  • Project Guidance: Documented parameter vs TOML configuration rules in AGENTS.md.

🔄 Automatic PR Status Check Updates & Permissions (v1.4.3 & v1.4.4)

  • Commit Statuses API Integration: Added post_commit_status to gemini_review/github.py. Posts a commit status check update (state='success', context="Dazbo's Gemini Code Review / review (pull_request)") to GitHub upon review completion.
  • Required Workflow Permissions: Updated workflows to require statuses: write and checks: write permissions.

🐛 Defensive Response Parsing & Exception Guarding (v1.4.2)

  • Safely Handle Null/Empty Gemini API Responses: Fixed unhandled TypeError when response.text is None.
  • Property Getter Exception Guarding: Wrapped property accesses on response.text, candidates, function_calls, and prompt_feedback in try...except blocks in extract_response_text_or_raise.
  • Candidate Diagnostic Logging: Logs candidate finish_reason, finish_message, safety ratings, and function call attempts to sys.stderr when text output is missing.

🧠 Holistic Engineering Review Scope (v1.4.2)

  • Comprehensive Evaluation: Expanded system instructions and persona guidance to evaluate documentation updates (.md files, READMEs, architecture records) alongside source code.
  • Expanded PR Summary Budget: Target PR summary budget set to 3–6 sentences.

🧪 Rick Sanchez Persona & Context Cache Isolation (v1.4.1)

  • Rick Sanchez Persona (rick): Added Rick Sanchez from Rick and Morty as a selectable reviewer persona overlay (persona: 'rick').
  • Persona Context Cache Isolation: Appended active persona suffix to Gemini context cache key (repo-cache-{repo}-{model}-{persona}) to guarantee persona cache separation.

🧪 Test Coverage & Quality

  • Added unit tests for is_inline_suggestion_commit, _auto_correct_suggestion_range, post_commit_status, property getter exceptions, and persona cache isolation (70 total unit tests passing).
  • Fully formatted and validated with ruff and codespell.

v1.4.1 - Rick Sanchez Persona & Context Cache Isolation

Choose a tag to compare

@derailed-dash derailed-dash released this 23 Jul 19:46
2865008

Release v1.4.1 - Rick Sanchez Persona & Context Cache Isolation

🧪 What's New:

  • Rick Sanchez Persona (rick): Added Rick Sanchez from Rick and Morty as a selectable reviewer persona overlay (persona: 'rick').
    • Tone & Style: Hyper-intelligent, cynical multiverse genius (*burp*, "*Wubba Lubba Dub-Dub**Rick Sanchez Persona ( rick ) **: Added Rick Sanchez from Rick and Morty as a selectable reviewer persona overlay ( persona: 'rick' ) .", "Jerry-tier code").
    • Engineering Standards: Demands galaxy-brain engineering perfection, treating sloppy bugs or missing error handling as pathetic Jerry-level amateur work.
  • Persona Context Cache Isolation: Appended active persona suffix to Gemini context cache key (repo-cache-{repo}-{model}-{persona}) to guarantee that switching personas immediately invalidates old cached system instructions.
  • Unit Tests & Docs: Full test coverage in tests/test_pr_review.py (62 tests passing) including persona cache invalidation tests and updated documentation with assets/rick-review.png.

v1.3.5: Model-Validated Context Caching & Resilience Fallback

Choose a tag to compare

@derailed-dash derailed-dash released this 22 Jul 21:44
ed6049e

What's Changed

  • Model-Validated Context Caching: Prevents INVALID_ARGUMENT 400 errors when switching Gemini models (e.g. from gemini-3.5-flash to gemini-3.6-flash). Context cache display names are now model-scoped (repo-cache-{repo}-{model}) and existing server cache handles are validated against the requested model before reuse.
  • Resilient Generation Fallback: If calling generate_content with a cached content handle fails for any reason, the action logs a warning and automatically falls back to direct context generation without interrupting the CI pipeline.
  • Vertex AI / Publisher Prefix Normalisation: Enhanced _normalize_model_name() to handle Vertex AI / Agent Platform resource strings (publishers/google/models/...).
  • Dogfooding Workflows: Upgraded repository GitHub Actions workflow configurations to gemini-3.6-flash.

Full Changelog: v1.3.4...v1.3.5