Bug 186923

Summary: Security EWS: bots fails with exception 'NoneType' object has no attribute 'is_closed'
Product: WebKit Reporter: Aakash Jain <aakash_jain>
Component: Tools / TestsAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, ap, dbates, ews-watchlist, glenn, lforschler, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=186291
https://bugs.webkit.org/show_bug.cgi?id=186817
Attachments:
Description Flags
Patch none

Description Aakash Jain 2018-06-22 08:38:37 PDT
Some of the EWS bots are hitting following exception while processing security sensitive bugs:

2018-06-21 18:41:22,834 - You don't have permission to view this attachment.
Traceback (most recent call last):
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/tool/bot/queueengine.py", line 103, in run
    if not self._delegate.process_work_item(work_item):
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/tool/commands/queues.py", line 465, in process_work_item
    passed = self.review_patch(patch)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py", line 105, in review_patch
    succeeded = task.run()
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/tool/bot/earlywarningsystemtask.py", line 63, in run
    if not self._clean():
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py", line 113, in _clean
    "Unable to clean working directory")
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py", line 97, in _run_command
    if not self.validate():
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/tool/bot/earlywarningsystemtask.py", line 48, in validate
    if self._patch.bug().is_closed():
AttributeError: 'NoneType' object has no attribute 'is_closed'
2018-06-21 18:41:23,296 - Exception while preparing queue Sleeping until 2018-06-21 18:43:23 (120 seconds).
Comment 1 Daniel Bates 2018-06-22 15:39:14 PDT
This cause of this bug is due to the fact that attachments downloaded from the status server do not have an associated Bug object (i.e. Attachment.bug() returns None). They do not have an associated Bug object because these attachments were not fetched from Bugzilla (since the EWS bot does not have access to the security-sensitive bug the attachment is actually hosted on). We need to fix bug #186817 and provide a way for the EWS bots to fetch up-to-date state of both the attachment and the associated bug.
Comment 2 Daniel Bates 2018-06-22 15:47:57 PDT
Created attachment 343382 [details]
Patch
Comment 3 Daniel Bates 2018-06-22 16:06:00 PDT
Comment on attachment 343382 [details]
Patch

Clearing flags on attachment: 343382

Committed r233107: <https://trac.webkit.org/changeset/233107>
Comment 4 Daniel Bates 2018-06-22 16:06:02 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2018-06-22 16:10:10 PDT
<rdar://problem/41385843>