Skip to content

Commit a01b98f

Browse files
raulcdkou
andauthored
GH-47767: [CI] Add date to extra CI report email subject (#47777)
### Rationale for this change We always use "[NIGHTLY] Arrow Build Report for C++ Extra: N failed" like subject for extra CI report emails. It seems that lists.apache.org puts the same subject emails (even if they don't have References:/In-Reply-To: headers) to the same thread: https://lists.apache.org/thread/rjby1r7n5pw8l96pl1hbqsk29btbtbz4 ### What changes are included in this PR? Add date of when the workflow started to subject email. ### Are these changes tested? Yes, locally from an old workflow run: ``` $ archery ci report-email --dry-run ... --ignore report-extra-cpp --repository raulcd/arrow 17676897217 From: Arrow <arrow@ commit-email.info> To: builds@ arrow.apache.org Subject: [12/09/2025] Arrow Build Report for C++ Extra: 0 failed Arrow Build Report for C++ Extra Workflow URL: https://github.com/raulcd/arrow/actions/runs/17676897217 ``` ### Are there any user-facing changes? No * GitHub Issue: #47767 Lead-authored-by: Raúl Cumplido <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Raúl Cumplido <[email protected]>
1 parent c6ef0fe commit a01b98f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

dev/archery/archery/ci/core.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
from datetime import datetime
1819
from functools import cached_property
1920

2021
import requests
@@ -43,6 +44,12 @@ def __init__(self, workflow_id, repository, ignore_job, gh_token=None):
4344
raise Exception(
4445
f'Failed to fetch workflow data: {workflow_resp.status_code}')
4546

47+
@property
48+
def datetime(self):
49+
return datetime.strptime(
50+
self.workflow_data.get('created_at'), "%Y-%m-%dT%H:%M:%SZ"
51+
)
52+
4653
@property
4754
def conclusion(self):
4855
return self.workflow_data.get('conclusion')

dev/archery/archery/templates/email_workflow_report.txt.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{%- endif -%}
2121
From: {{ sender_name }} <{{ sender_email }}>
2222
To: {{ recipient_email }}
23-
Subject: [NIGHTLY] Arrow Build Report for {{ report.name }}: {{ report.failed_jobs() | length }} failed
23+
Subject: [{{ report.datetime.strftime('%Y-%m-%d') }}] Arrow Build Report for {{ report.name }}: {{ report.failed_jobs() | length }} failed
2424

2525
Arrow Build Report for {{ report.name }}
2626

0 commit comments

Comments
 (0)