Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/prompts/sentry-release-health.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
You are an expert mobile release engineer. Analyze the following Sentry release health data for Firefox.

For each active release (not skipped), assess:
- Whether crash-free rates are within acceptable thresholds (user ≥ 99.5%, session ≥ 99.5%)
- How adoption is progressing across versions (is the latest version ramping as expected?)
- Any regressions between consecutive versions (crash-free rate drops)

Flag any releases that need attention. Provide a brief overall rollout health summary and any recommended actions.
59 changes: 34 additions & 25 deletions .github/workflows/llm-cloud-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
type: choice
options:
- multi-analyze.txt
- sentry-release-health.txt

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

jobs:
Expand Down Expand Up @@ -168,6 +170,7 @@ jobs:
gcloud storage cp "${CRASH_URI}" "${LOCAL_ARTIFACT_DIR}/crash_example.txt"
gcloud storage cp "${ANR_URI}" "${LOCAL_ARTIFACT_DIR}/anr_example.txt"
gcloud storage cp "${IMG_URI}" "${LOCAL_ARTIFACT_DIR}/1.png"
gcloud storage cp "${SENTRY_IOS_URI}" "${LOCAL_ARTIFACT_DIR}/sentry_release_health.json"
echo "Downloaded files:"
ls -la "${LOCAL_ARTIFACT_DIR}"

Expand All @@ -176,35 +179,42 @@ jobs:
run: |
set -euo pipefail

CRASH_FILE="${LOCAL_ARTIFACT_DIR}/crash_example.txt"
ANR_FILE="${LOCAL_ARTIFACT_DIR}/anr_example.txt"
IMG_FILE="${LOCAL_ARTIFACT_DIR}/1.png"

TOKEN="$(gcloud auth print-identity-token --audiences="${SERVICE_URL}")"

PROMPT_FILE=".github/prompts/${{ inputs.prompt_file }}"
PROMPT=$(<"$PROMPT_FILE")

# Write combined crash + ANR content to a temp file
CONTENT_FILE="$(mktemp)"
{
printf 'Crash:\n'
cat "$CRASH_FILE"
printf '\n\nANR:\n'
cat "$ANR_FILE"
} > "$CONTENT_FILE"

# Post multipart form data: prompt, content (from file), and image
RESPONSE_FILE="$(mktemp)"
curl --fail-with-body -sS -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-F "prompt=$(printf "%s" "$PROMPT")" \
-F "content=<${CONTENT_FILE};type=text/plain; charset=utf-8" \
-F "image=@${IMG_FILE};type=image/png" \
-o "$RESPONSE_FILE" \
"${SERVICE_URL}/analyze"

# Extract output from JSON response and write to GitHub summary

if [ "${{ inputs.prompt_file }}" = "sentry-release-health.txt" ]; then
# Sentry release health: send JSON as log file, no image
curl --fail-with-body -sS -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-F "prompt=$(printf "%s" "$PROMPT")" \
-F "log_file=@${LOCAL_ARTIFACT_DIR}/sentry_release_health.json;type=text/plain" \
-o "$RESPONSE_FILE" \
"${SERVICE_URL}/analyze"
else
# Default: crash + ANR + image
CONTENT_FILE="$(mktemp)"
{
printf 'Crash:\n'
cat "${LOCAL_ARTIFACT_DIR}/crash_example.txt"
printf '\n\nANR:\n'
cat "${LOCAL_ARTIFACT_DIR}/anr_example.txt"
} > "$CONTENT_FILE"

curl --fail-with-body -sS -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-F "prompt=$(printf "%s" "$PROMPT")" \
-F "content=<${CONTENT_FILE};type=text/plain; charset=utf-8" \
-F "image=@${LOCAL_ARTIFACT_DIR}/1.png;type=image/png" \
-o "$RESPONSE_FILE" \
"${SERVICE_URL}/analyze"

rm -f "$CONTENT_FILE"
fi

OUTPUT=$(jq -r '.output' "$RESPONSE_FILE")

{
Expand All @@ -213,5 +223,4 @@ jobs:
echo "$OUTPUT"
} >> "$GITHUB_STEP_SUMMARY"


rm -f "$CONTENT_FILE" "$RESPONSE_FILE"
rm -f "$RESPONSE_FILE"