Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
EWS Style Queue fails to process patches which fails validation
https://bugs.webkit.org/show_bug.cgi?id=160632

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/tool/bot/stylequeuetask.py:
(StyleQueueTask.validate): Add more information about validation failure.
(StyleQueueTask.run): Pass the error details in the PatchIsNotValid exception.
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(test_non_valid_patch): Add a unit test to test the above code path.


Canonical link: https://commits.webkit.org/178762@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aj062 committed Aug 6, 2016
1 parent 386a428 commit 8091e80
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,16 @@
2016-08-06 Aakash Jain <aakash_jain@apple.com>

EWS Style Queue fails to process patches which fails validation
https://bugs.webkit.org/show_bug.cgi?id=160632

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/tool/bot/stylequeuetask.py:
(StyleQueueTask.validate): Add more information about validation failure.
(StyleQueueTask.run): Pass the error details in the PatchIsNotValid exception.
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(test_non_valid_patch): Add a unit test to test the above code path.

2016-08-06 Sam Weinig <sam@webkit.org>

WTF needs a variant implementation
Expand Down
5 changes: 4 additions & 1 deletion Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py
Expand Up @@ -38,10 +38,13 @@ class StyleQueueTask(PatchAnalysisTask):
def validate(self):
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():
self.error = "Bug is already closed."
return False
if self._patch.review() == "-":
self.error = "Patch is marked r-."
return False
return True

Expand All @@ -64,7 +67,7 @@ def _apply_watch_list(self):

def run(self):
if not self.validate():
raise PatchIsNotValid(self._patch)
raise PatchIsNotValid(self._patch, self.error)
if not self._clean():
return False
if not self._update():
Expand Down
11 changes: 11 additions & 0 deletions Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
Expand Up @@ -534,3 +534,14 @@ def test_style_queue_with_watch_list_exception(self):
}
tool = MockTool(executive_throws_when_run=set(['apply-watchlist-local']))
self.assert_queue_outputs(StyleQueue(host=MockHost()), expected_logs=expected_logs, tool=tool)

def test_non_valid_patch(self):
tool = MockTool()
patch = tool.bugs.fetch_attachment(10007) # _patch8, resolved bug, without review flag, not marked obsolete (maybe already landed)
expected_logs = {
"begin_work_queue": self._default_begin_work_queue_logs("style-queue"),
"process_work_item": """MOCK: update_status: style-queue Error: style-queue did not process patch. Reason: Bug is already closed.
MOCK: release_work_item: style-queue 10007
""",
}
self.assert_queue_outputs(StyleQueue(host=MockHost()), tool=tool, work_item=patch, expected_logs=expected_logs)

0 comments on commit 8091e80

Please sign in to comment.