Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dev/archery/archery/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,10 @@ def _clone_arrow_and_crossbow(dest, crossbow_repo, pull_request):
help='Additional task parameters for rendering the CI templates')
@click.option('--arrow-version', '-v', default=None,
help='Set target version explicitly.')
@click.option('--wait', default=60,
help='Wait the specified seconds before generating a report.')
@click.pass_obj
def submit(obj, tasks, groups, params, arrow_version):
def submit(obj, tasks, groups, params, arrow_version, wait):
"""
Submit crossbow testing tasks.

Expand Down Expand Up @@ -270,7 +272,8 @@ def submit(obj, tasks, groups, params, arrow_version):
queue.push()

# render the response comment's content
report = CommentReport(job, crossbow_repo=crossbow_repo)
report = CommentReport(job, crossbow_repo=crossbow_repo,
wait_for_task=wait)

# send the response
pull_request.create_issue_comment(report.show())
10 changes: 7 additions & 3 deletions dev/archery/archery/crossbow/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import operator
import fnmatch
import functools
import time

import click
import requests
Expand All @@ -41,7 +42,7 @@ class Report:
"arrow_commit",
]

def __init__(self, job, task_filters=None):
def __init__(self, job, task_filters=None, wait_for_task=None):
self.job = job

tasks = sorted(job.tasks.items())
Expand All @@ -53,6 +54,7 @@ def __init__(self, job, task_filters=None):
tasks = [(name, task) for name, task in tasks if name in filtered]

self._tasks = dict(tasks)
self._wait_for_task = wait_for_task

@property
def repo_url(self):
Expand All @@ -66,6 +68,8 @@ def branch_url(self, branch):
return '{}/tree/{}'.format(self.repo_url, branch)

def task_url(self, task):
if self._wait_for_task:
time.sleep(self._wait_for_task)
if task.status().build_links:
# show link to the actual build, some CI providers implement
# the statuses API others implement the checks API, retrieve any.
Expand Down Expand Up @@ -307,9 +311,9 @@ class CommentReport(Report):
),
}

def __init__(self, job, crossbow_repo):
def __init__(self, job, crossbow_repo, wait_for_task=None):
self.crossbow_repo = crossbow_repo
super().__init__(job)
super().__init__(job, wait_for_task=wait_for_task)

def show(self):
url = 'https://github.com/{repo}/branches/all?query={branch}'
Expand Down