From 0517c7a49961470aabe4cbf5fa558e01b4a4a586 Mon Sep 17 00:00:00 2001 From: Markus Zoeller Date: Fri, 7 Aug 2015 16:41:36 +0200 Subject: [PATCH] Make the review list sortable by review type Especially for bug review days it makes sense to sort the current review list by review type (high prio bugfix, medium prio bugfix, ...) This patch set introduces a new column "type" and allows a sorting for it. Change-Id: I3d37cccb8d6f75f6eebc2cf8ab9136ac50d4cf89 --- reviewday/mergeprop.py | 39 ++++++++++++++++++++------------------- reviewday/report.html | 15 +++++++++++++-- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/reviewday/mergeprop.py b/reviewday/mergeprop.py index 9e3f513..d2776f7 100644 --- a/reviewday/mergeprop.py +++ b/reviewday/mergeprop.py @@ -1,5 +1,22 @@ class MergeProp(object): + cause_score = { + 'Regression hotfix': 350, + 'Critical bugfix': 340, + 'Essential feature': 330, + 'High feature': 230, + 'Medium feature': 180, + 'High bugfix': 130, + 'Low feature': 100, + 'Medium bugfix': 70, + 'Low bugfix': 50, + 'Undefined feature': 40, + 'Wishlist bugfix': 35, + 'Undecided bugfix': 30, + 'Untargeted feature': 10, + 'No link': 0, + } + def _calc_score(self, lp, cur_timestamp): cause = 'No link' try: @@ -19,28 +36,11 @@ class MergeProp(object): print 'WARNING: unable to find cause for %s' % self.topic cause = 'No link' - cause_score = { - 'Regression hotfix': 350, - 'Critical bugfix': 340, - 'Essential feature': 330, - 'High feature': 230, - 'Medium feature': 180, - 'High bugfix': 130, - 'Low feature': 100, - 'Medium bugfix': 70, - 'Low bugfix': 50, - 'Undefined feature': 40, - 'Wishlist bugfix': 35, - 'Undecided bugfix': 30, - 'Untargeted feature': 10, - 'No link': 0, - } - - if cause not in cause_score: + if cause not in MergeProp.cause_score: print 'WARNING: unable to find score for ' \ '(%s, %s)' % (self.topic, cause) return ("No link", "Unknown cause: " + cause, 0) - score = cause_score[cause] + score = MergeProp.cause_score[cause] reason = [cause + " (+%d)" % (score)] # Add a score based on the time the patch has been waiting for approval days_old = int((cur_timestamp - self.revisionCreatedOn) / 86400) @@ -88,3 +88,4 @@ class MergeProp(object): self.score = score self.reason = reason self.cause = cause + self.rank = MergeProp.cause_score[cause] diff --git a/reviewday/report.html b/reviewday/report.html index 80a92c9..8fd710f 100644 --- a/reviewday/report.html +++ b/reviewday/report.html @@ -60,7 +60,13 @@ - Type / Subject + Type + + + + + + Subject @@ -95,11 +101,16 @@ #for $mp in $mergeprops + + + + $mp.rank + + 12 - #filter WebSafe ${mp.subject[:60], also='"'}