ganeshashree opened a new pull request, #57867:
URL: https://github.com/apache/spark/pull/57867

   ### What changes were proposed in this pull request?
   
   The PR "Build" status check is created by `notify_test_workflow.yml`, which 
runs once per push. This PR makes the scheduled `update_build_status.yml` job 
self-healing: when a PR has no "Build" check on its head commit, it now 
recreates one instead of only updating existing checks.
   
   It looks up the fork's `build_main.yml` runs filtered by the head SHA 
(re-polling briefly to ride out registration lag):
   
   - a run exists -> backfill a `queued` "Build" check that a later pass syncs, 
 mirroring `notify_test_workflow.yml`;
   - no run (Actions disabled, old-master branch, or `build_main.yml` missing) 
-> create the same `action_required` check with contributor instructions that 
`notify_test_workflow.yml` creates.
   
   Transient lookup failures (5xx, network, or 403/429 rate limits) are retried 
on a later scheduled pass rather than reported as a fork misconfiguration. 
Deleted head repos and existing "Build" checks are left untouched.
   
   ### Why are the changes needed?
   
   `notify_test_workflow.yml` is the only place that *creates* the "Build" 
check, and it is a single one-shot `pull_request_target` job with no retry. 
When it fails to complete -- most commonly when it is starved of an ASF shared 
runner and cancelled before running any step -- the check is never created, the 
scheduled updater has nothing to update, and the PR is stuck at 
`mergeable_state: unstable` with no required status and no automatic recovery.
   The only workaround today is for the author to manually re-fire a 
`pull_request_target` event (push a new commit, or close and reopen the PR).
   
   Example: PR apache/spark#57708 (head `b3d29d1`). All fork test checks were 
green, but the apache-side "Notify test workflow" run sat ~45 minutes and was 
cancelled with zero steps executed, so no "Build" check was ever created and 
the PR stayed pending indefinitely.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This only affects the CI infrastructure workflow that maintains the PR 
"Build" status check.
   
   ### How was this patch tested?
   
   This is a scheduled `pull_request_target` workflow and cannot run in PR CI, 
so it was validated locally:
   
   - YAML parses and the embedded `actions/github-script` body passes `node 
--check`.
   - The recreation decision logic was exercised with a standalone simulation 
covering every branch: run present, empty-then-run-appears (registration lag), 
Actions disabled / empty result, 404 workflow missing, permanent 403/451, 
rate-limit 403 (retry-after / `x-ratelimit-remaining: 0` / secondary-limit 
message), 429, 5xx, and network errors -- each resolving to backfill / 
action_required / retry as expected.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to