This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 14e12c6  [SPARK-35575][INFRA] Recover updating build status in GitHub 
Actions
14e12c6 is described below

commit 14e12c64d35ae488cc6ce4d1c53e519f29a74d45
Author: Hyukjin Kwon <gurwls...@apache.org>
AuthorDate: Mon May 31 19:29:54 2021 +0900

    [SPARK-35575][INFRA] Recover updating build status in GitHub Actions
    
    ### What changes were proposed in this pull request?
    
    This PR fixes the logic to be fault tolerant when it gets the status of the 
workflow run from PR author's forked repository.
    
    Looks like https://github.com/apache/spark/pull/32483 removed and disabled 
(see also 
https://github.com/apache/spark/pull/32486/checks?check_run_id=2648696751) the 
GitHub actions workflow runs in the forked repositories, and the detection 
logic in the main repo fails because the runs don't exist anymore.
    
    See also 
https://github.com/apache/spark/runs/2709537998?check_suite_focus=true
    
    ### Why are the changes needed?
    
    To recover the status update of GitHub Actions in PRs.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, dev-only.
    
    ### How was this patch tested?
    
    It cannot be tested without being merged.
    
    Closes #32711 from HyukjinKwon/SPARK-35575.
    
    Authored-by: Hyukjin Kwon <gurwls...@apache.org>
    Signed-off-by: Hyukjin Kwon <gurwls...@apache.org>
---
 .github/workflows/update_build_status.yml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/update_build_status.yml 
b/.github/workflows/update_build_status.yml
index 16fbe3a..a695870 100644
--- a/.github/workflows/update_build_status.yml
+++ b/.github/workflows/update_build_status.yml
@@ -63,7 +63,15 @@ jobs:
                       const params = JSON.parse(cr.output.text)
 
                       // Get the workflow run in the forked repository
-                      const run = await github.request('GET 
/repos/{owner}/{repo}/actions/runs/{run_id}', params)
+                      let run
+                      try {
+                        run = await github.request('GET 
/repos/{owner}/{repo}/actions/runs/{run_id}', params)
+                      } catch (error) {
+                        console.error(error)
+                        // Run not found. This can happen when the PR author 
removes GitHub Actions runs or
+                        // disalbes GitHub Actions.
+                        continue
+                      }
 
                       // Keep syncing the status of the checks
                       if (run.data.status == 'completed') {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to