#1488 Display params also for malformed tasks in webui
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue1484  into  master

file modified
+4
@@ -706,6 +706,10 @@ 

      else:

          values['perms'] = []

  

+     try:

+         values['params_parsed'] = _genHTML(environ, 'taskinfo_params.chtml')

+     except:

+         values['params_parsed'] = None

      return _genHTML(environ, 'taskinfo.chtml')

  

  def taskstatus(environ, taskID):

file modified
+6 -219
@@ -1,7 +1,6 @@ 

  #import koji

  #from kojiweb import util

  #from six.moves.urllib.parse import quote

- #import cgi

  #import datetime

  

  #def printValue($key, $value, $sep=', ')
@@ -76,224 +75,12 @@ 

      <tr>

        <th>Parameters</th>

        <td>

-         #if $task.method == 'buildSRPMFromSCM'

-         <strong>SCM URL:</strong> $params[0]<br/>

-         #if $len($params) > 1

-         <strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag">$buildTag</a><br/>

-         #end if

-         #if $len($params) > 2

-         $printOpts($params[2])

-         #end if

-         #elif $task.method == 'buildSRPMFromCVS'

-         <strong>CVS URL:</strong> $params[0]

-         #elif $task.method == 'buildArch'

-         <strong>SRPM:</strong> $params[0]<br/>

-         <strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag">$buildTag</a><br/>

-         <strong>Arch:</strong> $params[2]<br/>

-         <strong>Keep SRPM?</strong> #if $params[3] then 'yes' else 'no'#<br/>

-         #if $len($params) > 4

-         $printOpts($params[4])

-         #end if

-         #elif $task.method == 'tagBuild'

-         <strong>Destination Tag:</strong> <a href="taginfo?tagID=$destTag.id">$destTag.name</a><br/>

-         <strong>Build:</strong> <a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a>

-         #elif $task.method == 'buildNotification'

-         #set $build = $params[1]

-         #set $buildTarget = $params[2]

-         <strong>Recipients:</strong>&nbsp;$printValue('', $params[0])<br/>

-         <strong>Build:</strong> <a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a><br/>

-         #if $buildTarget

-         <strong>Build Target:</strong> <a href="buildtargetinfo?targetID=$buildTarget.id">$buildTarget.name</a><br/>

-         #else

-         <strong>Build Target:</strong> (no build target)<br/>

-         #end if

-         <strong>Web URL:</strong> <a href="$params[3]">$params[3]</a>

-         #elif $task.method == 'tagNotification'

-         <strong>Recipients:</strong>&nbsp;$printValue('', $params[0])<br/>

-         <strong>Successful?:</strong> #if $params[1] then 'yes' else 'no'#<br/>

-         #if $destTag

-         <strong>Tagged Into:</strong> <a href="taginfo?tagID=$destTag.id">$destTag.name</a><br/>

-         #end if

-         #if $srcTag

-         <strong>#if $destTag then 'Moved From:' else 'Untagged From:'#</strong> <a href="taginfo?tagID=$srcTag.id">$srcTag.name</a><br/>

-         #end if

-         <strong>Build:</strong> <a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a><br/>

-         <strong>#if $destTag then 'Tagged By:' else 'Untagged By:'#</strong> <a href="userinfo?userID=$user.id">$user.name</a><br/>

-         <strong>Ignore Success?:</strong> #if $params[6] then 'yes' else 'no'#<br/>

-         #if $params[7]

-         <strong>Failure Message:</strong> $params[7]

-         #end if

-         #elif $task.method == 'build'

-         <strong>Source:</strong> $params[0]<br/>

-         <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>

-         $printOpts($params[2])

-         #elif $task.method == 'maven'

-         <strong>SCM URL:</strong> $params[0]<br/>

-         <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>

-         $printOpts($params[2])

-         #elif $task.method == 'buildMaven'

-         <strong>SCM URL:</strong> $params[0]<br/>

-         <strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag.id">$buildTag.name</a><br/>

-         #if $len($params) > 2

-         $printOpts($params[2])

-         #end if

-         #elif $task.method == 'wrapperRPM'

-         <strong>Spec File URL:</strong> $params[0]<br/>

-         #if 'locked' in $buildTarget

