nchammas commented on code in PR #60305:
URL: https://github.com/apache/spark/pull/60305#discussion_r4555274427


##########
.github/workflows/update_build_status.js:
##########
@@ -264,20 +333,31 @@ module.exports = async ({github, context, core, env = 
process.env, log = console
         if (!run) {
           if (runId && pr.forkRunsTruncated) {
             // The run may be among the fork's check suites the page left out. 
Keep
-            // the backfill from replacing the check, and fail the PR to get 
noticed.
+            // the check below from replacing it, and fail the PR to get 
noticed.
             log.error(ref + ': fork run ' + runId + ' not in the first fork 
check '
               + 'suites; raise the limits in prPageQuery')
             failedPRs.add(pr.number)
             syncableBuildCheck = true
+            unlistedRun = true
           }
           // Otherwise the check's output is unusable or its fork run was 
deleted, so
-          // it can never be synced; the backfill below replaces it.
+          // it can never be synced; a check for the tracked run replaces it 
below.
           continue
         }
         syncableBuildCheck = true
 
-        // Leave a check alone if it already shows the run's state, as nearly 
all do.
         const state = checkState(run)
+        const tracked = run.id == trackedRun?.id
+        // The run was rerun after its check completed. GitHub accepts an 
update that
+        // reopens a completed check but leaves it unchanged, so leave it 
alone. The
+        // tracked run gets a new check below unless another check already 
shows it.
+        if (cr.status == 'completed' && state.status != 'completed') {
+          trackedRunReran ||= tracked
+          count.unchanged++
+          continue
+        }
+        trackedRunShown ||= tracked
+        // Leave a check alone if it already shows the run's state, as nearly 
all do.
         if (sameState(cr, state)) {

Review Comment:
   Implemented the fallback, but we'll have to see how GitHub handles this in 
practice.



-- 
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