taskinfo CLI and webUI info message why output is not in the list

Fixes: https://pagure.io/koji/issue/4074
This commit is contained in:
Jana Cupova 2024-04-10 12:57:36 +02:00 committed by Tomas Kopecek
parent bf6f1f4a16
commit 3725053b33
3 changed files with 30 additions and 2 deletions

View file

@ -4845,14 +4845,21 @@ def _printTaskInfo(session, task_id, topdir, level=0, recurse=True, verbose=True
for root in buildroot_infos: for root in buildroot_infos:
print("%s %s/%s-%d-%d/" % print("%s %s/%s-%d-%d/" %
(indent, BUILDDIR, root['tag_name'], root['id'], root['repo_id'])) (indent, BUILDDIR, root['tag_name'], root['id'], root['repo_id']))
print("%sLog Files:" % indent)
if logs: if logs:
print("%sLog Files:" % indent)
for log_path in logs: for log_path in logs:
print("%s %s" % (indent, log_path)) print("%s %s" % (indent, log_path))
else:
print("%s No outputs reported [1]" % indent)
print("%sOutput:" % indent)
if output: if output:
print("%sOutput:" % indent)
for file_path in output: for file_path in output:
print("%s %s" % (indent, file_path)) print("%s %s" % (indent, file_path))
else:
print("%s No outputs reported [1]" % indent)
if not logs or not output:
print("%s[1] Not all tasks produce outputs, and task outputs are not retained "
"indefinitely." % indent)
# white space # white space
print('') print('')

View file

@ -407,6 +407,11 @@ State: closed
Created: Thu Jan 1 00:16:40 1970 Created: Thu Jan 1 00:16:40 1970
Started: Thu Jan 1 00:33:20 1970 Started: Thu Jan 1 00:33:20 1970
Finished: Thu Jan 1 00:50:00 1970 Finished: Thu Jan 1 00:50:00 1970
Log Files:
No outputs reported [1]
Output:
No outputs reported [1]
[1] Not all tasks produce outputs, and task outputs are not retained indefinitely.
Task: 2 Task: 2
Type: createrepo Type: createrepo
@ -421,6 +426,9 @@ Finished: Thu Jan 1 00:50:00 1970
Log Files: Log Files:
%s %s
%s %s
Output:
No outputs reported [1]
[1] Not all tasks produce outputs, and task outputs are not retained indefinitely.
""" % tuple('/mnt/koji/work/tasks/2/2/' + k for k in task_output.keys()) """ % tuple('/mnt/koji/work/tasks/2/2/' + k for k in task_output.keys())
@ -520,6 +528,11 @@ Started: Thu Jan 1 00:33:20 1970
Finished: Thu Jan 1 00:50:00 1970 Finished: Thu Jan 1 00:50:00 1970
Host: kojibuilder Host: kojibuilder
Build: bash-4.4.12-5.fc26 (1) Build: bash-4.4.12-5.fc26 (1)
Log Files:
No outputs reported [1]
Output:
No outputs reported [1]
[1] Not all tasks produce outputs, and task outputs are not retained indefinitely.
Task: 2 Task: 2
Type: buildArch Type: buildArch
@ -562,6 +575,11 @@ Build: bash-4.4.12-5.fc26 (1)
Started: Thu Jan 1 00:33:20 1970 Started: Thu Jan 1 00:33:20 1970
Finished: Thu Jan 1 00:50:00 1970 Finished: Thu Jan 1 00:50:00 1970
Host: kojibuilder Host: kojibuilder
Log Files:
No outputs reported [1]
Output:
No outputs reported [1]
[1] Not all tasks produce outputs, and task outputs are not retained indefinitely.
""" """
with mock.patch('sys.stdout', new_callable=six.StringIO) as stdout: with mock.patch('sys.stdout', new_callable=six.StringIO) as stdout:

View file

@ -269,6 +269,9 @@ $value
#end if #end if
<br/> <br/>
#end for #end for
#if not $output
<div title="Not all tasks produce outputs, and task outputs are not retained indefinitely.">No outputs reported</div>
#end if
#if $task.state not in ($koji.TASK_STATES.CLOSED, $koji.TASK_STATES.CANCELED, $koji.TASK_STATES.FAILED) and \ #if $task.state not in ($koji.TASK_STATES.CLOSED, $koji.TASK_STATES.CANCELED, $koji.TASK_STATES.FAILED) and \
$task.method in ('buildSRPMFromSCM', 'buildArch', 'createLiveMedia', 'buildMaven', 'wrapperRPM', 'vmExec', 'createrepo', 'runroot', 'createAppliance', 'createLiveCD') $task.method in ('buildSRPMFromSCM', 'buildArch', 'createLiveMedia', 'buildMaven', 'wrapperRPM', 'vmExec', 'createrepo', 'runroot', 'createAppliance', 'createLiveCD')
<br/> <br/>