-         #set $buildTag = $buildTarget.name

-         <strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag">$buildTag</a><br/>

-         #else

-         <strong>Build Target:</strong> <a href="buildtargetinfo?targetID=$buildTarget.id">$buildTarget.name</a><br/>

-         #end if

-         #if $params[2]

-         <strong>Build:</strong> <a href="buildinfo?buildID=$params[2].id">$koji.buildLabel($params[2])</a><br/>

-         #end if

-         #if $params[3]

-         <strong>Task:</strong> <a href="taskinfo?taskID=$wrapTask.id">$koji.taskLabel($wrapTask)</a><br/>

-         #end if

-         #if $len($params) > 4

-         $printOpts($params[4])

-         #end if

-         #elif $task.method == 'chainmaven'

-         <strong>Builds:</strong><br/>

-         <table>

-         #for $key, $val in $params[0].items()

-         <tr><td><strong>$key:</strong></td><td>$printMap($val)</td></tr>

-         #end for

-         </table>

-         <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>

-         #if $len($params) > 2

-         $printOpts($params[2])

-         #end if

-         #elif $task.method == 'livecd' or $task.method == 'appliance' or $task.method == 'livemedia'

-         <strong>Name:</strong> $params[0]<br/>

-         <strong>Version:</strong> $params[1]<br/>

-         <strong>Arch:</strong> $params[2]<br/>

-         <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[3]">$params[3]</a><br/>

-         <strong>Kickstart File:</strong> $params[4]<br/>

-         $printOpts($params[5])

-         #elif $task.method == 'image'

-         <strong>Arches:</strong> #echo ', '.join($params[2])#<br/>

-         <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[3]">$params[3]</a><br/>

-         <strong>Installation Tree:</strong> $params[4]<br/>

-         $printOpts($params[5])

-         #elif $task.method == 'createLiveCD' or $task.method == 'createAppliance' or $task.method == 'createLiveMedia'

-         #if $len($params) > 4:

-         ## new method signature

-         <strong>Arch:</strong> $params[3]<br/>

-         <strong>Kickstart File:</strong> $params[7]<br/>

-         #if $len($params) > 8

-         $printOpts($params[8])

-         #end if

-         #else

-         ## old method signature

-         <strong>Arch:</strong> $params[0]<br/>

-         <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>

-         <strong>Kickstart File:</strong> $params[2]<br/>

-         #if $len($params) > 3

-         $printOpts($params[3])

-         #end if

-         #end if

-         #elif $task.method == 'createImage'

-         #set $target = $params[4]

-         <strong>Build Target:</strong> <a href="buildtargetinfo?name=$target.name">$target.name</a><br/>

-         <strong>Install Tree:</strong> $params[7]<br/>

-         $printOpts($params[8])

-         #elif $task.method == 'winbuild'

-         <strong>VM:</strong> $params[0]<br/>

-         <strong>SCM URL:</strong> $params[1]<br/>

-         <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[2]">$params[2]</a><br/>

-         #if $len($params) > 3

-         $printOpts($params[3])

-         #end if

-         #elif $task.method == 'vmExec'

-         <strong>VM:</strong> $params[0]<br/>

-         <strong>Exec Params:</strong><br/>

-         #for $info in $params[1]

-         #if $isinstance($info, dict)

-         $printMap($info, '&nbsp;&nbsp;&nbsp;&nbsp;')

-         #else

-         &nbsp;&nbsp;$info<br/>

-         #end if

-         #end for

-         #if $len($params) > 2

-         $printOpts($params[2])

-         #end if

-         #elif $task.method == 'newRepo'

-         <strong>Tag:</strong> <a href="taginfo?tagID=$tag.id">$tag.name</a><br/>

-         #if $len($params) > 1

-           $printOpts($params[1])

-         #end if

-         #elif $task.method == 'distRepo'

-         <strong>Tag:</strong> <a href="taginfo?tagID=$tag.id">$tag.name</a><br/>

-         <strong>Repo ID:</strong> <a href="$pathinfo.distrepo($params[1],$tag.name)">$params[1]</a></br>

-         <strong>Keys:</strong> $printValue(0, $params[2])<br/>

-         $printOpts($params[3])

