Closed Bug 244927 Opened 20 years ago Closed 20 years ago

Add search by time owner has been idle

Categories

(Bugzilla :: Query/Bug List, defect, P3)

2.17.1
defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: bugreport, Assigned: bugreport)

References

Details

Attachments

(1 file, 1 obsolete file)

To determine if a bug is suffering from inattention, a boolean search field is
needed that compares its argument to the amount of time (hours or days) that the
bug has been continuously assigned to the same person but that person has done
nothing.
Adds search for "Time Since Owner Touched" which can be specified as a number
of days (default) or the interval can be suffixed with "h" to indicate a number
of hours.
Attachment #149474 - Flags: review?
Attachment #149474 - Flags: review?(erik)
should it allow the same syntax as SqlifyDate for consistency?  This would mean
using a 'd' for days, and allowing 'w' for weeks, etc.  Would it confuse it too
badly to just use SqlifyDate on it? :)  (just an idea)
I could add the changes to make it support a superset of what sqlifydate does. 
As for using that routine....  no.  sqlifydate need to be replaced.  It shuld
leave the sql server to do the date math.

Comment on attachment 149474 [details] [diff] [review]
Patch - Adds search for "Time Since Owner Touched"

>I could add the changes to make it support a superset of what sqlifydate does. 
>As for using that routine....  no.  sqlifydate need to be replaced.  It shuld
>leave the sql server to do the date math.

At least relative weeks and months are useful, and once we're there, I think
it's easiest for the user if same relative date expressions are supported as
everywhere else. Can the relative date handling part of SqlifyDate be
abstracted out and used here? While I agree date math should be done on the DB,
I'd say it's better to just use one strategy (either app-tier date math or
db-tier one; not both). 

>Index: Bugzilla/Search.pm
>===================================================================

>+                my $notifless; 
>+                my $orifless;
>+                if ($t =~ /great/) {
>+                    $notifless = "";
>+                    $orifless = "AND";
>+                } else {
>+                    $notifless = "NOT";
>+                    $orifless = "OR";
>+                }; 

You know, this is pretty horrible. ;-) "notifless" makes sense - in a way - but
this is really hard to understand. I'd suggest not getting these operators into
variables, but rather using ?: operator to put them into place later on. If you
really feel this is better, I'm not going to jump on the walls, but this is
sick anyway. ;)

I'd say use the regexp to populate a boolean like "searchforgreater" (which is
true if $t =~ /great/). You could use that boolean in your ?: expressions later
on in the code. I think I'd be able to read that one :-)

>+                $v =~ /(\d+)(h|H)?/;

Please allow \s* between the \d+ and time unit (which would be so much nicer as
([hH]) or perhaps even /i :-)) Although if you expand the syntax, the regexp
will probably get rewritten anyway...


Tested and works, but let's resolve the stuff above first.
Attachment #149474 - Flags: review? → review-
Attached patch Patch v2Splinter Review
This cleans up the items from jouni's review.  It keeps the data math in the
databasse.  sqlifydate needs to be fixed, but that is a differrent bug.
Attachment #149474 - Attachment is obsolete: true
Attachment #149671 - Flags: review?(jouni)
Attachment #149474 - Flags: review?(erik)
Comment on attachment 149671 [details] [diff] [review]
Patch v2

Indentation nitpicking rules!

>Index: Bugzilla/Search.pm

>+                my $cutoff = "DATE_SUB(NOW(), 
>+                                  INTERVAL $quantity $unitinterval)";

Please align I of INTERVAL under D of DATE_SUB.

>+                    push(@wherepart, "(comment_$table.who IS NULL " .
>+                        "AND activity_$table.who IS NULL)");
>+                    push(@wherepart, "(comment_$table.who IS NOT NULL " .
>+                        "OR activity_$table.who IS NOT NULL)");


I'd prefer a solution where the string catenation parts are aligned. The
following is my favorite:

		    push(@wherepart, "(comment_$table.who IS NULL " .
				     "AND activity_$table.who IS NULL)");

Other than those, good work. I still disagree on two separate approaches to
date math, but the "that's another bug" approach is fine with me. Just this
once. ;-)

r=jouni
Attachment #149671 - Flags: review?(jouni) → review+
Status: NEW → ASSIGNED
Flags: approval?
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.18
Hmm, this looks like the kind of relatively small, low-risk feature we're
willing to take for 2.18 although we aren't taking new features in general. a=myk
Flags: approval? → approval+
checked in
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Flags: documentation?
Resolution: --- → FIXED
Flags: documentation2.18?
There is actually no list where fields accessible from boolean charts are described. Maybe there should be one, but this should include all fields, not only the one implemented in this bug, and so should be done in a separate bug.

Removing these flags per discussion with justdave on IRC.
Flags: documentation?
Flags: documentation2.18?
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: