Title: [233288] trunk/Tools
- Revision
- 233288
- Author
- [email protected]
- Date
- 2018-06-27 16:43:13 -0700 (Wed, 27 Jun 2018)
Log Message
style-queue "AttributeError: 'NoneType' object has no attribute 'is_obsolete'" when processing security patch
https://bugs.webkit.org/show_bug.cgi?id=187120
Reviewed by David Kilzer.
Teach the style queue how to refetch a patch from the status server as we did for non-Style
EWS queues.
* Scripts/webkitpy/tool/bot/stylequeuetask.py:
(StyleQueueTask.validate): Similar to change made to EarlyWarningSystemTask.validate() in r233107,
only check if the bug associated with the patch we are processing is closed if the attachment has a
non-None Bug object.
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem.refetch_patch): Extract logic to refetch a patch from here...
* Scripts/webkitpy/tool/commands/queues.py:
(PatchProcessingQueue._refetch_patch): ... to here.
(StyleQueue.refetch_patch): Turn around and call PatchProcessingQueue._refetch_patch().
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (233287 => 233288)
--- trunk/Tools/ChangeLog 2018-06-27 23:28:19 UTC (rev 233287)
+++ trunk/Tools/ChangeLog 2018-06-27 23:43:13 UTC (rev 233288)
@@ -1,3 +1,23 @@
+2018-06-27 Daniel Bates <[email protected]>
+
+ style-queue "AttributeError: 'NoneType' object has no attribute 'is_obsolete'" when processing security patch
+ https://bugs.webkit.org/show_bug.cgi?id=187120
+
+ Reviewed by David Kilzer.
+
+ Teach the style queue how to refetch a patch from the status server as we did for non-Style
+ EWS queues.
+
+ * Scripts/webkitpy/tool/bot/stylequeuetask.py:
+ (StyleQueueTask.validate): Similar to change made to EarlyWarningSystemTask.validate() in r233107,
+ only check if the bug associated with the patch we are processing is closed if the attachment has a
+ non-None Bug object.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ (AbstractEarlyWarningSystem.refetch_patch): Extract logic to refetch a patch from here...
+ * Scripts/webkitpy/tool/commands/queues.py:
+ (PatchProcessingQueue._refetch_patch): ... to here.
+ (StyleQueue.refetch_patch): Turn around and call PatchProcessingQueue._refetch_patch().
+
2018-06-27 Tadeu Zagallo <[email protected]>
Unreviewed, add myself as a WebKit committer.
Modified: trunk/Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py (233287 => 233288)
--- trunk/Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py 2018-06-27 23:28:19 UTC (rev 233287)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py 2018-06-27 23:43:13 UTC (rev 233288)
@@ -36,11 +36,15 @@
class StyleQueueTask(PatchAnalysisTask):
def validate(self):
+ # FIXME: Need a way to ask the status server for the latest status of a security bug.
+ # Attachments downloaded from the status server do not have an associated bug and
+ # reflect the Bugzilla state at the time they were uploaded to the status server.
+ # See <https://bugs.webkit.org/show_bug.cgi?id=186817>.
self._patch = self._delegate.refetch_patch(self._patch)
if self._patch.is_obsolete():
self.error = "Patch is obsolete."
return False
- if self._patch.bug().is_closed():
+ if self._patch.bug() and self._patch.bug().is_closed():
self.error = "Bug is already closed."
return False
if self._patch.review() == "-":
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py (233287 => 233288)
--- trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py 2018-06-27 23:28:19 UTC (rev 233287)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py 2018-06-27 23:43:13 UTC (rev 233288)
@@ -34,7 +34,6 @@
from webkitpy.common.config.committers import CommitterList
from webkitpy.common.config.ports import DeprecatedPort
-from webkitpy.common.net.bugzilla import Bugzilla
from webkitpy.common.system.filesystem import FileSystem
from webkitpy.common.system.executive import ScriptError
from webkitpy.tool.bot.earlywarningsystemtask import EarlyWarningSystemTask, EarlyWarningSystemTaskDelegate
@@ -153,16 +152,7 @@
return self._group
def refetch_patch(self, patch):
- patch_id = patch.id()
- try:
- patch = self._tool.bugs.fetch_attachment(patch_id, throw_on_access_error=True)
- except Bugzilla.AccessError as e:
- # FIXME: Need a way to ask the status server to fetch the patch again. For now
- # we return the attachment as it was when it was originally uploaded to the
- # status server. See <https://bugs.webkit.org/show_bug.cgi?id=186817>.
- if e.error_code == Bugzilla.AccessError.NOT_PERMITTED:
- patch = self._tool.status_server.fetch_attachment(patch_id)
- return patch
+ return super(AbstractEarlyWarningSystem, self)._refetch_patch(patch)
def report_flaky_tests(self, patch, flaky_test_results, results_archive):
pass
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues.py (233287 => 233288)
--- trunk/Tools/Scripts/webkitpy/tool/commands/queues.py 2018-06-27 23:28:19 UTC (rev 233287)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues.py 2018-06-27 23:43:13 UTC (rev 233288)
@@ -328,7 +328,19 @@
if self._can_access_bug(patch.bug_id()):
self._tool.bugs.add_attachment_to_bug(patch.bug_id(), results_archive_file, description, filename="layout-test-results.zip", comment_text=comment_text)
+ def _refetch_patch(self, patch):
+ patch_id = patch.id()
+ try:
+ patch = self._tool.bugs.fetch_attachment(patch_id, throw_on_access_error=True)
+ except Bugzilla.AccessError as e:
+ # FIXME: Need a way to ask the status server to fetch the patch again. For now
+ # we return the attachment as it was when it was originally uploaded to the
+ # status server. See <https://bugs.webkit.org/show_bug.cgi?id=186817>.
+ if e.error_code == Bugzilla.AccessError.NOT_PERMITTED:
+ patch = self._tool.status_server.fetch_attachment(patch_id)
+ return patch
+
class CommitQueue(PatchProcessingQueue, StepSequenceErrorHandler, CommitQueueTaskDelegate):
def __init__(self, commit_queue_task_class=CommitQueueTask):
self._commit_queue_task_class = commit_queue_task_class
@@ -523,4 +535,4 @@
return None
def refetch_patch(self, patch):
- return self._tool.bugs.fetch_attachment(patch.id())
+ return super(StyleQueue, self)._refetch_patch(patch)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes