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/20 10:19:12 UTC

[arrow] branch master updated: ARROW-16252: [CI][Archery] Highlight number of failed builds on nightly reports

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 c38a32ef59 ARROW-16252: [CI][Archery] Highlight number of failed builds on nightly reports
c38a32ef59 is described below

commit c38a32ef59e2f12c111614838bd3014d0adc6a91
Author: Raúl Cumplido <ra...@gmail.com>
AuthorDate: Wed Apr 20 12:19:04 2022 +0200

    ARROW-16252: [CI][Archery] Highlight number of failed builds on nightly reports
    
    This PR adds to the reports email subject the number of tasks that are pending and have failied.
    Tested locally with a reduced number of tasks:
    ```bash
    $ archery crossbow report --no-fetch nightly-packaging-2022-04-14-0
    From: None <None>
    To: None
    Subject: [NIGHTLY] Arrow Build Report for Job nightly-packaging-2022-04-14-0: 2 failed, 0 pending
    
    Arrow Build Report for Job nightly-packaging-2022-04-14-0
    
    All tasks: https://github.com/raulcd/crossbow/branches/all?query=nightly-packaging-2022-04-14-0
    
    Errored Tasks:
    - debian-bookworm-arm64:
      URL: https://github.com/raulcd/crossbow/tree/nightly-packaging-2022-04-14-0-travis-debian-bookworm-arm64
    - wheel-windows-cp310-amd64:
      URL: https://github.com/raulcd/crossbow/tree/nightly-packaging-2022-04-14-0-github-wheel-windows-cp310-amd64
    ```
    
    Closes #12934 from raulcd/ARROW-16252
    
    Authored-by: Raúl Cumplido <ra...@gmail.com>
    Signed-off-by: Krisztián Szűcs <sz...@gmail.com>
---
 dev/archery/archery/crossbow/reports.py | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/dev/archery/archery/crossbow/reports.py b/dev/archery/archery/crossbow/reports.py
index 00aef3eb8a..f0cbd8e657 100644
--- a/dev/archery/archery/crossbow/reports.py
+++ b/dev/archery/archery/crossbow/reports.py
@@ -194,22 +194,30 @@ class EmailReport(Report):
         return self.HEADER.format(job_name=self.job.branch, all_tasks_url=url)
 
     def subject(self):
+        failures = len(self.tasks_by_state.get("failure", []))
+        errors = len(self.tasks_by_state.get("error", []))
+        pending = len(self.tasks_by_state.get("pending", []))
         return (
-            "[NIGHTLY] Arrow Build Report for Job {}".format(self.job.branch)
+            f"[NIGHTLY] Arrow Build Report for Job {self.job.branch}: "
+            f"{failures+errors} failed, {pending} pending"
         )
 
-    def body(self):
-        buffer = StringIO()
-        buffer.write(self.header())
-
+    @property
+    @functools.lru_cache(maxsize=1)
+    def tasks_by_state(self):
         tasks_by_state = collections.defaultdict(dict)
         for task_name, task in self.job.tasks.items():
             state = task.status().combined_state
             tasks_by_state[state][task_name] = task
+        return tasks_by_state
+
+    def body(self):
+        buffer = StringIO()
+        buffer.write(self.header())
 
         for state in ('failure', 'error', 'pending', 'success'):
-            if state in tasks_by_state:
-                tasks = tasks_by_state[state]
+            if state in self.tasks_by_state:
+                tasks = self.tasks_by_state[state]
                 buffer.write('\n')
                 buffer.write(self.STATUS_HEADERS[state])
                 buffer.write('\n')