From 96012ee56f8171ddeba80847014b71b6fd414732 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Feb 14 2017 14:03:18 +0000 Subject: make non-plugin tasks default --- diff --git a/www/conf/web.conf b/www/conf/web.conf index 224f689..2ec0959 100644 --- a/www/conf/web.conf +++ b/www/conf/web.conf @@ -35,8 +35,10 @@ LiteralFooter = True # HiddenUsers = 5372 1234 # Task types visible in pulldown menu on tasks page. -# Tasks = build, buildSRPMFromSCM, buildArch, chainbuild, maven, buildMaven, chainmaven, wrapperRPM, winbuild, vmExec, waitrepo, tagBuild, newRepo, createrepo, buildNotification, tagNotification, dependantTask, livecd, createLiveCD, appliance, createAppliance, image, createImage, runroot, livemedia, createLiveMedia +# Tasks = +# runroot plugin provided via main package could be listed as: +# Tasks = runroot # Tasks that can exist without a parent -# ToplevelTasks = build, buildNotification, chainbuild, maven, chainmaven, wrapperRPM, winbuild, newRepo, tagBuild, tagNotification, waitrepo, livecd, appliance, image, livemedia +# ToplevelTasks = # Tasks that can have children -# ParentTasks = build, chainbuild, maven, chainmaven, winbuild, newRepo, wrapperRPM, livecd, appliance, image, livemedia +# ParentTasks = diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index 471b143..6c449a6 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -416,6 +416,36 @@ def notificationdelete(environ, notificationID): _redirect(environ, 'index') +# All Tasks +_TASKS = ['build', + 'buildSRPMFromSCM', + 'buildArch', + 'chainbuild', + 'maven', + 'buildMaven', + 'chainmaven', + 'wrapperRPM', + 'winbuild', + 'vmExec', + 'waitrepo', + 'tagBuild', + 'newRepo', + 'createrepo', + 'buildNotification', + 'tagNotification', + 'dependantTask', + 'livecd', + 'createLiveCD', + 'appliance', + 'createAppliance', + 'image', + 'createImage', + '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'] +# Tasks that can have children +_PARENT_TASKS = ['build', 'chainbuild', 'maven', 'chainmaven', 'winbuild', 'newRepo', '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') @@ -435,15 +465,15 @@ def tasks(environ, owner=None, state='active', view='tree', method='all', hostID values['users'] = server.listUsers(queryOpts={'order': 'name'}) - if method in environ['koji.options']['Tasks']: + if method in _TASKS + environ['koji.options']['Tasks']: opts['method'] = method else: method = 'all' values['method'] = method - values['alltasks'] = environ['koji.options']['Tasks'] + values['alltasks'] = _TASKS + environ['koji.options']['Tasks'] treeEnabled = True - if hostID or (method not in ['all'] + environ['koji.options']['ParentTasks']): + if hostID or (method not in ['all'] + _PARENT_TASKS + environ['koji.options']['ParentTasks']): # force flat view if we're filtering by a hostID or a task that never has children if view == 'tree': view = 'flat' @@ -452,7 +482,7 @@ def tasks(environ, owner=None, state='active', view='tree', method='all', hostID values['treeEnabled'] = treeEnabled toplevelEnabled = True - if method not in ['all'] + environ['koji.options']['ToplevelTasks']: + if method not in ['all'] + _TOPLEVEL_TASKS + environ['koji.options']['ToplevelTasks']: # force flat view if we're viewing a task that is never a top-level task if view == 'toplevel': view = 'flat' diff --git a/www/kojiweb/wsgi_publisher.py b/www/kojiweb/wsgi_publisher.py index 6001b54..6fd7f04 100644 --- a/www/kojiweb/wsgi_publisher.py +++ b/www/kojiweb/wsgi_publisher.py @@ -93,58 +93,9 @@ class Dispatcher(object): ['LogLevel', 'string', 'WARNING'], ['LogFormat', 'string', '%(msecs)d [%(levelname)s] m=%(method)s u=%(user_name)s p=%(process)s r=%(remoteaddr)s %(name)s: %(message)s'], - ['Tasks', 'list', ['build', - 'buildSRPMFromSCM', - 'buildArch', - 'chainbuild', - 'maven', - 'buildMaven', - 'chainmaven', - 'wrapperRPM', - 'winbuild', - 'vmExec', - 'waitrepo', - 'tagBuild', - 'newRepo', - 'createrepo', - 'buildNotification', - 'tagNotification', - 'dependantTask', - 'livecd', - 'createLiveCD', - 'appliance', - 'createAppliance', - 'image', - 'createImage', - 'runroot', - 'livemedia', - 'createLiveMedia']], - ['ToplevelTasks', 'list', ['build', - 'buildNotification', - 'chainbuild', - 'maven', - 'chainmaven', - 'wrapperRPM', - 'winbuild', - 'newRepo', - 'tagBuild', - 'tagNotification', - 'waitrepo', - 'livecd', - 'appliance', - 'image', - 'livemedia']], - ['ParentTasks', 'list', ['build', - 'chainbuild', - 'maven', - 'chainmaven', - 'winbuild', - 'newRepo', - 'wrapperRPM', - 'livecd', - 'appliance', - 'image', - 'livemedia']], + ['Tasks', 'list', []], + ['ToplevelTasks', 'list', []], + ['ParentTasks', 'list', []], ['RLIMIT_AS', 'string', None], ['RLIMIT_CORE', 'string', None],