-
Notifications
You must be signed in to change notification settings - Fork 330
Infrastructure/11405 gemini automation #12019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…11405-gemini-automation.
…05-gemini-automation.
…05-gemini-automation.
aaemnnosttv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @eugene-manuilov, this is a good start, just a few things to address and consider.
.github/workflows/gemini.yml
Outdated
| id: create-pr | ||
| uses: peter-evans/create-pull-request@v7 | ||
| with: | ||
| commit-message: Implement issue #${{ inputs.issue_number }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this run our pre-commit checks? If so, the message needs to end in a full-stop, but also what if lint-staged errors are raised? Should we have the prompt attempt a test commit which can be undone at the end so any issues that are raised can be fixed automatically?
| - name: Run /implement command | ||
| run: | | ||
| gemini --yolo --model gemini-3-pro-preview "/implement ${{ inputs.issue_number }}" | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we can't further restrict the capabilities of the GITHUB_TOKEN here, we should perhaps exclude it since the model should only need read-only access which it should already have as a public repo. If it is needed, perhaps we can provide a PAT with read-only access. Pushing to the repo doesn't happen until the next step anyways so I'd think this should be ok.
|
|
||
| 3. **Re-run Verification** | ||
| - Run linting: !{npm run lint:js} | ||
| - Run tests for affected files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we manually run lint-staged? This can cause failures that might not be triggered by a normal lint run due to incremental rules that are added here. This applies to other places we run linting too, not just here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, let's probably see how it works when i run it as a GitHub workflow, and then if we see problems, i'll update it, ok?
.gemini/commands/implement.toml
Outdated
| 1. Use GitHub MCP tools to fetch issue #{{args}} from repository `google/site-kit-wp` | ||
| - If MCP tools are not available, use: !{gh issue view {{args}} --repo google/site-kit-wp --json title,body} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GH CLI is already scoped to the current repo in actions, so we can probably exclude this as an argument and even tell it not to pass that. Not sure if it's possible to force externally. See https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-github-cli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, removed --repo google/site-kit-wp.
| ═══════════════════════════════════════════════════════════════════════════════ | ||
| PHASE 1: FETCH GITHUB ISSUE | ||
| ═══════════════════════════════════════════════════════════════════════════════ | ||
|
|
||
| **Objective**: Retrieve the issue details and extract implementation instructions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would probably be better to handle as a step and provide as an input rather than having the model do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a slash command that we can use locally as well. If we expect it to have IB passed as an argument, then it will be less convenient to use it locally.
.gemini/commands/implement.toml
Outdated
|
|
||
| 2. Extract the "Implementation Brief" section from the issue body | ||
| - This section typically appears between "## Implementation Brief" and "## QA Brief" | ||
| - If the section markers are not present, use the entire issue body as the implementation task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't do this since the body can contain details that aren't relevant, are out of date. If the issue is malformed, then it should stop.
We should actually provide the AC as well, not just the IB since the AC are more important overarching rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
.gemini/commands/implement.toml
Outdated
| CRITICAL INSTRUCTIONS | ||
| ═══════════════════════════════════════════════════════════════════════════════ | ||
|
|
||
| - You MUST ACTUALLY CREATE, MODIFY, and DELETE files in the repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"in the repository" could mean remotely, where I think we mean locally, in the checked out repository / working directory. We don't want the model to make any changes in the actual repository. This is mentioned below too but we should avoid any ambiguity about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Summary
Addresses issue:
Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist