From 2089b04c1f61376ac3e8aacd4a986e9db60ceb3a Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Tue, 15 Jul 2014 10:55:35 +0200 Subject: [PATCH] [IMP] display the nmbr of pending/running/testing display the total number (for the runbot) and the numbers by repo --- runbot/runbot.py | 16 ++++++++++++++++ runbot/runbot.xml | 9 +++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/runbot/runbot.py b/runbot/runbot.py index 40f8666b..564f039d 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -272,6 +272,10 @@ class runbot_repo(osv.osv): Build.write(cr, uid, to_be_skipped_ids, {'state': 'done', 'result': 'skipped'}) def scheduler(self, cr, uid, ids=None, context=None): + icp = self.pool['ir.config_parameter'] + workers = icp.get_param(cr, uid, 'runbot.workers', default=6) + running_max = icp.get_param(cr, uid, 'runbot.running_max', default=75) + for repo in self.browse(cr, uid, ids, context=context): Build = self.pool['runbot.build'] domain = [('repo_id', '=', repo.id)] @@ -849,6 +853,13 @@ class RunbotController(http.Controller): registry, cr, uid, context = request.registry, request.cr, 1, request.context branch_obj = registry['runbot.branch'] build_obj = registry['runbot.build'] + icp = registry['ir.config_parameter'] + workers = icp.get_param(cr, uid, 'runbot.workers', default=6) + running_max = icp.get_param(cr, uid, 'runbot.running_max', default=75) + pending_total = build_obj.search_count(cr, uid, [('state','=','pending')]) + testing_total = build_obj.search_count(cr, uid, [('state','=','testing')]) + running_total = build_obj.search_count(cr, uid, [('state','=','running')]) + v = self.common(cr, uid) # repo if not repo and v['repos']: @@ -898,6 +909,11 @@ class RunbotController(http.Controller): 'limit': limit, 'refresh': refresh, 'repo': repo, + 'workers': workers, + 'running_max': running_max, + 'pending_total': pending_total, + 'running_total': running_total, + 'testing_total': testing_total, }) return request.render("runbot.repo", v) diff --git a/runbot/runbot.xml b/runbot/runbot.xml index 2fe922b1..d8dbf2ae 100644 --- a/runbot/runbot.xml +++ b/runbot/runbot.xml @@ -279,6 +279,11 @@ + + / testing, + / running, + pending. +