pr-states: dispatch from pr-test* notify job (fix rerun status) (#25812)

This commit is contained in:
Liangsheng Yin
2026-05-19 15:57:16 -07:00
committed by GitHub
parent b9d470f4a2
commit 3ef832f885
3 changed files with 130 additions and 12 deletions
+64
View File
@@ -221,3 +221,67 @@ jobs:
partitions: ${{ needs.check-changes.outputs.partitions }}
run_timeout_minutes: '60'
secrets: inherit
# =============================================== aggregator ====================================================
# Mirrors pr-test.yml's `pr-test-finish` so notify-pr-states below only
# depends on one job rather than re-listing every stage. Fails if any
# dependent failed/cancelled.
pr-test-extra-finish:
needs:
[
check-changes,
call-gate,
sgl-kernel-build-wheels,
extra-a-test-1-gpu-small,
extra-a-test-1-gpu-large,
extra-a-test-2-gpu-large,
extra-b-test-4-gpu-h100,
extra-b-test-4-gpu-b200,
extra-b-test-8-gpu-h200,
extra-b-test-deepep-8-gpu-h200,
]
if: always()
runs-on: ubuntu-latest
steps:
- name: Check all dependent job statuses
run: |
json_needs='${{ toJson(needs) }}'
job_names=$(echo "$json_needs" | jq -r 'keys_unsorted[]')
for job in $job_names; do
result=$(echo "$json_needs" | jq -r --arg j "$job" '.[$j].result')
echo "$job: $result"
if [[ "$result" == "failure" || "$result" == "cancelled" ]]; then
echo "The above jobs failed."
exit 1
fi
done
echo "All jobs completed successfully"
exit 0
# =============================================== notify pr-states ====================================================
# Dispatches pr-states.yml after every attempt (initial + every rerun).
# workflow_run.completed only fires on the initial completion (one
# workflow_run record across attempts), so we explicitly dispatch —
# workflow_dispatch is the only event GITHUB_TOKEN can cascade-create.
#
# Fork PRs are excluded: their pull_request GITHUB_TOKEN is forced
# read-only regardless of declared `actions: write`, so dispatch 403s.
# Fork PRs get pr-states updates via the workflow_run subscription
# there (initial completion) and pull_request_target (push / label).
notify-pr-states:
needs: [pr-test-extra-finish]
if: |
always() &&
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Dispatch pr-states refresh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
gh workflow run pr-states.yml \
--repo ${{ github.repository }} \
--ref main \
-f pr_number="$PR_NUMBER"