feat: add gemini server support OD-118#14
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds ripgrep to the Dockerfile, removes the Gemini extension installation from the entrypoint script, and updates the local pipeline script to execute Gemini with streaming JSON output, parsing the results and calculating run metadata using jq. A review comment points out a potential issue in the jq parsing logic where a missing result event could cause a null-indexing error, and suggests using the pipe operator for safe navigation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| tokensIn: ($result.stats.input_tokens // 0), | ||
| tokensOut: ($result.stats.output_tokens // 0), | ||
| durationMs: ($result.stats.duration_ms // 0), | ||
| costUsd: ((($result.stats.input_tokens // 0) * 0.50 + ($result.stats.output_tokens // 0) * 3.00) / 1000000), |
There was a problem hiding this comment.
If the Gemini run fails or does not emit a result event, $result will be null. In jq, attempting to index a variable that is null directly (e.g., $result.stats) throws a Cannot index null with string "stats" error, which will cause this jq command to fail and print an error to stderr.
To prevent this, use the pipe operator to safely navigate the potentially null $result object (e.g., ($result | .stats.input_tokens // 0)).
| tokensIn: ($result.stats.input_tokens // 0), | |
| tokensOut: ($result.stats.output_tokens // 0), | |
| durationMs: ($result.stats.duration_ms // 0), | |
| costUsd: ((($result.stats.input_tokens // 0) * 0.50 + ($result.stats.output_tokens // 0) * 3.00) / 1000000), | |
| tokensIn: ($result | .stats.input_tokens // 0), | |
| tokensOut: ($result | .stats.output_tokens // 0), | |
| durationMs: ($result | .stats.duration_ms // 0), | |
| costUsd: (((($result | .stats.input_tokens // 0) * 0.50 + ($result | .stats.output_tokens // 0) * 3.00)) / 1000000), |
There was a problem hiding this comment.
Pull request overview
Adds support for running the configure-codacy-cloud skill using the Gemini CLI in the local Docker pipeline, aligning the container tooling with Gemini CLI expectations.
Changes:
- Update
docker/local-pipeline.shto runconfigure-codacy-cloudvia Gemini using the skill’sSKILL.md, capturing streamed output and run metadata. - Remove Gemini extension installation from the container entrypoint.
- Install
ripgrepin the Docker image to support Gemini CLI’s preferred search backend.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docker/local-pipeline.sh | Switches local pipeline Gemini execution to SKILL.md-driven invocation with stream capture + run metadata extraction. |
| docker/entrypoint.sh | Removes Gemini extension installation at startup. |
| docker/Dockerfile | Adds ripgrep package for Gemini CLI performance/compatibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| gemini -y --skip-trust -m "${GEMINI_MODEL:-gemini-3-flash-preview}" -o stream-json \ | ||
| -p "Execute the skill instructions provided above." < "${SKILL_MD}" \ | ||
| | tee "${GEMINI_STREAM_FILE}" \ | ||
| | jq --unbuffered -rj 'select(.type == "message" and .role == "assistant") | .content' | ||
| SKILL_EXIT=${PIPESTATUS[0]} | ||
| RUN_FINISHED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ) | ||
| echo |
| GEMINI_STREAM_FILE=$(mktemp) | ||
| RUN_STARTED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ) | ||
|
|
PoW: