diff --git a/.github/prompts/sentry-release-health.txt b/.github/prompts/sentry-release-health.txt new file mode 100644 index 00000000..242ddc30 --- /dev/null +++ b/.github/prompts/sentry-release-health.txt @@ -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. \ No newline at end of file diff --git a/.github/workflows/llm-cloud-run.yml b/.github/workflows/llm-cloud-run.yml index 973b121f..499a5380 100644 --- a/.github/workflows/llm-cloud-run.yml +++ b/.github/workflows/llm-cloud-run.yml @@ -20,6 +20,7 @@ on: type: choice options: - multi-analyze.txt + - sentry-release-health.txt permissions: contents: read @@ -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: @@ -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}" @@ -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") { @@ -213,5 +223,4 @@ jobs: echo "$OUTPUT" } >> "$GITHUB_STEP_SUMMARY" - - rm -f "$CONTENT_FILE" "$RESPONSE_FILE" \ No newline at end of file + rm -f "$RESPONSE_FILE" \ No newline at end of file