From f0ff55a1109306ad5990942aee336d1b881e161a Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jan 23 2020 11:40:10 +0000 Subject: display some taskinfo for deleted buildtags Fixes: https://pagure.io/koji/issue/1866 --- diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index 09aba88..e080ca5 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -624,15 +624,19 @@ def taskinfo(environ, taskID): values['buildroots'] = buildroots if task['method'] == 'buildArch': - buildTag = server.getTag(params[1]) - values['buildTag'] = buildTag + try: + values['buildTag'] = server.getTag(params[1], strict=True)['name'] + except koji.GenericError: + values['buildTag'] = "%d (deleted)" % params[1] elif task['method'] == 'buildMaven': buildTag = params[1] values['buildTag'] = buildTag elif task['method'] == 'buildSRPMFromSCM': if len(params) > 1: - buildTag = server.getTag(params[1]) - values['buildTag'] = buildTag + try: + values['buildTag'] = server.getTag(params[1], strict=True)['name'] + except koji.GenericError: + values['buildTag'] = "%d (deleted)" % params[1] elif task['method'] == 'tagBuild': destTag = server.getTag(params[0]) build = server.getBuild(params[1]) diff --git a/www/kojiweb/taskinfo.chtml b/www/kojiweb/taskinfo.chtml index 90a6ab0..69086e0 100644 --- a/www/kojiweb/taskinfo.chtml +++ b/www/kojiweb/taskinfo.chtml @@ -79,7 +79,7 @@ $value #if $task.method == 'buildSRPMFromSCM' SCM URL: $params[0]
#if $len($params) > 1 - Build Tag:: $buildTag.name
+ Build Tag: $buildTag
#end if #if $len($params) > 2 $printOpts($params[2]) @@ -88,7 +88,7 @@ $value CVS URL: $params[0] #elif $task.method == 'buildArch' SRPM: $params[0]
- Build Tag: $buildTag.name
+ Build Tag: $buildTag
Arch: $params[2]
Keep SRPM? #if $params[3] then 'yes' else 'no'#
#if $len($params) > 4 @@ -140,8 +140,8 @@ $value #elif $task.method == 'wrapperRPM' Spec File URL: $params[0]
#if 'locked' in $buildTarget - #set $buildTag = $buildTarget - Build Tag: $buildTag.name
+ #set $buildTag = $buildTarget.name + Build Tag: $buildTag
#else Build Target: $buildTarget.name
#end if