Skip to content

feat(workflows): gemini-review - #19

Merged
h0ffmann merged 8 commits into
mainfrom
claude/project-thread-g5dwen
Oct 4, 2026
Merged

h0ffmann merged 8 commits into
mainfrom
claude/project-thread-g5dwen

Conversation

@h0ffmann

@h0ffmann h0ffmann commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Hoffmann · project thread

Summary: Before: requesting a review from the gemini team on a PR did nothing. After: marola-gemini-bot posts a Gemini review, then pushes one commit fixing the findings it gave an exact fix for. This works on every repo that calls this workflow.

MIP none. The issue is the spec: marola-dev/marola#641. It supersedes marola-dev/marola#546 and MIP-0072 (marola-dev/marola#548, draft, umbrella-only)
Tested ✅ gates · ⬜ e2e · ✅ live · ⬜ ci-only: gemini_review.py --self-test, tests/self-tests.sh, actionlint, ruff, docs-lint and agents-check all pass. Live on this PR: the bot reviewed it and pushed b8621a1
Cost ~$7 est. (Claude). Gemini's side: $0, free tier

What changed

  • scripts/gemini_review.py (stdlib, --self-test): one Gemini API call per review, because the free tier allows 20 requests a day per model and the run-gemini-cli agent used them all up on this PR. It sends the diff numbered by new-file line, plus .gemini/styleguide.md and AGENTS.md, and asks for JSON. It keeps only the comments GitHub accepts and moves each suggestion onto the lines that really hold its original text, since Gemini's line numbers were two lines off here. Then it posts one COMMENT review. fix applies a fix only where the file still matches, only in files the PR changed, and never under .github/.
  • .github/workflows/gemini-review.yml (reusable): runs on a request for the gemini team. It removes the request, reviews, applies fixes, runs check-command without the token, and pushes as the App with Tested:/Cost:/Co-Authored-By: Gemini.
  • .github/workflows/gemini.yml: this repo's own caller, with check-command: bash tests/self-tests.sh.
  • AGENTS.md: the bot's fix commits name Gemini as co-author. docs/4-reference_workflows.md documents the workflow, the CHANGELOG has an entry, and every pin moves to v0.4.0.

How: The org secrets GEMINI_API_KEY and GEMINI_APP_PRIVATE_KEY and the variable GEMINI_APP_ID reach the workflow through secrets: inherit. Fork PRs are skipped. After merging, tag v0.4.0; each repo then gets a gemini.yml caller in its own PR.

Closes marola-dev/marola#641
Closes marola-dev/marola#546

https://claude.ai/code/session_01NYzPmf2qCK2s2RYccvBVBY

…x commit

Requesting the org team `gemini` on a PR runs run-gemini-cli twice as the marola-gemini-bot App:
once to post a COMMENT review, once with file tools only to fix its own real, local findings.
A plain step refuses changes under .github/ or to .git/config and hooks, runs the caller's
check-command without the token, and pushes one commit. This repo calls it from gemini.yml.
Bumps to v0.4.0.

Refs marola-dev/marola#641

Tested: actionlint (all workflows) ok; bash tests/self-tests.sh all ok; docs-lint clean; agents-check ok
Cost: ~$4 est.
Co-Authored-By: Claude <noreply@anthropic.com>
@h0ffmann h0ffmann self-assigned this Oct 4, 2026
@github-actions github-actions Bot changed the title feat(workflows): gemini-review — a Gemini review on request, and a fix commit feat(workflows): gemini-review Oct 4, 2026
@h0ffmann
h0ffmann marked this pull request as ready for review October 4, 2026 00:25
@h0ffmann
h0ffmann requested a review from a team October 4, 2026 00:28
…-flash

v0.1.9 ignored gemini_model, workflow_name and github_pr_number, so the CLI ran its default Pro
model, which the free tier answered with 503s for three minutes on the first live run (#19).

Tested: actionlint ok
Cost: ~$0.5 est.
Co-Authored-By: Claude <noreply@anthropic.com>
@h0ffmann
h0ffmann requested review from a team and removed request for a team October 4, 2026 00:33
…m its answer

The run-gemini-cli agent spent one request per tool step and hit the free tier's 20 requests a
day per model on the first PR, after posting nothing. scripts/gemini_review.py now sends the
numbered diff once, asks for JSON, posts one COMMENT review with suggestion blocks, and applies a
fix only where its original text still matches, to files the PR changed, never under .github/.

Tested: gemini_review.py --self-test ok; tests/self-tests.sh all ok; actionlint ok; ruff ok; docs-lint clean
Cost: ~$2 est.
Co-Authored-By: Claude <noreply@anthropic.com>
@h0ffmann
h0ffmann requested a review from a team October 4, 2026 00:40

@marola-gemini-bot marola-gemini-bot Bot 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.

Gemini review

The PR introduces a reusable Gemini review workflow and its supporting Python script. However, the script attempts to query an invalid 'files' field from 'gh pr view --json', which will cause the workflow to fail. Additionally, the generated commit lacks the mandatory 'Co-Authored-By' trailer required by the repository's hard rules.

Comment thread scripts/gemini_review.py
Comment thread scripts/gemini_review.py Outdated
Comment thread .github/workflows/gemini-review.yml Outdated
- fixed: scripts/gemini_review.py:274 — Since 'files' is no longer retrieved from 'gh pr view', populate the files list directly from the keys of the 'hunks' dictionary.
- left: scripts/gemini_review.py:256 — the file no longer matches the finding

Tested: bash tests/self-tests.sh ok
Cost: $0 (Gemini API free tier)
@marola-gemini-bot

Copy link
Copy Markdown
Contributor

Gemini pushed b8621a1 with the fixes it was sure of; re-request gemini for a fresh review.

  • fixed: scripts/gemini_review.py:274 — Since 'files' is no longer retrieved from 'gh pr view', populate the files list directly from the keys of the 'hunks' dictionary.
  • left: scripts/gemini_review.py:256 — the file no longer matches the finding

claude and others added 3 commits October 4, 2026 00:43
Gemini's review on #19 flagged the missing Co-Authored-By; the bot's commit was written by
Gemini, so it names Gemini, and AGENTS.md records the exception.

Tested: actionlint ok; agents-check ok
Cost: ~$0.3 est.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: marola-gemini-bot[bot] <337517965+marola-gemini-bot[bot]@users.noreply.github.com>
… original text

Gemini's line numbers on #19 were two lines off, so committing its suggestion replaced the
diff-size check instead of the gh call and broke the script (python-ci red on dbe9745). The
review now moves a fix onto the one in-hunk place its original text appears, or drops the fix
and keeps the comment. Restores the size check and keeps the title,body query.

Tested: gemini_review.py --self-test ok (new anchor cases); tests/self-tests.sh all ok; ruff check + format ok
Cost: ~$0.5 est.
Co-Authored-By: Claude <noreply@anthropic.com>
@h0ffmann

h0ffmann commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Gemini setup working now

@h0ffmann h0ffmann changed the title feat(workflows): gemini-review feat(workflows): gemini-review — a Gemini review on request, and a fix commit Oct 4, 2026
@github-actions github-actions Bot changed the title feat(workflows): gemini-review — a Gemini review on request, and a fix commit feat(workflows): gemini-review Oct 4, 2026
…w a repo opts in

Tested: docs-lint clean
Cost: ~$0.2 est.
Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants