From f1a45e00244fefefeb452e232ec4e7be23831c9e Mon Sep 17 00:00:00 2001 From: Jay Greguske Date: Fri, 4 Dec 2015 11:27:37 -0500 Subject: [PATCH] signed-repo kojiweb tweaks --- builder/kojid | 2 +- hub/kojihub.py | 2 +- koji/__init__.py | 4 ++-- www/conf/web.conf | 5 +++++ www/kojiweb/index.py | 8 +++++--- www/kojiweb/taskinfo.chtml | 24 ++++++++++++++---------- 6 files changed, 28 insertions(+), 17 deletions(-) diff --git a/builder/kojid b/builder/kojid index 2e80efa3..80519d24 100755 --- a/builder/kojid +++ b/builder/kojid @@ -4928,7 +4928,7 @@ class NewSignedRepoTask(BaseTaskHandler): Methods = ['signedRepo'] _taskWeight = 0.1 - def handler(self, repo_id, tag): + def handler(self, tag, repo_id): # TODO: remember to use an event here tinfo = self.session.getTag(tag, strict=True) kwargs = {} diff --git a/hub/kojihub.py b/hub/kojihub.py index bd9a8abf..0c5be1d5 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -10181,7 +10181,7 @@ class RootExports(object): """Create a signed-repo task. returns task id""" context.session.assertPerm('signed-repo') repo_id, event_id = signed_repo_init(tag, keys, task_opts) - return make_task('signedRepo', [repo_id, tag], priority=15) + return make_task('signedRepo', [tag, repo_id], priority=15) def newRepo(self, tag, event=None, src=False, debuginfo=False): """Create a newRepo task. returns task id""" diff --git a/koji/__init__.py b/koji/__init__.py index 22b494ba..849c7a93 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -2792,7 +2792,7 @@ def _taskLabel(taskInfo): if 'request' in taskInfo: build = taskInfo['request'][1] extra = buildLabel(build) - elif method == 'newRepo': + elif method in ('newRepo', 'signedRepo'): if 'request' in taskInfo: extra = str(taskInfo['request'][0]) elif method in ('tagBuild', 'tagNotification'): @@ -2803,7 +2803,7 @@ def _taskLabel(taskInfo): if 'request' in taskInfo: tagInfo = taskInfo['request'][0] extra = tagInfo['name'] - elif method == 'createrepo': + elif method in ('createrepo', 'createsignedrepo'): if 'request' in taskInfo: arch = taskInfo['request'][1] extra = arch diff --git a/www/conf/web.conf b/www/conf/web.conf index 2ec09597..db73a1eb 100644 --- a/www/conf/web.conf +++ b/www/conf/web.conf @@ -42,3 +42,8 @@ LiteralFooter = True # ToplevelTasks = # Tasks that can have children # ParentTasks = + +# Uncommenting this will show python tracebacks in the webUI, but they are the +# same as what you will see in apache's error_log. +# Not for production use +# PythonDebug = True diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index 5ea585d1..569e95b2 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -431,6 +431,8 @@ _TASKS = ['build', 'tagBuild', 'newRepo', 'createrepo', + 'signedRepo', + 'createsignedrepo', 'buildNotification', 'tagNotification', 'dependantTask', @@ -444,9 +446,9 @@ _TASKS = ['build', 'livemedia', 'createLiveMedia'] # Tasks that can exist without a parent -_TOPLEVEL_TASKS = ['build', 'buildNotification', 'chainbuild', 'maven', 'chainmaven', 'wrapperRPM', 'winbuild', 'newRepo', 'tagBuild', 'tagNotification', 'waitrepo', 'livecd', 'appliance', 'image', 'livemedia'] +_TOPLEVEL_TASKS = ['build', 'buildNotification', 'chainbuild', 'maven', 'chainmaven', 'wrapperRPM', 'winbuild', 'newRepo', 'signedRepo', 'tagBuild', 'tagNotification', 'waitrepo', 'livecd', 'appliance', 'image', 'livemedia'] # Tasks that can have children -_PARENT_TASKS = ['build', 'chainbuild', 'maven', 'chainmaven', 'winbuild', 'newRepo', 'wrapperRPM', 'livecd', 'appliance', 'image', 'livemedia'] +_PARENT_TASKS = ['build', 'chainbuild', 'maven', 'chainmaven', 'winbuild', 'newRepo', 'signedRepo', 'wrapperRPM', 'livecd', 'appliance', 'image', 'livemedia'] def tasks(environ, owner=None, state='active', view='tree', method='all', hostID=None, channelID=None, start=None, order='-id'): values = _initValues(environ, 'Tasks', 'tasks') @@ -623,7 +625,7 @@ def taskinfo(environ, taskID): build = server.getBuild(params[1]) values['destTag'] = destTag values['build'] = build - elif task['method'] == 'newRepo': + elif task['method'] in ('newRepo', 'signedRepo'): tag = server.getTag(params[0]) values['tag'] = tag elif task['method'] == 'tagNotification': diff --git a/www/kojiweb/taskinfo.chtml b/www/kojiweb/taskinfo.chtml index e12a64bf..8f22eac8 100644 --- a/www/kojiweb/taskinfo.chtml +++ b/www/kojiweb/taskinfo.chtml @@ -218,23 +218,27 @@ $value #if $len($params) > 2 $printOpts($params[2]) #end if - #elif $task.method == 'newRepo' + #elif $task.method in ('newRepo', 'signedRepo') Tag: $tag.name
- #if $len($params) > 1 - $printOpts($params[1]) + #if $task.method == 'signedRepo' + Repo ID: $params[1]
+ #elif $len($params) > 1 + $printOpts($params[1]) #end if #elif $task.method == 'prepRepo' Tag: $params[0].name - #elif $task.method == 'createrepo' + #elif $task.method in ('createrepo', 'createsignedrepo') Repo ID: $params[0]
Arch: $params[1]
- #set $oldrepo = $params[2] - #if $oldrepo - Old Repo ID: $oldrepo.id
- Old Repo Creation: $koji.formatTimeLong($oldrepo.creation_time)
+ #if $len($params) > 2 + #set $oldrepo = $params[2] + #if $oldrepo + Old Repo ID: $oldrepo.id
+ Old Repo Creation: $koji.formatTimeLong($oldrepo.creation_time)
+ #end if #end if - #if $len($params) > 3 - External Repos: $printValue(None, [ext['external_repo_name'] for ext in $params[3]])
+ #if $len($params) > 3 and $params[3] + External Repos: $printValue(None, [ext['external_repo_name'] for ext in $params[3]])
#end if #elif $task.method == 'dependantTask' Dependant Tasks: