From fc7bd0c708e560b065e262ae74adca8412866c2f Mon Sep 17 00:00:00 2001 From: prem-2006 Date: Sun, 12 Oct 2025 18:47:42 +0530 Subject: [PATCH 1/2] fix: update Gemini model version in presubmit.yml (#3337) The Presubmit.ai check was failing due to an outdated Gemini model version. Updated LLM_MODEL from "gemini-1.5-flash" to "gemini-1.5-flash-latest" to fix the issue. --- .github/workflows/presubmit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index cac1250b70e8..fb43da1e66fb 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -32,4 +32,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LLM_API_KEY: ${{ secrets.LLM_API_KEY }} - LLM_MODEL: "gemini-1.5-flash" + LLM_MODEL: "gemini-1.5-flash-latest" # ✅ updated model version From 16eeea7ee259f2b0c2e1585e652b968644bfdd8b Mon Sep 17 00:00:00 2001 From: prem-2006 Date: Fri, 31 Oct 2025 23:00:59 +0530 Subject: [PATCH 2/2] Refactor presubmit workflow for AI code review Updated pull request event types and removed secret check step. Modified AI reviewer step to include new environment variables. --- .github/workflows/presubmit.yml | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index fb43da1e66fb..4d0501ed1873 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -7,29 +7,24 @@ permissions: on: pull_request_target: # Handle forked repository PRs in the base repository context - types: [opened, synchronize] - pull_request_review_comment: # Handle review comments - types: [created] + types: [opened, synchronize, reopened, ready_for_review] jobs: review: runs-on: ubuntu-latest - steps: - - name: Check required secrets - run: | - if [ -z "${{ secrets.LLM_API_KEY }}" ]; then - echo "Error: LLM_API_KEY secret is not configured" - exit 1 - fi - - name: Check out PR code - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 - - name: Run AI Reviewer + - name: Run AI code reviewer uses: presubmit/ai-reviewer@latest env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - LLM_API_KEY: ${{ secrets.LLM_API_KEY }} - LLM_MODEL: "gemini-1.5-flash-latest" # ✅ updated model version + LLM_PROVIDER: ai-sdk + LLM_MODEL: gemini-1.5-flash-latest # ✅ Updated model + REVIEW_SUMMARY: "true" + MAX_TOKENS: "4096" + TEMPERATURE: "0.2" + + - name: Print completion message + run: echo "✅ AI code review completed successfully!"