add estimated completion time for build tasks to the taskinfo page
This commit is contained in:
parent
41580648e8
commit
ebd75bf0de
2 changed files with 19 additions and 2 deletions
|
|
@ -500,9 +500,18 @@ def taskinfo(req, taskID):
|
|||
|
||||
builds = server.listBuilds(taskID=task['id'])
|
||||
if builds:
|
||||
values['taskBuild'] = builds[0]
|
||||
taskBuild = builds[0]
|
||||
else:
|
||||
values['taskBuild'] = None
|
||||
taskBuild = None
|
||||
values['taskBuild'] = taskBuild
|
||||
|
||||
values['estCompletion'] = None
|
||||
if taskBuild and taskBuild['state'] == koji.BUILD_STATES['BUILDING']:
|
||||
avgDuration = server.getAverageBuildDuration(taskBuild['package_id'])
|
||||
if avgDuration != None:
|
||||
avgDelta = datetime.timedelta(seconds=avgDuration)
|
||||
startTime = datetime.datetime.fromtimestamp(taskBuild['creation_ts'])
|
||||
values['estCompletion'] = startTime + avgDelta
|
||||
|
||||
buildroots = server.listBuildroots(taskID=task['id'])
|
||||
values['buildroots'] = buildroots
|
||||
|
|
|
|||
|
|
@ -199,9 +199,17 @@
|
|||
<tr>
|
||||
<th>Created</th><td>$util.formatTimeLong($task.create_time)</td>
|
||||
</tr>
|
||||
#if $task.state == $koji.TASK_STATES.OPEN
|
||||
#if $estCompletion
|
||||
<tr>
|
||||
<th>Est. Completion</th><td>$util.formatTimeLong($estCompletion)</td>
|
||||
</tr>
|
||||
#end if
|
||||
#elif $task.completion_time
|
||||
<tr>
|
||||
<th>Completed</th><td>$util.formatTimeLong($task.completion_time)</td>
|
||||
</tr>
|
||||
#end if
|
||||
<tr>
|
||||
<th>Owner</th>
|
||||
<td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue