Skip to content

Commit 7a6a084

Browse files
authored
Update: llm-cloud-run with sentry prompt and sentry example (#322)
1 parent 3fb1084 commit 7a6a084

2 files changed

Lines changed: 42 additions & 25 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
You are an expert mobile release engineer. Analyze the following Sentry release health data for Firefox.
2+
3+
For each active release (not skipped), assess:
4+
- Whether crash-free rates are within acceptable thresholds (user ≥ 99.5%, session ≥ 99.5%)
5+
- How adoption is progressing across versions (is the latest version ramping as expected?)
6+
- Any regressions between consecutive versions (crash-free rate drops)
7+
8+
Flag any releases that need attention. Provide a brief overall rollout health summary and any recommended actions.

.github/workflows/llm-cloud-run.yml

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ on:
2020
type: choice
2121
options:
2222
- multi-analyze.txt
23+
- sentry-release-health.txt
2324

2425
permissions:
2526
contents: read
@@ -31,6 +32,7 @@ env:
3132
CRASH_URI: gs://testops-llm-artifacts/crashes/minidumps/examples/crash_example.txt
3233
ANR_URI: gs://testops-llm-artifacts/anr/examples/anr_example.txt
3334
IMG_URI: gs://testops-llm-artifacts/images/examples/iOS/1.png
35+
SENTRY_IOS_URI: gs://testops-llm-artifacts/sentry/firefox-ios/latest.json
3436
LOCAL_ARTIFACT_DIR: artifacts
3537

3638
jobs:
@@ -168,6 +170,7 @@ jobs:
168170
gcloud storage cp "${CRASH_URI}" "${LOCAL_ARTIFACT_DIR}/crash_example.txt"
169171
gcloud storage cp "${ANR_URI}" "${LOCAL_ARTIFACT_DIR}/anr_example.txt"
170172
gcloud storage cp "${IMG_URI}" "${LOCAL_ARTIFACT_DIR}/1.png"
173+
gcloud storage cp "${SENTRY_IOS_URI}" "${LOCAL_ARTIFACT_DIR}/sentry_release_health.json"
171174
echo "Downloaded files:"
172175
ls -la "${LOCAL_ARTIFACT_DIR}"
173176
@@ -176,35 +179,42 @@ jobs:
176179
run: |
177180
set -euo pipefail
178181
179-
CRASH_FILE="${LOCAL_ARTIFACT_DIR}/crash_example.txt"
180-
ANR_FILE="${LOCAL_ARTIFACT_DIR}/anr_example.txt"
181-
IMG_FILE="${LOCAL_ARTIFACT_DIR}/1.png"
182-
183182
TOKEN="$(gcloud auth print-identity-token --audiences="${SERVICE_URL}")"
184183
185184
PROMPT_FILE=".github/prompts/${{ inputs.prompt_file }}"
186185
PROMPT=$(<"$PROMPT_FILE")
187186
188-
# Write combined crash + ANR content to a temp file
189-
CONTENT_FILE="$(mktemp)"
190-
{
191-
printf 'Crash:\n'
192-
cat "$CRASH_FILE"
193-
printf '\n\nANR:\n'
194-
cat "$ANR_FILE"
195-
} > "$CONTENT_FILE"
196-
197-
# Post multipart form data: prompt, content (from file), and image
198187
RESPONSE_FILE="$(mktemp)"
199-
curl --fail-with-body -sS -X POST \
200-
-H "Authorization: Bearer ${TOKEN}" \
201-
-F "prompt=$(printf "%s" "$PROMPT")" \
202-
-F "content=<${CONTENT_FILE};type=text/plain; charset=utf-8" \
203-
-F "image=@${IMG_FILE};type=image/png" \
204-
-o "$RESPONSE_FILE" \
205-
"${SERVICE_URL}/analyze"
206-
207-
# Extract output from JSON response and write to GitHub summary
188+
189+
if [ "${{ inputs.prompt_file }}" = "sentry-release-health.txt" ]; then
190+
# Sentry release health: send JSON as log file, no image
191+
curl --fail-with-body -sS -X POST \
192+
-H "Authorization: Bearer ${TOKEN}" \
193+
-F "prompt=$(printf "%s" "$PROMPT")" \
194+
-F "log_file=@${LOCAL_ARTIFACT_DIR}/sentry_release_health.json;type=text/plain" \
195+
-o "$RESPONSE_FILE" \
196+
"${SERVICE_URL}/analyze"
197+
else
198+
# Default: crash + ANR + image
199+
CONTENT_FILE="$(mktemp)"
200+
{
201+
printf 'Crash:\n'
202+
cat "${LOCAL_ARTIFACT_DIR}/crash_example.txt"
203+
printf '\n\nANR:\n'
204+
cat "${LOCAL_ARTIFACT_DIR}/anr_example.txt"
205+
} > "$CONTENT_FILE"
206+
207+
curl --fail-with-body -sS -X POST \
208+
-H "Authorization: Bearer ${TOKEN}" \
209+
-F "prompt=$(printf "%s" "$PROMPT")" \
210+
-F "content=<${CONTENT_FILE};type=text/plain; charset=utf-8" \
211+
-F "image=@${LOCAL_ARTIFACT_DIR}/1.png;type=image/png" \
212+
-o "$RESPONSE_FILE" \
213+
"${SERVICE_URL}/analyze"
214+
215+
rm -f "$CONTENT_FILE"
216+
fi
217+
208218
OUTPUT=$(jq -r '.output' "$RESPONSE_FILE")
209219
210220
{
@@ -213,5 +223,4 @@ jobs:
213223
echo "$OUTPUT"
214224
} >> "$GITHUB_STEP_SUMMARY"
215225
216-
217-
rm -f "$CONTENT_FILE" "$RESPONSE_FILE"
226+
rm -f "$RESPONSE_FILE"

0 commit comments

Comments
 (0)