Skip to content

A platform for community discussion. Free, open, simple.

DEV: Inline flaky-test notification in merge workflow (#43435)

Alan Guo Xiang Tan5a7684d97134
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 2a5b777f073..46685ebacfa 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -410,4 +410,30 @@ jobs:
PATCH_TRIAGE_FLAKY_TEST_REPORT_SECRET: ${{ secrets.PATCH_TRIAGE_FLAKY_TEST_REPORT_SECRET }}
REPORT_ARTIFACT_ID: ${{ steps.merge-flaky-test-reports.outputs.artifact-id }}
SCREENSHOT_ARTIFACT_ID: ${{ steps.merge-failed-system-test-artifacts.outputs.artifact-id }}
- run: script/notify_patch_triage_of_flaky_tests
+ run: |
+ set -euo pipefail
+
+ if [[ -z "$PATCH_TRIAGE_FLAKY_TEST_REPORT_URL" || -z "$PATCH_TRIAGE_FLAKY_TEST_REPORT_SECRET" ]]; then
+ echo "::warning::Patch Triage flaky-test delivery secrets are not configured; skipping notification"
+ exit 0
+ fi
+
+ payload=$(jq -nc '
+ {
+ repository: env.GITHUB_REPOSITORY,
+ workflow_run_id: (env.GITHUB_RUN_ID | tonumber),
+ run_attempt: (env.GITHUB_RUN_ATTEMPT | tonumber),
+ report_artifact_id: (env.REPORT_ARTIFACT_ID | tonumber)
+ } + if env.SCREENSHOT_ARTIFACT_ID == "" then {} else {
+ screenshot_artifact_id: (env.SCREENSHOT_ARTIFACT_ID | tonumber)
+ } end')
+
+ curl --fail-with-body \
+ --retry 3 \
+ --retry-all-errors \
+ --connect-timeout 5 \
+ --max-time 30 \
+ --header "Content-Type: application/json" \
+ --header "Authorization: Bearer $PATCH_TRIAGE_FLAKY_TEST_REPORT_SECRET" \
+ --data-binary "$payload" \
+ "$PATCH_TRIAGE_FLAKY_TEST_REPORT_URL"
diff --git a/script/notify_patch_triage_of_flaky_tests b/script/notify_patch_triage_of_flaky_tests
deleted file mode 100755
index 7ce19ce671f..00000000000
--- a/script/notify_patch_triage_of_flaky_tests
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-if [[ -z "${PATCH_TRIAGE_FLAKY_TEST_REPORT_URL:-}" || -z "${PATCH_TRIAGE_FLAKY_TEST_REPORT_SECRET:-}" ]]; then
- echo "::warning::Patch Triage flaky-test delivery secrets are not configured; skipping notification"
- exit 0
-fi
-
-payload=$(jq -nc \
- --arg repository "$GITHUB_REPOSITORY" \
- --argjson workflow_run_id "$GITHUB_RUN_ID" \
- --argjson run_attempt "$GITHUB_RUN_ATTEMPT" \
- --argjson report_artifact_id "$REPORT_ARTIFACT_ID" \
- --arg screenshot_artifact_id "${SCREENSHOT_ARTIFACT_ID:-}" \
- '{
- repository: $repository,
- workflow_run_id: $workflow_run_id,
- run_attempt: $run_attempt,
- report_artifact_id: $report_artifact_id
- } + if $screenshot_artifact_id == "" then {} else {
- screenshot_artifact_id: ($screenshot_artifact_id | tonumber)
- } end')
-
-curl --fail-with-body \
- --retry 3 \
- --retry-all-errors \
- --connect-timeout 5 \
- --max-time 30 \
- --header "Content-Type: application/json" \
- --header "Authorization: Bearer $PATCH_TRIAGE_FLAKY_TEST_REPORT_SECRET" \
- --data-binary "$payload" \
- "$PATCH_TRIAGE_FLAKY_TEST_REPORT_URL"