You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/03 12:51:38 UTC

[GitHub] [arrow] raulcd commented on a diff in pull request #13031: ARROW-16357: [Archery][Dev] Add possibility to send nightly reports to Zulip/Slack

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)
 
 
+@crossbow.command()
+@click.argument('job-name', required=True)
+@click.option('--send/--dry-run', default=False,
+              help='Just display the report, don\'t send it')
+@click.option('--webhook', '-w',
+              help='Zulip/Slack Webhook address to send the report to')
+@click.option('--fetch/--no-fetch', default=True,
+              help='Fetch references (branches and tags) from the remote')
+@click.pass_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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org