-         #elif $task.method == 'prepRepo'

-         <strong>Tag:</strong> <a href="taginfo?tagID=$params[0].id">$params[0].name</a>

-         #elif $task.method == 'createrepo'

-         <strong>Repo ID:</strong> $params[0]<br/>

-         <strong>Arch:</strong> $params[1]<br/>

-         #set $oldrepo = $params[2]

-         #if $oldrepo

-             <strong>Old Repo ID:</strong> $oldrepo.id<br/>

-             <strong>Old Repo Creation:</strong> $koji.formatTimeLong($oldrepo.creation_time)<br/>

-         #end if

-         #if $len($params) > 4 and $params[4]

-             <strong>External Repos:</strong> $printValue(None, [ext['external_repo_name'] for ext in $params[3]])<br/>

-         #end if

-         #elif $task.method == 'createdistrepo'

-         <strong>Tag:</strong> <a href="taginfo?tagID=$tag.id">$tag.name</a><br/>

-         <strong>Repo ID:</strong> <a href="$pathinfo.distrepo($params[1],$tag.name)">$params[1]</a></br>

-         <strong>Arch:</strong> $printValue(0, $params[2])<br/>

-         <strong>Keys:</strong> $printValue(0, $params[3])<br/>

-         <strong>Options:</strong> $printMap($params[4], '&nbsp;&nbsp;&nbsp;&nbsp;')

-         #elif $task.method == 'dependantTask'

-         <strong>Dependant Tasks:</strong><br/>

-         #for $dep in $deps

-         &nbsp;&nbsp;<a href="taskinfo?taskID=$dep.id" class="task$util.taskState($dep.state)">$koji.taskLabel($dep)</a><br/>

-         #end for

-         <strong>Subtasks:</strong><br/>

-         #for $subtask in $params[1]

-         &nbsp;&nbsp;<strong>Method:</strong> $subtask[0]<br/>

-         &nbsp;&nbsp;<strong>Parameters:</strong> #echo ', '.join([$str($subparam) for $subparam in $subtask[1]])#<br/>

-         #if $len($subtask) > 2 and $subtask[2]

-         &nbsp;&nbsp;<strong>Options:</strong><br/>

-         $printMap($subtask[2], '&nbsp;&nbsp;&nbsp;&nbsp;')

-         #end if

-         <br/>

-         #end for

-         #elif $task.method == 'chainbuild'

-         <strong>Build Groups:</strong><br/>

-         #set $groupNum = 0

-         #for $urls in $params[0]

-         #set $groupNum += 1

-         &nbsp;&nbsp;<strong>$groupNum</strong>: #echo ', '.join($urls)#<br/>

-         #end for

-         <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>

-         $printOpts($params[2])

-         #elif $task.method == 'waitrepo'

-         <strong>Build Tag:</strong> $params[0]<br/>

-         #if $params[1]

-         <strong>Newer Than:</strong> $params[1]<br/>

-         #end if

-         #if $params[2]

-         <strong>NVRs:</strong> $printValue('', $params[2])

-         #end if

-         #elif $task.method == 'restart'

-         <strong>Host:</strong> <a href="hostinfo?hostID=$params[0].id">$params[0].name</a><br/>

-         #elif $task.method == 'restartVerify'

-         <strong>Host:</strong> <a href="hostinfo?hostID=$params[1].id">$params[1].name</a><br/>

-         <strong>Restart Task:</strong>

-             <a href="taskinfo?taskID=$rtask.id" class="task$util.taskState($rtask.state)">$koji.taskLabel($rtask)</a><br/>

-         #elif $task.method == 'runroot'

-         <strong>Build Tag:</strong> <a href="taginfo?tagID=$params[0]">$params[0]</a><br/>

-         <strong>Arch:</strong> $params[1]<br/>

-         $printOpts($params[3])

-         <strong>Commands:</strong> $params[2]<br/>

-         #else

-         $params

-         #end if

+       #if $params_parsed

+       $params_parsed

+       #else

+       <div class="error">Parameters are not correct for this method.</div>

+       $params

+       #end if

        </td>

      </tr>

      <tr>

@@ -0,0 +1,221 @@ 

+ #import koji

+ #from kojiweb import util

+ 

