You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ks...@apache.org on 2022/04/27 13:46:24 UTC

[arrow] branch master updated: ARROW-16334: [Archery][CI] Use build links on nightly report emails instead of branch link

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 027920be05 ARROW-16334: [Archery][CI] Use build links on nightly report emails instead of branch link
027920be05 is described below

commit 027920be05198ee89e643b9e44e20fb477f97292
Author: Raúl Cumplido <ra...@gmail.com>
AuthorDate: Wed Apr 27 15:46:15 2022 +0200

    ARROW-16334: [Archery][CI] Use build links on nightly report emails instead of branch link
    
    This PR aims to improve the nightly build reporting by changing the link that appears on the report to point to the build instead of the branch. If the task contains a build link it will be shown on the email report. Example of local test:
    ```bash
    $ archery crossbow report --no-fetch nightly-packaging-2022-04-25-0
    From: None <None>
    To: None
    Subject: [NIGHTLY] Arrow Build Report for Job nightly-packaging-2022-04-25-0: 0 failed, 0 pending
    
    Arrow Build Report for Job nightly-packaging-2022-04-25-0
    
    All tasks: https://github.com/ursacomputing/crossbow/branches/all?query=nightly-packaging-2022-04-25-0
    
    Succeeded Tasks:
    - conda-osx-clang-py310:
      URL: https://github.com/ursacomputing/crossbow/runs/6156745194
    - conda-osx-clang-py38:
      URL: https://github.com/ursacomputing/crossbow/runs/6157874092
    - wheel-macos-high-sierra-cp310-amd64:
      URL: https://github.com/ursacomputing/crossbow/runs/6155840346?check_suite_focus=true
    ```
    
    Closes #13010 from raulcd/ARROW-16334
    
    Authored-by: Raúl Cumplido <ra...@gmail.com>
    Signed-off-by: Krisztián Szűcs <sz...@gmail.com>
---
 dev/archery/archery/crossbow/reports.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/dev/archery/archery/crossbow/reports.py b/dev/archery/archery/crossbow/reports.py
index f0cbd8e657..79939a0e44 100644
--- a/dev/archery/archery/crossbow/reports.py
+++ b/dev/archery/archery/crossbow/reports.py
@@ -180,11 +180,22 @@ class EmailReport(Report):
     def branch_url(self, branch):
         return '{}/tree/{}'.format(self.repo_url, branch)
 
+    def task_url(self, task):
+        if task.status().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]
+        else:
+            # show link to the branch if no status build link was found.
+            return self.branch_url(task.branch)
+
     def listing(self, tasks):
         return '\n'.join(
             sorted(
                 self.TASK.format(
-                    name=task_name, url=self.branch_url(task.branch))
+                    name=task_name,
+                    url=self.task_url(task)
+                )
                 for task_name, task in tasks.items()
             )
         )