EWS should check if the patch is still valid before executing every major step
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Aug 2016 19:45:13 +0000 (19:45 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Aug 2016 19:45:13 +0000 (19:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=160739
rdar://problem/27768813

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/tool/bot/commitqueuetask.py:
(CommitQueueTask.run): validate method is now executed in base class.
* Scripts/webkitpy/tool/bot/earlywarningsystemtask.py:
(EarlyWarningSystemTask.run): validate method is now executed in base class.
* Scripts/webkitpy/tool/bot/stylequeuetask.py:
(StyleQueueTask.validate): Raise an PatchIsNotValid exception instead of returning False.
* Scripts/webkitpy/tool/bot/patchanalysistask.py:
(PatchAnalysisTask._run_command): validate the patch before executing any command. This is to ensure
that we do not waste time on any patch which has become invalid (e.g.: obsolete, r-).
* Scripts/webkitpy/tool/commands/perfalizer.py:
(PerfalizerTask.validate): Added.
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(test_manual_reject_during_processing): Updated test case.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204382 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py
Tools/Scripts/webkitpy/tool/bot/earlywarningsystemtask.py
Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py
Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py
Tools/Scripts/webkitpy/tool/commands/perfalizer.py
Tools/Scripts/webkitpy/tool/commands/queues_unittest.py

index f8c532d..51ab463 100644 (file)
@@ -1,3 +1,25 @@
+2016-08-11  Aakash Jain  <aakash_jain@apple.com>
+
+        EWS should check if the patch is still valid before executing every major step
+        https://bugs.webkit.org/show_bug.cgi?id=160739
+        rdar://problem/27768813
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+        (CommitQueueTask.run): validate method is now executed in base class.
+        * Scripts/webkitpy/tool/bot/earlywarningsystemtask.py:
+        (EarlyWarningSystemTask.run): validate method is now executed in base class.
+        * Scripts/webkitpy/tool/bot/stylequeuetask.py:
+        (StyleQueueTask.validate): Raise an PatchIsNotValid exception instead of returning False.
+        * Scripts/webkitpy/tool/bot/patchanalysistask.py:
+        (PatchAnalysisTask._run_command): validate the patch before executing any command. This is to ensure
+        that we do not waste time on any patch which has become invalid (e.g.: obsolete, r-).
+        * Scripts/webkitpy/tool/commands/perfalizer.py:
+        (PerfalizerTask.validate): Added.
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        (test_manual_reject_during_processing): Updated test case.
+
 2016-08-11  Alex Christensen  <achristensen@webkit.org>
 
         Add URLParser stub
index e062619..19376c1 100644 (file)
@@ -72,8 +72,6 @@ class CommitQueueTask(PatchAnalysisTask):
         return self._test_patch()
 
     def run(self):
-        if not self.validate():
-            raise PatchIsNotValid(self._patch, self.error)
         if not self._clean():
             return False
         if not self._update():
@@ -89,10 +87,6 @@ class CommitQueueTask(PatchAnalysisTask):
                 return self.report_failure()
             if not self._did_pass_tests_recently():
                 return False
-        # Make sure the patch is still valid before landing (e.g., make sure
-        # no one has set commit-queue- since we started working on the patch.)
-        if not self.validate():
-            raise PatchIsNotValid(self._patch, self.error)
         # FIXME: We should understand why the land failure occurred and retry if possible.
         if not self._land():
             return self.report_failure()
index 1f38167..fc308b4 100644 (file)
@@ -52,8 +52,6 @@ class EarlyWarningSystemTask(PatchAnalysisTask):
         return True
 
     def run(self):
-        if not self.validate():
-            raise PatchIsNotValid(self._patch, self.error)
         if not self._clean():
             return False
         if not self._update():
index 2d627e5..7523164 100644 (file)
@@ -83,8 +83,11 @@ class PatchAnalysisTask(object):
         self._script_error = None
         self._results_archive_from_patch_test_run = None
         self._results_from_patch_test_run = None
+        self.error = None
 
     def _run_command(self, command, success_message, failure_message):
+        if not self.validate():
+            raise PatchIsNotValid(self._patch, self.error)
         try:
             self._delegate.run_command(command)
             self._delegate.command_passed(success_message, patch=self._patch)
index ec517da..85ede07 100644 (file)
@@ -66,8 +66,6 @@ class StyleQueueTask(PatchAnalysisTask):
         "Unabled to apply watchlist")
 
     def run(self):
-        if not self.validate():
-            raise PatchIsNotValid(self._patch, self.error)
         if not self._clean():
             return False
         if not self._update():
index 2cd50dc..cff98d5 100644 (file)
@@ -62,6 +62,9 @@ class PerfalizerTask(PatchAnalysisTask):
         except:
             return False
 
+    def validate(self):
+        return True
+
     def run(self):
         if not self._patch.committer() and not self._patch.attacher().can_commit:
             self._logger('The patch %d is not authorized by a commmitter' % self._patch.id())
index c10bd32..4e25a38 100644 (file)
@@ -411,16 +411,6 @@ MOCK: update_status: commit-queue Tests passed, but commit failed (checkout out
         queue._options.port = None
         expected_logs = """Running: webkit-patch --status-host=example.com clean --port=mac
 MOCK: update_status: commit-queue Cleaned working directory
-Running: webkit-patch --status-host=example.com update --port=mac
-MOCK: update_status: commit-queue Updated working directory
-Running: webkit-patch --status-host=example.com apply-attachment --no-update --non-interactive 10000 --port=mac
-MOCK: update_status: commit-queue Applied patch
-Running: webkit-patch --status-host=example.com validate-changelog --check-oops --non-interactive 10000 --port=mac
-MOCK: update_status: commit-queue ChangeLog validated
-Running: webkit-patch --status-host=example.com build --no-clean --no-update --build-style=release --port=mac
-MOCK: update_status: commit-queue Built patch
-Running: webkit-patch --status-host=example.com build-and-test --no-clean --no-update --test --non-interactive --build-style=release --port=mac
-MOCK: update_status: commit-queue Passed tests
 MOCK: update_status: commit-queue Error: commit-queue did not process patch. Reason: Patch is obsolete.
 MOCK: release_work_item: commit-queue 10000
 """