raulcd commented on code in PR #13031:
URL: https://github.com/apache/arrow/pull/13031#discussion_r863740364
##########
dev/archery/archery/crossbow/cli.py:
##########
@@ -302,6 +303,33 @@ def report(obj, job_name, sender_name, sender_email,
recipient_email,
report.show(output)
[email protected]()
[email protected]('job-name', required=True)
[email protected]('--send/--dry-run', default=False,
+ help='Just display the report, don\'t send it')
[email protected]('--webhook', '-w',
+ help='Zulip/Slack Webhook address to send the report to')
[email protected]('--fetch/--no-fetch', default=True,
+ help='Fetch references (branches and tags) from the remote')
[email protected]_obj
+def report_chat(obj, job_name, send, webhook, fetch):
+ """
+ Send a chat report to a webhook showing success/failure
+ of tasks in a Crossbow run.
+ """
+ output = obj['output']
+ queue = obj['queue']
+ if fetch:
+ queue.fetch()
+
+ job = queue.get(job_name)
+ report_chat = ChatNightlyReport(report=Report(job))
Review Comment:
`ChatNightlyReport` is not a subclass of `archery.crossbow.reports.Report`
but of `archery.utils.report.JinjaReport` which is of
`archery.utils.report.Report` (we have two `Report` classes).
My idea was to refactor on another ticket the existing `EmailReport` to be
also a `JinjaReport` and make `archery.crossbow.reports.Report` an utils class
with all the helper functions like:
```
task_url
repo_url
tasks_by_state
tasks
```
which can be used on the reports.
Basically I am using the existing infrastructure of the
`archery.crossbow.reports.Report` class as a utils class for the
`ChatNightlyReport` at the moment.
I did wanted to use a `JinjaReport` instead of having something more custom
like the current `EmailReport` as I think this is what we wanted to move
towards.
I did not wanted to refactor further as part of this ticket as the email
reports are not tested but let me know if you would prefer this to be done as
part of the ticket and I can try and add tests for that too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]