Self-heal the PR Build check when the notify workflow fails to create it

XMLWordPrintableJSON

      Problem

      A PR's overall CI status on apache/spark is driven by a single check named "Build". That check is created only by notify_test_workflow.yml, which runs once per push via pull_request_target. The scheduled update_build_status.yml job (every 15 min) only updates an already-existing "Build" check.

      If that one-shot notify job never completes, the "Build" check is never created, the scheduled updater has nothing to act on, and the PR is left with no Build status (mergeable_state: unstable, combined status: pending) and no automatic recovery. The only workaround is for the author to manually re-fire a pull_request_target event (push a new commit, or close/reopen the PR).

      The most common trigger is runner starvation: apache/spark shares the ASF's limited GitHub Actions capacity, so the notify pull_request_target job can sit queued without ever being assigned a runner and then get auto-cancelled. In that state the job has an empty runner name, zero executed steps, and an empty log archive.

      Example

      PR #57708, head commit b3d29d1. All 33 test check-runs on the fork are green, but the apache-side "Notify test workflow" run (31119650844) sat ~45 minutes and was cancelled with no steps run, so no "Build" check was ever created. The PR is stuck at unstable/pending. Re-running CI in the fork does not help: it only re-runs the fork's already-green build and does not re-fire notify_test_workflow.yml, and a cancelled apache-side run cannot be re-run by the PR author.

      Root cause

      Check creation is a single point of failure (notify, one attempt, no retry, no backfill), while only updates are on a resilient schedule.

      Fix

      Make the scheduled update_build_status.yml self-healing. While scanning a PR's checks it now records whether any "Build" check exists; when none does, it backfills one from the forked repo's build_main.yml run for the head SHA, mirroring notify_test_workflow.yml. The next scheduled pass then syncs it like any other Build check. Recovery becomes automatic within <=15 minutes for every PR, with no manual retrigger. notify_test_workflow.yml remains the fast path (check appears in seconds on a healthy push); the scheduler is the safety net.

            Assignee:
            Ganesha S
            Reporter:
            Ganesha S
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: