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/04/29 11:09:25 UTC

[GitHub] [arrow] raulcd opened a new pull request, #13031: ARROW-16357: [Archery][Dev] Add possibility to send nightly reports to Zulip/Slack

raulcd opened a new pull request, #13031:
URL: https://github.com/apache/arrow/pull/13031

   This PR adds the possibility to send the reports via a webhook to Zulip / Slack.
   
   Usage example:
   ```
   $ archery crossbow -t $GITHUB_TOKEN report-chat --webhook $SLACK_OR_ZULIP_WEBHOOK_URL --send --no-fetch $JOB_NAME
   ```
   The integration has been tested both in Zulip:
   ![image](https://user-images.githubusercontent.com/639755/165933376-4d15db5a-b506-497b-953d-2bb038a3e396.png)
   
   And Slack:
   ![image](https://user-images.githubusercontent.com/639755/165933320-33da69b8-bbbb-4e93-9bee-9ae548ca80d2.png)
   


-- 
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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
raulcd commented on code in PR #13031:
URL: https://github.com/apache/arrow/pull/13031#discussion_r863880514


##########
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:
   Thanks @kszucs ! I have created [ARROW-16448](https://issues.apache.org/jira/browse/ARROW-16448) to move EmailReport to be a JinjaReport.



-- 
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


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

Posted by GitBox <gi...@apache.org>.
kszucs commented on code in PR #13031:
URL: https://github.com/apache/arrow/pull/13031#discussion_r863698975


##########
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:
   Why do you need to pass a report instance to another report subclass? Could we use `ChatNightlyReport(job=job)` instead?



-- 
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


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

Posted by GitBox <gi...@apache.org>.
kszucs commented on code in PR #13031:
URL: https://github.com/apache/arrow/pull/13031#discussion_r863860306


##########
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).
   
   Indeed, it makes sense now. 
   
   > My idea was to refactor on another ticket the existing EmailReport to be also a JinjaReport and make archery.crossbow.reports.Report 
   
   That sounds great!
   
   > 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.
   
   I don't have a strong preference here, we can merge it as is. 



-- 
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


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

Posted by GitBox <gi...@apache.org>.
kszucs commented on code in PR #13031:
URL: https://github.com/apache/arrow/pull/13031#discussion_r863697021


##########
dev/archery/archery/crossbow/cli.py:
##########
@@ -21,7 +21,8 @@
 import click
 
 from .core import Config, Repo, Queue, Target, Job, CrossbowError
-from .reports import EmailReport, ConsoleReport
+from .reports import (ChatNightlyReport, Report, ReportUtils, ConsoleReport,

Review Comment:
   How about simply `ChatReport`?



-- 
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


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

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #13031:
URL: https://github.com/apache/arrow/pull/13031#issuecomment-1120241402

   Benchmark runs are scheduled for baseline = 3a701b292bcf79c46ee4138098533ca5837c52ca and contender = 11890feb95378991c9438ec4773b3dd928599494. 11890feb95378991c9438ec4773b3dd928599494 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/078db7ce5d5e4f8fb808c4423b41779d...d56955019392467395830d43810345f5/)
   [Finished :arrow_down:0.51% :arrow_up:0.12%] [test-mac-arm](https://conbench.ursa.dev/compare/runs/b1fc3eb1960f4a08bb5732d458b22d0e...3bf8b02b2d4242aabf9424846866b29d/)
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/522f763aa81d44c3b59d3bbe1619dfa3...ed3210eb337343b3a63e5df82fdcf2ab/)
   [Finished :arrow_down:0.04% :arrow_up:0.0%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/3792d9956e81452eb44d3cd3d51219ee...d10fa31525e540bd88fcee7a94017ee7/)
   Buildkite builds:
   [Finished] [`11890feb` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/691)
   [Finished] [`11890feb` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/688)
   [Finished] [`11890feb` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/677)
   [Finished] [`11890feb` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/693)
   [Finished] [`3a701b29` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/690)
   [Finished] [`3a701b29` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/687)
   [Finished] [`3a701b29` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/676)
   [Finished] [`3a701b29` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/692)
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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


[GitHub] [arrow] kszucs closed pull request #13031: ARROW-16357: [Archery][Dev] Add possibility to send nightly reports to Zulip/Slack

Posted by GitBox <gi...@apache.org>.
kszucs closed pull request #13031: ARROW-16357: [Archery][Dev] Add possibility to send nightly reports to Zulip/Slack
URL: https://github.com/apache/arrow/pull/13031


-- 
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


[GitHub] [arrow] github-actions[bot] commented on pull request #13031: ARROW-16357: [Archery][Dev] Add possibility to send nightly reports to Zulip/Slack

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #13031:
URL: https://github.com/apache/arrow/pull/13031#issuecomment-1113181973

   https://issues.apache.org/jira/browse/ARROW-16357


-- 
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