Title: [174501] trunk/Tools
Revision
174501
Author
[email protected]
Date
2014-10-08 23:50:45 -0700 (Wed, 08 Oct 2014)

Log Message

StyleQueue should throw a PatchIsNotValid exception to achieve
consistency with CommitQueue and EWS
https://bugs.webkit.org/show_bug.cgi?id=137500

Patch by Jake Nielsen <[email protected]> on 2014-10-08
Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/tool/bot/stylequeuetask.py:
Adds a call to validate() in run().
(StyleQueueTask.run):
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
Adds a return False in the patch is not valid exception statement.
(AbstractEarlyWarningSystem.review_patch):
* Scripts/webkitpy/tool/commands/queues.py:
Adds a return False in the patch is not valid exception statement in
commit queue, and adds an except statement to catch PatchIsNotValid
exceptions in style queue.
(CommitQueue.process_work_item):
(StyleQueue.review_patch):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (174500 => 174501)


--- trunk/Tools/ChangeLog	2014-10-09 06:48:17 UTC (rev 174500)
+++ trunk/Tools/ChangeLog	2014-10-09 06:50:45 UTC (rev 174501)
@@ -1,3 +1,24 @@
+2014-10-08  Jake Nielsen  <[email protected]>
+
+        StyleQueue should throw a PatchIsNotValid exception to achieve
+        consistency with CommitQueue and EWS
+        https://bugs.webkit.org/show_bug.cgi?id=137500
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Scripts/webkitpy/tool/bot/stylequeuetask.py:
+        Adds a call to validate() in run().
+        (StyleQueueTask.run):
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        Adds a return False in the patch is not valid exception statement.
+        (AbstractEarlyWarningSystem.review_patch):
+        * Scripts/webkitpy/tool/commands/queues.py:
+        Adds a return False in the patch is not valid exception statement in
+        commit queue, and adds an except statement to catch PatchIsNotValid
+        exceptions in style queue.
+        (CommitQueue.process_work_item):
+        (StyleQueue.review_patch):
+
 2014-10-08  Carlos Garcia Campos  <[email protected]>
 
         Race condition with WebKitWebView:is-loading after starting page load

Modified: trunk/Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py (174500 => 174501)


--- trunk/Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py	2014-10-09 06:48:17 UTC (rev 174500)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/stylequeuetask.py	2014-10-09 06:50:45 UTC (rev 174501)
@@ -26,7 +26,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-from webkitpy.tool.bot.patchanalysistask import PatchAnalysisTask, PatchAnalysisTaskDelegate, UnableToApplyPatch
+from webkitpy.tool.bot.patchanalysistask import PatchAnalysisTask, PatchAnalysisTaskDelegate, UnableToApplyPatch, PatchIsNotValid
 
 
 class StyleQueueTaskDelegate(PatchAnalysisTaskDelegate):
@@ -63,6 +63,8 @@
         "Unabled to apply watchlist")
 
     def run(self):
+        if not self.validate():
+            raise PatchIsNotValid(self._patch)
         if not self._clean():
             return False
         if not self._update():

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py (174500 => 174501)


--- trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py	2014-10-09 06:48:17 UTC (rev 174500)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py	2014-10-09 06:50:45 UTC (rev 174501)
@@ -91,6 +91,7 @@
             return succeeded
         except PatchIsNotValid:
             self._did_error(patch, "%s did not process patch." % self.name)
+            return False
         except UnableToApplyPatch, e:
             self._did_error(patch, "%s unable to apply patch." % self.name)
             return False

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues.py (174500 => 174501)


--- trunk/Tools/Scripts/webkitpy/tool/commands/queues.py	2014-10-09 06:48:17 UTC (rev 174500)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues.py	2014-10-09 06:50:45 UTC (rev 174501)
@@ -324,6 +324,7 @@
             return False
         except PatchIsNotValid:
             self._did_error(patch, "%s did not process patch." % self.name)
+            return False
         except ScriptError, e:
             validator = CommitterValidator(self._tool)
             validator.reject_patch_from_commit_queue(patch.id(), self._error_message_for_bug(task, patch, e))
@@ -452,9 +453,6 @@
 
     def review_patch(self, patch):
         task = StyleQueueTask(self, patch)
-        if not task.validate():
-            self._did_error(patch, "%s did not process patch." % self.name)
-            return False
         try:
             style_check_succeeded = task.run()
             if not style_check_succeeded:
@@ -464,6 +462,9 @@
         except UnableToApplyPatch, e:
             self._did_error(patch, "%s unable to apply patch." % self.name)
             return False
+        except PatchIsNotValid:
+            self._did_error(patch, "%s did not process patch." % self.name)
+            return False
         except ScriptError, e:
             output = re.sub(r'Failed to run .+ exit_code: 1', '', e.output)
             message = "Attachment %s did not pass %s:\n\n%s\n\nIf any of these errors are false positives, please file a bug against check-webkit-style." % (patch.id(), self.name, output)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to