+ #if $task.method == 'buildSRPMFromSCM'

+ <strong>SCM URL:</strong> $params[0]<br/>

+ #if $len($params) > 1

+ <strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag">$buildTag</a><br/>

+ #end if

+ #if $len($params) > 2

+ $printOpts($params[2])

+ #end if

+ #elif $task.method == 'buildSRPMFromCVS'

+ <strong>CVS URL:</strong> $params[0]

+ #elif $task.method == 'buildArch'

+ <strong>SRPM:</strong> $params[0]<br/>

+ <strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag">$buildTag</a><br/>

+ <strong>Arch:</strong> $params[2]<br/>

+ <strong>Keep SRPM?</strong> #if $params[3] then 'yes' else 'no'#<br/>

+ #if $len($params) > 4

+ $printOpts($params[4])

+ #end if

+ #elif $task.method == 'tagBuild'

+ <strong>Destination Tag:</strong> <a href="taginfo?tagID=$destTag.id">$destTag.name</a><br/>

+ <strong>Build:</strong> <a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a>

+ #elif $task.method == 'buildNotification'

+ #set $build = $params[1]

+ #set $buildTarget = $params[2]

+ <strong>Recipients:</strong>&nbsp;$printValue('', $params[0])<br/>

+ <strong>Build:</strong> <a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a><br/>

+ #if $buildTarget

+ <strong>Build Target:</strong> <a href="buildtargetinfo?targetID=$buildTarget.id">$buildTarget.name</a><br/>

+ #else

+ <strong>Build Target:</strong> (no build target)<br/>

+ #end if

+ <strong>Web URL:</strong> <a href="$params[3]">$params[3]</a>

+ #elif $task.method == 'tagNotification'

+ <strong>Recipients:</strong>&nbsp;$printValue('', $params[0])<br/>

+ <strong>Successful?:</strong> #if $params[1] then 'yes' else 'no'#<br/>

+ #if $destTag

+ <strong>Tagged Into:</strong> <a href="taginfo?tagID=$destTag.id">$destTag.name</a><br/>

+ #end if

+ #if $srcTag

+ <strong>#if $destTag then 'Moved From:' else 'Untagged From:'#</strong> <a href="taginfo?tagID=$srcTag.id">$srcTag.name</a><br/>

+ #end if

+ <strong>Build:</strong> <a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a><br/>

+ <strong>#if $destTag then 'Tagged By:' else 'Untagged By:'#</strong> <a href="userinfo?userID=$user.id">$user.name</a><br/>

+ <strong>Ignore Success?:</strong> #if $params[6] then 'yes' else 'no'#<br/>

+ #if $params[7]

+ <strong>Failure Message:</strong> $params[7]

+ #end if

+ #elif $task.method == 'build'

+ <strong>Source:</strong> $params[0]<br/>

+ <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>

+ $printOpts($params[2])

+ #elif $task.method == 'maven'

+ <strong>SCM URL:</strong> $params[0]<br/>

+ <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>

+ $printOpts($params[2])

+ #elif $task.method == 'buildMaven'

+ <strong>SCM URL:</strong> $params[0]<br/>

+ <strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag.id">$buildTag.name</a><br/>

+ #if $len($params) > 2

+ $printOpts($params[2])

+ #end if

+ #elif $task.method == 'wrapperRPM'

+ <strong>Spec File URL:</strong> $params[0]<br/>

+ #if 'locked' in $buildTarget

+ #set $buildTag = $buildTarget.name

+ <strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag">$buildTag</a><br/>

+ #else

+ <strong>Build Target:</strong> <a href="buildtargetinfo?targetID=$buildTarget.id">$buildTarget.name</a><br/>

+ #end if

+ #if $params[2]

+ <strong>Build:</strong> <a href="buildinfo?buildID=$params[2].id">$koji.buildLabel($params[2])</a><br/>

+ #end if

+ #if $params[3]

+ <strong>Task:</strong> <a href="taskinfo?taskID=$wrapTask.id">$koji.taskLabel($wrapTask)</a><br/>

+ #end if

+ #if $len($params) > 4

+ $printOpts($params[4])

+ #end if

+ #elif $task.method == 'chainmaven'

+ <strong>Builds:</strong><br/>

+ <table>

+ #for $key, $val in $params[0].items()

+ <tr><td><strong>$key:</strong></td><td>$printMap($val)</td></tr>

+ #end for

+ </table>

+ <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>

+ #if $len($params) > 2

+ $printOpts($params[2])

+ #end if

+ #elif $task.method == 'livecd' or $task.method == 'appliance' or $task.method == 'livemedia'

+ <strong>Name:</strong> $params[0]<br/>

+ <strong>Version:</strong> $params[1]<br/>

+ <strong>Arch:</strong> $params[2]<br/>

+ <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[3]">$params[3]</a><br/>

+ <strong>Kickstart File:</strong> $params[4]<br/>

+ $printOpts($params[5])

+ #elif $task.method == 'image'

+ <strong>Arches:</strong> #echo ', '.join($params[2])#<br/>

+ <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[3]">$params[3]</a><br/>

+ <strong>Installation Tree:</strong> $params[4]<br/>

+ $printOpts($params[5])

+ #elif $task.method == 'createLiveCD' or $task.method == 'createAppliance' or $task.method == 'createLiveMedia'

+ #if $len($params) > 4:

+ ## new method signature

+ <strong>Arch:</strong> $params[3]<br/>

+ <strong>Kickstart File:</strong> $params[7]<br/>

+ #if $len($params) > 8

+ $printOpts($params[8])

+ #end if

+ #else

+ ## old method signature

+ <strong>Arch:</strong> $params[0]<br/>

+ <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>

+ <strong>Kickstart File:</strong> $params[2]<br/>

+ #if $len($params) > 3

+ $printOpts($params[3])

+ #end if

+ #end if

+ #elif $task.method == 'createImage'

+ #set $target = $params[4]

+ <strong>Build Target:</strong> <a href="buildtargetinfo?name=$target.name">$target.name</a><br/>

+ <strong>Install Tree:</strong> $params[7]<br/>

+ $printOpts($params[8])

+ #elif $task.method == 'winbuild'

+ <strong>VM:</strong> $params[0]<br/>

+ <strong>SCM URL:</strong> $params[1]<br/>

+ <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[2]">$params[2]</a><br/>

+ #if $len($params) > 3

+ $printOpts($params[3])

+ #end if

+ #elif $task.method == 'vmExec'

+ <strong>VM:</strong> $params[0]<br/>

+ <strong>Exec Params:</strong><br/>

+ #for $info in $params[1]

+ #if $isinstance($info, dict)

+ $printMap($info, '&nbsp;&nbsp;&nbsp;&nbsp;')

+ #else

+ &nbsp;&nbsp;$info<br/>

+ #end if

+ #end for

+ #if $len($params) > 2

+ $printOpts($params[2])

+ #end if

+ #elif $task.method == 'newRepo'

+ <strong>Tag:</strong> <a href="taginfo?tagID=$tag.id">$tag.name</a><br/>

+ #if $len($params) > 1

+   $printOpts($params[1])

+ #end if

+ #elif $task.method == 'distRepo'

+ <strong>Tag:</strong> <a href="taginfo?tagID=$tag.id">$tag.name</a><br/>

+ <strong>Repo ID:</strong> <a href="$pathinfo.distrepo($params[1],$tag.name)">$params[1]</a></br>

+ <strong>Keys:</strong> $printValue(0, $params[2])<br/>

+ $printOpts($params[3])

+ #elif $task.method == 'prepRepo'

+ <strong>Tag:</strong> <a href="taginfo?tagID=$params[0].id">$params[0].name</a>

+ #elif $task.method == 'createrepo'

+ <strong>Repo ID:</strong> $params[0]<br/>

+ <strong>Arch:</strong> $params[1]<br/>

+ #set $oldrepo = $params[2]

+ #if $oldrepo

+     <strong>Old Repo ID:</strong> $oldrepo.id<br/>

+     <strong>Old Repo Creation:</strong> $koji.formatTimeLong($oldrepo.creation_time)<br/>

+ #end if

+ #if $len($params) > 4 and $params[4]

+     <strong>External Repos:</strong> $printValue(None, [ext['external_repo_name'] for ext in $params[3]])<br/>

+ #end if

+ #elif $task.method == 'createdistrepo'

