Closed Bug 362778 Opened 18 years ago Closed 6 years ago

[BUGZILLA] Add ability to filter bug notifications by keywords

Categories

(Webtools Graveyard :: Mozbot, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INACTIVE

People

(Reporter: cedric.corazza, Assigned: reed)

References

Details

(Whiteboard: [has-attachment-][needs review comments addressed])

Attachments

(1 file, 1 obsolete file)

It would be nice to have a filter on the 'Keywords' field. As I've been told, firebot filters on components at the moment. For instance, I filed a few bugs concerning a11y on a component which seems to be not watched (bug 362639 and bug 362745), and firebot didn't warn the #accessibility channel about them. Hannibal told me on IRC that https://bugzilla.mozilla.org/show_bug.cgi?id=362639&ctype=xml should help to get this feature implemented, as there is a <keywords> tag. Is this doable? I think this could be valuable for everyone.
Currently BugzillaMailHandler.pl doesn't need to check the XML output for every bug it reports to do any of the filtering. There's the X-Bugzilla-Product and X-Bugzilla-Component headers in the message for it to filter by. If there's not a way to find out the keyword state without checking the XML page, it'd create the overhead of having to send one request to bugzilla /per/ message coming into the script, if we want to provide the keywords in the bugmail log. As an aside, it might be useful for the Calendar project to have an a11y component that can be watched by firebot for you.
(In reply to comment #1) > If there's not a way to find out the keyword state without checking the XML > page, it'd create the overhead of having to send one request to bugzilla /per/ > message coming into the script, if we want to provide the keywords in the > bugmail log. > > As an aside, it might be useful for the Calendar project to have an a11y > component that can be watched by firebot for you. Surely you could check it only once for each bug, and change it yourself if you get a mail that changes the keywords? Though I suppose that could be a slippery slope into keeping a shadow bugzilla db around, which isn't really feasible of course...
Actually, Bug 311913, implemented a X-Bugzilla-Keywords (as well as a X-Bugzilla-Severity and X-Bugzilla-Who header) headers in the bugmail to complement X-Bugzilla-Product and X-Bugzilla-Component, into Bugzilla 2.22 and higher. So, once bmo is upgraded to 3.0rc1 (which is planned for December 26th) this should be much easier to implement, and my comment #1 is moot.
Depends on: 311913
Depends on: 335151
Severity: normal → enhancement
Summary: Would like ability to have mozbot filter on keywords → [BUGZILLA] Add ability to filter bug notifications by keywords
Attached patch WIP - v1 (obsolete) (deleted) — Splinter Review
This is a WIP patch to implement this feature. I needed to transfer the patch to another machine, so I thought I would just attach it to the bug.
Assignee: ian → reed
Status: NEW → ASSIGNED
Comment on attachment 250040 [details] [diff] [review] WIP - v1 This patch caused a regression in mozbot. Bugs without keywords were not reported at all. To fix: + $line =~ /^(.+)$sep(.+)$sep(.+)$sep(.+)$sep(.+)$sep(.+)$sep(.*)$sep(.*)$sep(.+)$/; Should be: + $line =~ /^(.+)$sep(.+)$sep(.+)$sep(.*)$sep(.+)$sep(.+)$sep(.*)$sep(.*)$sep(.+)$/; Otherwise it seems to work. I'm testing it on firebot in the #regressions channel (where its watching for bugs with crash/regression keywords).
Attached patch patch - v1 (deleted) — Splinter Review
Ok, this is tested patch that works on firebot.
Attachment #250040 - Attachment is obsolete: true
Attachment #250804 - Flags: review?(wicked+bz)
Comment on attachment 250804 [details] [diff] [review] patch - v1 >Index: Bugzilla.bm >=================================================================== >- ['mutes', 1, 1, ''], # "channel channel channel" >+ ['mutes', 1, 1, ''], # "channel channel channel", Nit: No need to add that comma to that comment. >+sub CreateChannelListForKeywords { .. >+ ($chan_list .= ',' . $self->{'keywordReportChannels'}->{$_}) .. >+ return (split /\s*,\s*/, $chan_list); These seem to add a blank entry to the chan_list array which results in all kinds of funky errors. Most importantly a "Wrong arguments passed to sendmsg() - ignored at ./mozbot.pl line 1023" error and extraneous bug information fetch. Fetch duplicates bug info output or fails with same sendmsg() if bug 293985 has been fixed. >Index: BugzillaMailHandler.pl >=================================================================== >@@ -396,6 +399,7 @@ sub generate_log ($) { > my $prefix = $bug_info->{'bug_id'} . FIELD_SEPARATOR > . $bug_info->{'product'} . FIELD_SEPARATOR > . $bug_info->{'component'} . FIELD_SEPARATOR >+ . $bug_info->{'keywords'} . FIELD_SEPARATOR > . $bug_info->{'who'} . FIELD_SEPARATOR; This produces error "Use of uninitialized value in concatenation (.) or string at ./BugzillaMailHandler.pl line 399, <STDIN> line 54." if there was no X-Bugzilla-Keywords header in the bugmail. This can happen if 1) Bugzilla is too old to have this or 2) it was never added or was removed from the bugmail template.
Attachment #250804 - Flags: review?(wicked+bz) → review-
Whiteboard: [has-attachment]
Whiteboard: [has-attachment] → [has-attachment-][needs review comments addressed]

Mozbot/Firebot is in maintenance-only mode; no further changes are planned.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
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: