Skip to content

Setup automated Gemini PR review workflow#16

Closed
kaaloo wants to merge 1 commit into
mainfrom
feat/gemini-pr-review
Closed

Setup automated Gemini PR review workflow#16
kaaloo wants to merge 1 commit into
mainfrom
feat/gemini-pr-review

Conversation

@kaaloo
Copy link
Copy Markdown
Contributor

@kaaloo kaaloo commented Jun 2, 2026

Summary

  • add project-specific Gemini review rules for eval-transcript pull request diffs
  • add an agy-backed GitHub Actions workflow that builds a PR diff, runs a static AI review, and upserts one review comment
  • skip the review when GEMINI_API_KEY is unavailable

Verification

  • uv run python - <<'PY' ... YAML/Markdown validation
  • uv run python -m unittest discover -s tests -v

Note

The workflow assumes the installed Antigravity CLI supports headless authentication through GEMINI_API_KEY; if upstream agy does not support that in CI yet, the workflow may need an authentication adjustment.

🚀 Generated with Gemini CLI

Add an agy-backed GitHub Actions review workflow and project-specific Gemini review rules for static pull request feedback.

Co-Authored-By: Gemini CLI <noreply@google.com>

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c7d1c50f8a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +82 to +86
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
GEMINI_FORCE_FILE_STORAGE: "true"
TZ: UTC
run: |
agy --print-timeout 10m -p "$(cat review_prompt.md)" > agy_review.md
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use an auth path that agy supports

In a GitHub-hosted ubuntu-latest runner there is no persistent Antigravity keyring/browser/LOAS session, and the official Antigravity CLI auth docs describe keyring/browser auth and Linux gLinux LOAS rather than GEMINI_API_KEY. When this workflow reaches the review step with the secret present, exporting only GEMINI_API_KEY does not authenticate agy, so the job will prompt, hang, or fail instead of producing agy_review.md; use a supported noninteractive auth setup or a CLI that actually accepts this API key.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged. This is valid: the current agy workflow does not have a supported noninteractive authentication path with GEMINI_API_KEY, and the workflow run confirmed it posted an OAuth timeout instead of a real review. Closing this PR for now; we can reopen or recreate it once agy documents/supports key-based CI authentication.

from textwrap import dedent

max_diff_bytes = 200_000
rules = Path('.gemini/review-rules.md').read_text(encoding='utf-8')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep review rules from the trusted base

For PRs that modify .gemini/review-rules.md, this reads the rules from the checked-out PR workspace, so the untrusted change becomes part of the trusted instruction block before reviewing its own diff. That lets a PR suppress or reshape the automated review exactly when the rule file changes; fetch/read the base-branch copy of the rules or embed them in the workflow instead.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged. This is valid too: trusted review instructions should not be read from the untrusted PR checkout. If we revive this workflow later, the rules should come from the base branch or be embedded in the workflow.

@kaaloo
Copy link
Copy Markdown
Contributor Author

kaaloo commented Jun 2, 2026

Closing this PR for now.

The experiment confirmed that the current Antigravity CLI (agy) workflow is not ready for repository CI review with GEMINI_API_KEY: the GitHub Actions run installed agy, but the review step produced an OAuth browser-login prompt and timed out instead of generating a review. Codex also correctly noted that any revived workflow should keep review instructions trusted by reading them from the base branch or embedding them, not from the PR checkout.

I checked google-github-actions/run-gemini-cli as an alternative. It still documents API-key support, but it remains Gemini CLI-based and I found no documented migration plan to agy; given Gemini CLI’s announced transition, that would only be an interim workaround.

We can reopen or recreate this PR once agy documents/supports a noninteractive key-based authentication path for GitHub Actions.

@kaaloo kaaloo closed this Jun 2, 2026
@kaaloo kaaloo deleted the feat/gemini-pr-review branch June 2, 2026 16:28
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