From 2a424b1b7c5600cce15e829e3b9d898e6a3d3d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Sun, 16 Oct 2022 17:36:35 +0200 Subject: [PATCH 1/3] Only wait if link is not present already --- dev/archery/archery/crossbow/reports.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/archery/archery/crossbow/reports.py b/dev/archery/archery/crossbow/reports.py index 2c8a0f0375c7e..43690a24b0be3 100644 --- a/dev/archery/archery/crossbow/reports.py +++ b/dev/archery/archery/crossbow/reports.py @@ -68,7 +68,9 @@ def branch_url(self, branch): return '{}/tree/{}'.format(self.repo_url, branch) def task_url(self, task): - if self._wait_for_task: + # Only wait if the link to the actual build is not present. + if not task.status().build_links and self._wait_for_task: + print("Waiting for task") time.sleep(self._wait_for_task) if task.status().build_links: # show link to the actual build, some CI providers implement From a7a9c987940e09b2054ec73bc913602ed7abde17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Sun, 16 Oct 2022 18:18:54 +0200 Subject: [PATCH 2/3] Remove unnecessary log --- dev/archery/archery/crossbow/reports.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/archery/archery/crossbow/reports.py b/dev/archery/archery/crossbow/reports.py index 43690a24b0be3..41c48455c5656 100644 --- a/dev/archery/archery/crossbow/reports.py +++ b/dev/archery/archery/crossbow/reports.py @@ -70,7 +70,6 @@ def branch_url(self, branch): def task_url(self, task): # Only wait if the link to the actual build is not present. if not task.status().build_links and self._wait_for_task: - print("Waiting for task") time.sleep(self._wait_for_task) if task.status().build_links: # show link to the actual build, some CI providers implement From 54a3d213977a80c05c25ac670f44e70a887cc6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Mon, 17 Oct 2022 11:53:04 +0200 Subject: [PATCH 3/3] Refresh build links after waiting otherwise it would be empty and would use the branch URL --- dev/archery/archery/crossbow/reports.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dev/archery/archery/crossbow/reports.py b/dev/archery/archery/crossbow/reports.py index 41c48455c5656..4aaca03ad4361 100644 --- a/dev/archery/archery/crossbow/reports.py +++ b/dev/archery/archery/crossbow/reports.py @@ -68,13 +68,16 @@ def branch_url(self, branch): return '{}/tree/{}'.format(self.repo_url, branch) def task_url(self, task): - # Only wait if the link to the actual build is not present. - if not task.status().build_links and self._wait_for_task: + build_links = task.status().build_links + # Only wait if the link to the actual build is not present + # and refresh task status. + if not build_links and self._wait_for_task: time.sleep(self._wait_for_task) - if task.status().build_links: + build_links = task.status(force_query=True).build_links + if build_links: # show link to the actual build, some CI providers implement # the statuses API others implement the checks API, retrieve any. - return task.status().build_links[0] + return build_links[0] else: # show link to the branch if no status build link was found. return self.branch_url(task.branch)