Bug 69303

Summary: watchlist: Don't add the same message to a bug more than once.
Product: WebKit Reporter: David Levin <levin>
Component: Tools / TestsAssignee: David Levin <levin>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 69308    
Bug Blocks: 68822, 69323    
Attachments:
Description Flags
Patch none

David Levin
Reported 2011-10-03 16:12:34 PDT
Right now the watchlist will run once per attachment and that may result in spammy messages.
Attachments
Patch (8.73 KB, patch)
2011-10-03 19:17 PDT, David Levin
no flags
Adam Barth
Comment 1 2011-10-03 16:32:40 PDT
One approach is to look at who is CCed on the bug already. You can also scan the comments for whatever message you would spam.
David Levin
Comment 2 2011-10-03 16:42:14 PDT
(In reply to comment #1) > One approach is to look at who is CCed on the bug already. You can also scan the comments for whatever message you would spam. I think we're fine on the cc list as I tried it out :) and I adding someone to the cc list who is already there seems to be a no-op. I only care about the text but since I need to check the text (which requires fetching the bug), I might as check the cc as well to avoid making the server do unnecessary work.
David Levin
Comment 3 2011-10-03 19:17:16 PDT
Adam Barth
Comment 4 2011-10-04 22:16:49 PDT
Comment on attachment 109573 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=109573&action=review > Tools/Scripts/webkitpy/tool/mocktool.py:311 > - return Bug(self.bug_cache.get(bug_id), self) > + return Bug(self.bug_cache.get(int(bug_id)), self) Yeah, the issue of when bug ID are numbers and when they are strings is tricky. We didn't realize it would be a problem until it was too late. We're more careful in new objects. > Tools/Scripts/webkitpy/tool/steps/applywatchlist.py:37 > +def is_message_in_comments(bug, message): Module private functions start with _ by convention. This seems like it should be a method on bug though. > Tools/Scripts/webkitpy/tool/steps/applywatchlist.py:61 > + messages = [message for message in messages if not is_message_in_comments(bug, message)] You can do this more easily with the filter function.
David Levin
Comment 5 2011-10-05 02:22:48 PDT
Fixed all (and added a simple unit test for the new bug method). Committed as http://trac.webkit.org/changeset/96685
Note You need to log in before you can comment on or make changes to this bug.