-
Notifications
You must be signed in to change notification settings - Fork 327
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
Open
eugene-manuilov
wants to merge
27
commits into
develop
Choose a base branch
from
infrastructure/11405-gemini-automation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
151bdb8
Merge branch 'infra/11750-context-documentation' into infrastructure/…
eugene-manuilov 59d8f2e
Expand Gemini context settings.
eugene-manuilov d1b7c91
Configure Gemini settings for MCP servers.
eugene-manuilov 73030b5
Add `implement.toml` Gemini command.
eugene-manuilov 412a038
Add GitHub Actions workflow to automate issue implementation via Gemi…
eugene-manuilov 244a263
Add PHPUnit testing documentation and update Gemini settings to inclu…
eugene-manuilov b049e25
Remove unnecessary `--prompt` flag from Gemini CLI command.
7daa5b0
Pin `@google/gemini-cli` to version `0.22.5` in the Gemini workflow.
0bcda2e
Merge remote-tracking branch 'origin/develop' into infrastructure/114…
960ae91
Reformat Gemini workflow YAML indentation.
087f637
Merge remote-tracking branch 'origin/develop' into infrastructure/114…
4998b8a
Apply suggestions from code review
eugene-manuilov b72651b
Merge remote-tracking branch 'origin/develop' into gemini.
eugene-manuilov a4248f1
Address code review feedback.
eugene-manuilov 83b1d73
Merge remote-tracking branch 'origin/develop' into infrastructure/114…
31f27c1
Update gemini version to 0.23.0.
585b7cf
Fix issues in context files and in the implement command.
56f7b2d
Update the github mcp settings to whitelist only issue reading tools.
c1a2f34
Merge remote-tracking branch 'origin/develop' into infrastructure/114…
873d47c
Replace @ escaping to use the back slash approach.
4255bc0
Update the gemini workflow to use a readonly token to read an issue.
f515e39
Update the implement command to enforce usage of tests.
19bf854
Merge remote-tracking branch 'origin/develop' into infrastructure/114…
eugene-manuilov d94350c
Refactor Gemini workflow to separate implementation and pull request …
eugene-manuilov 04ee04d
Update Gemini workflow to use the default `GITHUB_TOKEN` secret inste…
eugene-manuilov c6b0c71
Switch Gemini GitHub tool configuration from an exclusion list to an …
1a22b2d
Update Gemini implement command configuration.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,46 @@ | ||
| { | ||
| "contextFileName": "AGENTS.md" | ||
| } | ||
| "context": { | ||
| "fileName": [ | ||
| "AGENTS.md", | ||
| "docs/context/js/component-conventions.md", | ||
| "docs/context/js/module-architecture.md", | ||
| "docs/context/js/widgets.md", | ||
| "docs/context/js/feature-tours.md", | ||
| "docs/context/js/jsdoc.md", | ||
| "docs/context/js/notifications.md", | ||
| "docs/context/js/tests.md", | ||
| "docs/context/js/utils.md", | ||
| "docs/context/js/state-management.md", | ||
| "docs/context/js/hooks.md", | ||
| "docs/context/js/storybook.md", | ||
| "docs/context/js/event-tracking.md", | ||
| "docs/context/js/feature-flags.md", | ||
| "docs/context/php/admin-features.md", | ||
| "docs/context/php/asset-management.md", | ||
| "docs/context/php/context-pattern.md", | ||
| "docs/context/php/dependency-injection.md", | ||
| "docs/context/php/module-architecture.md", | ||
| "docs/context/php/naming-conventions.md", | ||
| "docs/context/php/phpunit.md", | ||
| "docs/context/php/prompts-and-dismissals.md", | ||
| "docs/context/php/rest-api.md", | ||
| "docs/context/php/settings-management.md", | ||
| "docs/context/php/storage-patterns.md", | ||
| "docs/context/php/trait-composition.md" | ||
| ] | ||
| }, | ||
| "mcpServers": { | ||
| "github": { | ||
| "trust": false, | ||
| "httpUrl": "https://api.githubcopilot.com/mcp/?toolsets=issues", | ||
| "headers": { | ||
| "Authorization": "Bearer ${GITHUB_TOKEN}" | ||
| }, | ||
| "includeTools": [ | ||
| "issue_read", | ||
| "list_issues", | ||
| "search_issues" | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| name: Gemini Implement Issue | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| issue_number: | ||
| description: GitHub issue number to implement | ||
| required: true | ||
| type: number | ||
|
|
||
| jobs: | ||
| implement: | ||
| name: Implement Issue | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| permissions: | ||
| contents: read | ||
| issues: read | ||
| services: | ||
| mysql: | ||
| image: mysql:5.7 | ||
| env: | ||
| MYSQL_ROOT_PASSWORD: wordpress | ||
| ports: | ||
| - 3306:3306 | ||
| options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 | ||
| env: | ||
| DB_HOST: 127.0.0.1 | ||
| DB_PORT: 3306 | ||
| MYSQL_USER: root | ||
| MYSQL_PASSWORD: wordpress | ||
| MYSQL_DATABASE: wordpress_test | ||
| WP_VERSION: latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: npm | ||
| - name: Install SVN | ||
| run: sudo apt-get update && sudo apt-get install -y subversion | ||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '7.4' | ||
| extensions: mysqli, runkit7, uopz | ||
| tools: composer:2.1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Get Composer Cache Directory | ||
| id: composer-cache | ||
| run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | ||
| - name: Cache Composer dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.composer-cache.outputs.dir }} | ||
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-composer- | ||
| - name: Validate Composer configuration | ||
| run: composer validate --strict | ||
| - name: Install Composer dependencies | ||
| run: composer install --no-interaction --no-progress | ||
| - name: Install npm dependencies | ||
| run: npm ci -w assets -w storybook -w tests/js -w tests/e2e --include-workspace-root | ||
| - name: Set up WordPress test data | ||
| run: tests/phpunit/bin/install-wp-tests.sh "${MYSQL_DATABASE}" "${MYSQL_USER}" "${MYSQL_PASSWORD}" "${DB_HOST}":"${DB_PORT}" "${WP_VERSION}" | ||
| - name: Install Gemini CLI | ||
| run: | | ||
| npm install -g @google/[email protected] | ||
| gemini --version | ||
| - 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 }} | ||
| - name: Create patch | ||
| run: | | ||
| git add . | ||
| git diff --staged --binary > implementation.patch | ||
| - name: Upload patch | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: implementation-patch | ||
| path: implementation.patch | ||
|
|
||
| create-pr: | ||
| name: Create Pull Request | ||
| needs: implement | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Download patch | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: implementation-patch | ||
| - name: Apply patch | ||
| run: git apply implementation.patch | ||
| - name: Create Pull Request | ||
| id: create-pr | ||
| uses: peter-evans/create-pull-request@v7 | ||
| with: | ||
| commit-message: 'Implement issue #${{ inputs.issue_number }}' | ||
| branch: gemini/issue-${{ inputs.issue_number }} | ||
| title: 'Implement #${{ inputs.issue_number }}' | ||
| body: | | ||
| 🤖 Automated implementation of issue #${{ inputs.issue_number }} | ||
|
|
||
| Generated by Gemini CLI using the `/implement` command. | ||
|
|
||
| **Review checklist:** | ||
| - [ ] Code follows documented principles | ||
| - [ ] Tests pass locally | ||
| - [ ] Linting passes | ||
| - [ ] Manual testing completed | ||
| - [ ] Code review score ≥ 0.85 | ||
| draft: true | ||
| - name: Comment on issue | ||
| if: steps.create-pr.outputs.pull-request-number | ||
| run: | | ||
| gh issue comment ${{ inputs.issue_number }} --body "🤖 Automated implementation created in PR #${{ steps.create-pr.outputs.pull-request-number }} | ||
|
|
||
| This is a draft PR generated by Gemini CLI. Please review the changes, run tests, and verify quality before marking ready for review." | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 seems longer than reasonable. How long have we seen it take so far?
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.
I don't know how much time it can take when we actually trigger it as a GitHub workflow. Let's have
60for now and update once we see how it actually works.