GNOME Bugzilla – Bug 360707
Don't allow double bug counting
Last modified: 2006-10-09 23:18:35 UTC
Long ago, it used to be the case that if a person closed a bug more than one time, they would get more than one 'closed' count for the weekly bug summary. Olav fixed this by adding DISTINCT (and dropped fejj's score by about 1000 bugs...). However, there's a similar problem that still remains: If more than one person close a bug then both get it counted for them closing it. Thus, if I jumped on a bug way too early and closed it and it gets reopened and the maintainer eventually works out a solution, I still get points for having 'closed' it. Really, only the final person who closed it should be counted. (Of course, that'll affect the scores slightly for someone who legitimately closed a bug and someone later errantly reopened it, but I doubt it'll have a big affect)
Some food for thought; Comparing the top 25 bug closers (all time) using both the current and suggested methods gives: +-------+----------------------+ +-------+----------------------+ | bugs | realname | | bugs | realname | +-------+----------------------+ +-------+----------------------+ | 12748 | Gerardo Marin | | 12365 | Gerardo Marin | | 9868 | Elijah Newren | | 9788 | Elijah Newren | | 8034 | Jeffrey Stedfast | | 7608 | Jeffrey Stedfast | | 7275 | Kjartan Maraas | | 7162 | Kjartan Maraas | | 7222 | Yanko Kaneti | | 7156 | Yanko Kaneti | | 6596 | Luis Villa | | 6229 | Luis Villa | | 3948 | Matthias Clasen | | 3879 | Matthias Clasen | | 3775 | Andre Klapper | | 3741 | Andre Klapper | | 3457 | Owen Taylor | | 3355 | Owen Taylor | | 3266 | Vincent Untz | | 3210 | Vincent Untz | | 2934 | Sven | | 2889 | Sebastien Bacher | | 2931 | Sebastien Bacher | | 2748 | Bastien Nocera | | 2799 | Bastien Nocera | | 2638 | George Lebl | | 2698 | George Lebl | | 2588 | Sven | | 2687 | Marco Pesenti Gritti | | 2565 | Marco Pesenti Gritti | | 2367 | Jody Goldberg | | 2294 | Jody Goldberg | | 2268 | Karsten Bräckelmann | | 2256 | Karsten Bräckelmann | | 2248 | Olav Vitters | | 2189 | Olav Vitters | | 2108 | Heath Harrelson | | 2080 | Heath Harrelson | | 1965 | chpe | | 1940 | chpe | | 1935 | John Fleck | | 1844 | John Fleck | | 1772 | Mark McLoughlin | | 1655 | Martin Wehner | | 1705 | Not Zed | | 1645 | Mark McLoughlin | | 1668 | Martin Wehner | | 1626 | Not Zed | | 1634 | Vincent Noel | | 1608 | Vincent Noel | +-------+----------------------+ +-------+----------------------+ So it looks like this won't make a big difference to anyone's scores and I think it makes more sense.
Created attachment 74316 [details] [review] Patch that fixes this Here's the patch I just committed on the server (put here just in case any wants to easily find it without digging through the code) :-)
Sven is down with around 400 closes. What is the performance impact of this patch?
The performance impact is that it is about 10-20% slower (it varies quite a bit between runs for me, probably depending on what else is accessing the database at the time). As far as Sven's count goes, I did a little query which looks roughtly like this: SELECT DISTINCT(bugs.bug_id), bugs_activity.who AS userid, realname FROM bugs INNER JOIN bugs_activity ON bugs.bug_id = bugs_activity.bug_id INNER JOIN profiles ON profiles.userid = bugs_activity.who WHERE bugs.bug_status IN ('RESOLVED','CLOSED','VERIFIED') AND bugs_activity.added IN ('RESOLVED','CLOSED') AND profiles.userid = <userid> AND profiles.userid NOT IN (SELECT DISTINCT(ba1.who) FROM bugs_activity ba1 WHERE ba1.bug_when = (SELECT MAX(ba2.bug_when) FROM bugs_activity ba2 WHERE ba2.added IN ('RESOLVED','CLOSED') AND ba2.fieldid = 8 AND ba2.bug_id = bugs.bug_id) ) ORDER BY bugs.bug_id; and found that Raphaël Quinet had gone through lots of GIMP bugs and marked resolved bugs as closed, thus making Raphaël get the points instead of Sven. A small modification to the query to make it be the last person who changes the bug from "open" to "closed" to get the point instead of the last person who *changes the bug to a "closed" state*, fixes this issue. Doing this would mean that Sven only loses 145 total bugs instead of around 400 as you pointed out.ethod. A quick search followed up by picking three random bugs on the list shows the ones previously counted for Sven that wouldn't be counted anymore would be ones like bug 329396, bug 329430, and bug 134250; all of which I think would be correct to remove from his score. So, I'll reopen for now until I get the change made. It's basically just adding a AND ba.removed IN ('UNCONFIRMED','NEW','REOPENED','ASSIGNED','NEEDINFO') statement to the query.
I don't mean to get all Stop Energetic, but is this really worth the time you're putting into it? If you're enjoying yourself, feel free to ignore me :)
(In reply to comment #4) > So, I'll reopen for now until I get the change made. It's basically just > adding a > AND ba.removed IN ('UNCONFIRMED','NEW','REOPENED','ASSIGNED','NEEDINFO') > statement to the query. and not forgetting/deleting the comma after 'REOPENED' in one of the files (the one in charge of computing the actual points for users) when I try to split that long line into two. I'm such an idiot... (In reply to comment #5) > I don't mean to get all Stop Energetic, but is this really worth the time > you're putting into it? > > If you're enjoying yourself, feel free to ignore me :) It drops more of Gerardo's bugs than mine; why wouldn't I find it fun? ;-) Yeah, yeah, I didn't really know it would do that when I started and it's really not all that big a difference. The real reasons were: - To avoid overzealous bug closing/borderline gaming behavior. Previously, if you closed a bug when it shouldn't be and it gets reopened, you still get a 1 more 'closed' bug once it gets closed again, even if you weren't the one to close it the second time. That's bad. - It's a first step towards something Luis suggested previously -- bug triaging 'leagues' with competition to see which teams and individuals can close the most bugs. He suggested a little twist, where closed bugs that get reopened should be counted negatively (in order to avoid closing bugs that shouldn't be). - Get better at SQL (my SQL skills still suck). - Make the 'bugs closed' stats a bit more reliable - Curiosity Anyway, my testing seems to show that it's all fixed and working again now, with the improvements. It's worth noting, Dave, that you appear to be one of those affected by the previous bugs I had, knocking your points score about 7 lower than it should have been. It should be back to normal now...