+ <strong>Tag:</strong> <a href="taginfo?tagID=$tag.id">$tag.name</a><br/>

+ <strong>Repo ID:</strong> <a href="$pathinfo.distrepo($params[1],$tag.name)">$params[1]</a></br>

+ <strong>Arch:</strong> $printValue(0, $params[2])<br/>

+ <strong>Keys:</strong> $printValue(0, $params[3])<br/>

+ <strong>Options:</strong> $printMap($params[4], '&nbsp;&nbsp;&nbsp;&nbsp;')

+ #elif $task.method == 'dependantTask'

+ <strong>Dependant Tasks:</strong><br/>

+ #for $dep in $deps

+ &nbsp;&nbsp;<a href="taskinfo?taskID=$dep.id" class="task$util.taskState($dep.state)">$koji.taskLabel($dep)</a><br/>

+ #end for

+ <strong>Subtasks:</strong><br/>

+ #for $subtask in $params[1]

+ &nbsp;&nbsp;<strong>Method:</strong> $subtask[0]<br/>

+ &nbsp;&nbsp;<strong>Parameters:</strong> #echo ', '.join([$str($subparam) for $subparam in $subtask[1]])#<br/>

+ #if $len($subtask) > 2 and $subtask[2]

+ &nbsp;&nbsp;<strong>Options:</strong><br/>

+ $printMap($subtask[2], '&nbsp;&nbsp;&nbsp;&nbsp;')

+ #end if

+ <br/>

+ #end for

+ #elif $task.method == 'chainbuild'

+ <strong>Build Groups:</strong><br/>

+ #set $groupNum = 0

+ #for $urls in $params[0]

+ #set $groupNum += 1

+ &nbsp;&nbsp;<strong>$groupNum</strong>: #echo ', '.join($urls)#<br/>

+ #end for

+ <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>

+ $printOpts($params[2])

+ #elif $task.method == 'waitrepo'

+ <strong>Build Tag:</strong> $params[0]<br/>

+ #if $params[1]

+ <strong>Newer Than:</strong> $params[1]<br/>

+ #end if

+ #if $params[2]

+ <strong>NVRs:</strong> $printValue('', $params[2])

+ #end if

+ #elif $task.method == 'restart'

+ <strong>Host:</strong> <a href="hostinfo?hostID=$params[0].id">$params[0].name</a><br/>

+ #elif $task.method == 'restartVerify'

+ <strong>Host:</strong> <a href="hostinfo?hostID=$params[1].id">$params[1].name</a><br/>

+ <strong>Restart Task:</strong>

+     <a href="taskinfo?taskID=$rtask.id" class="task$util.taskState($rtask.state)">$koji.taskLabel($rtask)</a><br/>

+ #elif $task.method == 'runroot'

+ <strong>Build Tag:</strong> <a href="taginfo?tagID=$params[0]">$params[0]</a><br/>

+ <strong>Arch:</strong> $params[1]<br/>

+ $printOpts($params[3])

+ <strong>Commands:</strong> $params[2]<br/>

+ #else

+ $params

+ #end if

Previously web ui failed in displaying tasks with unexpected parameters,
display them now in raw variant with warning message.

Fixes: https://pagure.io/koji/issue/1484

pretty please pagure-ci rebuild

2 years ago

Simple verify test with local instance:

lkoji call --python makeTask '"build"' '["bring us a shrubbery"]'

With the old code, the taskinfo page errors with IndexError: list index out of range

With the new code, however, we see partial template output with the error message stuck in an odd place. In this case, the message is the text for a link (with a nonsense href value).

It seems that #try...#except in a Cheetah template can yield unpredictable output

devtools/fakeweb is sufficient for me to replicate the issue.

rebased onto 1f65f7174ef477a45dd06d31af306a0f2caabc83

2 years ago

I've put whole params rendering to separate template. It seems to be the easiest way to do it with cheetah.

rebased onto a74d0f7b3cc75ad36bba3f80107e2ebc02e49a1e

2 years ago

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 years ago

Metadata Update from @tkopecek:
- Pull-request untagged with: testing-ready

2 years ago

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

2 years ago

rebased onto f434933

2 years ago

Commit 8f454e2 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago