Closed Bug 300456 Opened 19 years ago Closed 19 years ago

[BUGZILLA] BugzillaMailHandler should say what a bug is a DUPLICATE *of*

Categories

(Webtools Graveyard :: Mozbot, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mkanat, Assigned: cso)

Details

Attachments

(1 file, 1 obsolete file)

Right now Bugzilla.bm reports dup'ing a bug like this:

mkanat [at] bugzilla.org set the Resolution field on bug 300219 to DUPLICATE.

It should additionally say what bug it was dup'ed to.
Severity: normal → enhancement
Target Milestone: --- → Mozbot 2.6
Attached patch Patch v1 (obsolete) β€” β€” Splinter Review
Pathc to add this...

This is probably way more complicated than it needs to be - but it seems to
work for me.
Attachment #189482 - Flags: review?(mkanat)
Comment on attachment 189482 [details] [diff] [review]
Patch v1

>Index: Bugzilla.bm
>===================================================================
>RCS file: /cvsroot/mozilla/webtools/mozbot/BotModules/Bugzilla.bm,v
>retrieving revision 2.13
>diff -u -r2.13 Bugzilla.bm
>--- Bugzilla.bm	8 Jul 2005 02:44:40 -0000	2.13
>+++ Bugzilla.bm	15 Jul 2005 22:38:50 -0000
>@@ -618,10 +618,21 @@
>                     # up properly in the GotURI after FetchBug.
>                     $event->{'target'} = $channel;
>                     $self->say($event, $message);
>-                    $self->FetchBug($event, $bug_id, 'bug')
>-                        unless $said_bug{$channel . $bug_id};
>+                    # Special case for "duplicate of messages"
>+                    my $dup_id;
>+                    $dup_id = $1 if $message =~ /DUPLICATE of bug (\d+)/;
>+                    # Construct bugids string
>+                    my $bugids = "";
[snip]

  OK, I suppose this is probably the best solution in this case. :-)

  However, it looks like we check the existence of $dup_id about three or four
times -- just wrap the whole bits that deal with $dup_id in that "if $message"
check, I'd think.

  Eventually we won't even need $said_bug, either, so eventually this code will
get cleaner. (FetchBug will handle checking for duplicate messages itself.)


>             # If we didn't remove anything, only added something.
>             elsif (!$old) {
>                 $line .= " set the $field field on bug"
>-                         . " $bug_info->{bug_id} to $new.";
>+                         . " $bug_info->{bug_id} to $new";
>+                $line .= ' of bug ' . $bug_info->{dup_of} if exists $bug_info->{dup_of};

  Just add a comment here that that's a special hack for RESOLVED DUPLICATE
messages.


  Not really a "hard" r-, just mostly code-rearrangement nits.
Attachment #189482 - Flags: review?(mkanat) → review-
I applied the current patch to ssdbot, though. :-)
Assignee: mkanat → colin.ogilvie
Status: NEW → ASSIGNED
Attached patch Patch v2 β€” β€” Splinter Review
Fixes nits...
Attachment #189482 - Attachment is obsolete: true
Attachment #189586 - Flags: review?(mkanat)
Comment on attachment 189586 [details] [diff] [review]
Patch v2

>+                        $said_bug{$channel . $dup_id} = 1;

  I'm fairly sure that the $said_bug bit does need to go at the end, and not in
this block. :-)

  Otherwise, this looks pretty good.
Attachment #189586 - Flags: review?(mkanat) → review-
Comment on attachment 189586 [details] [diff] [review]
Patch v2

Oh wait, nevermind. You're fine.

Arr, we just need to get rid of the silly $said_bug stuff in general,
evenrually. :-)
Attachment #189586 - Flags: review- → review+
Checked in:

Checking in BotModules/Bugzilla.bm;
/cvsroot/mozilla/webtools/mozbot/BotModules/Bugzilla.bm,v  <--  Bugzilla.bm
new revision: 2.15; previous revision: 2.14
done
Checking in BotModules/BugzillaMailHandler.pl;
/cvsroot/mozilla/webtools/mozbot/BotModules/BugzillaMailHandler.pl,v  <-- 
BugzillaMailHandler.pl
new revision: 2.2; previous revision: 2.1
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
QA Contact: kerz → mozbot
Verified Fixed.
Status: RESOLVED → VERIFIED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: