Changeset 203830 in webkit


Ignore:
Timestamp:
Jul 28, 2016 1:12:31 PM (8 years ago)
Author:
aakash_jain@apple.com
Message:

EWS error message "Error: * did not process patch" should include explanation
https://bugs.webkit.org/show_bug.cgi?id=159903
<rdar://problem/27410788>

Reviewed by Alexey Proskuryakov.

  • QueueStatusServer/handlers/statusbubble.py:

(StatusBubble._build_bubble): Display more detailed error message on bubbles when patch
is not processed.

  • QueueStatusServer/handlers/processingtimesjson.py:

(ProcessingTimesJSON._resultFromFinalStatus): Updated error message to match with rest
of the code.

  • Scripts/webkitpy/tool/bot/commitqueuetask.py:

(CommitQueueTask.validate): Add more information about validation failure.
(CommitQueueTask.run): Pass the error details in the PatchIsNotValid exception.

  • Scripts/webkitpy/tool/bot/earlywarningsystemtask.py:

(EarlyWarningSystemTask.validate): Add more information about validation failure.
(EarlyWarningSystemTask.run): Pass the error details in the PatchIsNotValid exception.

  • Scripts/webkitpy/tool/bot/patchanalysistask.py:

(PatchIsNotValid.init): Add the failure_message argument.

  • Scripts/webkitpy/tool/commands/earlywarningsystem.py:

(AbstractEarlyWarningSystem.review_patch): Re-word the error message and include
failure details.

  • Scripts/webkitpy/tool/commands/queues.py:

(CommitQueue.process_work_item): Same.
(StyleQueue.review_patch): Same.

  • Scripts/webkitpy/tool/commands/queues_unittest.py:

(test_non_valid_patch): Updated test-cases messages to match the above changes.

Location:
trunk/Tools
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r203811 r203830  
     12016-07-28  Aakash Jain  <aakash_jain@apple.com>
     2
     3        EWS error message "Error: * did not process patch" should include explanation
     4        https://bugs.webkit.org/show_bug.cgi?id=159903
     5        <rdar://problem/27410788>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        * QueueStatusServer/handlers/statusbubble.py:
     10        (StatusBubble._build_bubble): Display more detailed error message on bubbles when patch
     11        is not processed.
     12        * QueueStatusServer/handlers/processingtimesjson.py:
     13        (ProcessingTimesJSON._resultFromFinalStatus): Updated error message to match with rest
     14        of the code.
     15        * Scripts/webkitpy/tool/bot/commitqueuetask.py:
     16        (CommitQueueTask.validate): Add more information about validation failure.
     17        (CommitQueueTask.run): Pass the error details in the PatchIsNotValid exception.
     18        * Scripts/webkitpy/tool/bot/earlywarningsystemtask.py:
     19        (EarlyWarningSystemTask.validate): Add more information about validation failure.
     20        (EarlyWarningSystemTask.run): Pass the error details in the PatchIsNotValid exception.
     21        * Scripts/webkitpy/tool/bot/patchanalysistask.py:
     22        (PatchIsNotValid.__init__): Add the failure_message argument.
     23        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
     24        (AbstractEarlyWarningSystem.review_patch): Re-word the error message and include
     25        failure details.
     26        * Scripts/webkitpy/tool/commands/queues.py:
     27        (CommitQueue.process_work_item): Same.
     28        (StyleQueue.review_patch): Same.
     29        * Scripts/webkitpy/tool/commands/queues_unittest.py:
     30        (test_non_valid_patch): Updated test-cases messages to match the above changes.
     31
    1322016-07-27  Alexey Proskuryakov  <ap@apple.com>
    233
  • trunk/Tools/QueueStatusServer/handlers/processingtimesjson.py

    r174622 r203830  
    4141        elif status_message == "Fail":
    4242            return "fail"
    43         elif status_message == "Error: " + queue_name + " did not process patch.":
     43        elif "did not process patch" in status_message:
    4444            return "not processed"
    4545        elif status_message == "Error: " + queue_name + " unable to apply patch.":
  • trunk/Tools/QueueStatusServer/handlers/statusbubble.py

    r174343 r203830  
    141141                message_to_display = statuses[1].message if len(statuses) > 1 else statuses[0].message
    142142                bubble["details_message"] = message_to_display + "\n\n" + self._iso_time(statuses[0].date)
    143             elif statuses[0].message == "Error: " + queue.name() + " did not process patch.":
     143            elif "did not process patch" in statuses[0].message:
    144144                bubble["state"] = "none"
    145145                bubble["details_message"] = "The patch is no longer eligible for processing."
     146
     147                if "Bug is already closed" in statuses[0].message:
     148                    bubble["details_message"] += " Bug was already closed when EWS attempted to process it."
     149                elif "Patch is marked r-" in statuses[0].message:
     150                    bubble["details_message"] += " Patch was already marked r- when EWS attempted to process it."
     151                elif "Patch is obsolete" in statuses[0].message:
     152                    bubble["details_message"] += " Patch was obsolete when EWS attempted to process it."
     153                elif "No patch committer found" in statuses[0].message:
     154                    bubble["details_message"] += " Patch was not authorized by a commmitter."
     155
    146156                if len(statuses) > 1:
    147157                    if len(statuses) == 2:
    148                         bubble["details_message"] += " One message was logged while the patch was still eligible:\n\n"
     158                        bubble["details_message"] += "\nOne message was logged while the patch was still eligible:\n\n"
    149159                    else:
    150                         bubble["details_message"] += " Some messages were logged while the patch was still eligible:\n\n"
     160                        bubble["details_message"] += "\nSome messages were logged while the patch was still eligible:\n\n"
    151161                    bubble["details_message"] += "\n".join([status.message for status in statuses[1:]]) + "\n\n" + self._iso_time(statuses[0].date)
    152162            elif statuses[0].message == "Error: " + queue.name() + " unable to apply patch.":
  • trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py

    r174408 r203830  
    4444        self._patch = self._delegate.refetch_patch(self._patch)
    4545        if self._patch.is_obsolete():
     46            self.error = "Patch is obsolete."
    4647            return False
    4748        if self._patch.bug().is_closed():
     49            self.error = "Bug is already closed."
    4850            return False
    4951        if not self._patch.committer():
     52            self.error = "No patch committer found."
    5053            return False
    5154        if self._patch.review() == "-":
     55            self.error = "Patch is marked r-."
    5256            return False
    5357        return True
     
    7074    def run(self):
    7175        if not self.validate():
    72             raise PatchIsNotValid(self._patch)
     76            raise PatchIsNotValid(self._patch, self.error)
    7377        if not self._clean():
    7478            return False
     
    8993        # no one has set commit-queue- since we started working on the patch.)
    9094        if not self.validate():
    91             raise PatchIsNotValid(self._patch)
     95            raise PatchIsNotValid(self._patch, self.error)
    9296        # FIXME: We should understand why the land failure occurred and retry if possible.
    9397        if not self._land():
  • trunk/Tools/Scripts/webkitpy/tool/bot/earlywarningsystemtask.py

    r174408 r203830  
    4242        self._patch = self._delegate.refetch_patch(self._patch)
    4343        if self._patch.is_obsolete():
     44            self.error = "Patch is obsolete."
    4445            return False
    4546        if self._patch.bug().is_closed():
     47            self.error = "Bug is already closed."
    4648            return False
    4749        if self._patch.review() == "-":
     50            self.error = "Patch is marked r-."
    4851            return False
    4952        return True
     
    5154    def run(self):
    5255        if not self.validate():
    53             raise PatchIsNotValid(self._patch)
     56            raise PatchIsNotValid(self._patch, self.error)
    5457        if not self._clean():
    5558            return False
  • trunk/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py

    r191036 r203830  
    3838
    3939class PatchIsNotValid(Exception):
    40     def __init__(self, patch):
     40    def __init__(self, patch, failure_message):
    4141        Exception.__init__(self)
    4242        self.patch = patch
     43        self.failure_message = failure_message
    4344
    4445
  • trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py

    r190924 r203830  
    8888                self._unlock_patch(patch)
    8989            return succeeded
    90         except PatchIsNotValid:
    91             self._did_error(patch, "%s did not process patch." % self.name)
     90        except PatchIsNotValid as error:
     91            self._did_error(patch, "%s did not process patch. Reason: %s" % (self.name, error.failure_message))
    9292            return False
    9393        except UnableToApplyPatch, e:
  • trunk/Tools/Scripts/webkitpy/tool/commands/queues.py

    r203386 r203830  
    346346            self._unlock_patch(patch)
    347347            return False
    348         except PatchIsNotValid:
    349             self._did_error(patch, "%s did not process patch." % self.name)
     348        except PatchIsNotValid as error:
     349            self._did_error(patch, "%s did not process patch. Reason: %s" % (self.name, error.failure_message))
    350350            return False
    351351        except ScriptError, e:
     
    486486            self._did_error(patch, "%s unable to apply patch." % self.name)
    487487            return False
    488         except PatchIsNotValid:
    489             self._did_error(patch, "%s did not process patch." % self.name)
     488        except PatchIsNotValid as error:
     489            self._did_error(patch, "%s did not process patch. Reason: %s" % (self.name, error.failure_message))
    490490            return False
    491491        except ScriptError, e:
  • trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py

    r203386 r203830  
    390390        expected_logs = {
    391391            "begin_work_queue": self._default_begin_work_queue_logs("commit-queue"),
    392             "process_work_item": """MOCK: update_status: commit-queue Error: commit-queue did not process patch.
     392            "process_work_item": """MOCK: update_status: commit-queue Error: commit-queue did not process patch. Reason: Bug is already closed.
    393393MOCK: release_work_item: commit-queue 10007
    394394""",
     
    432432Running: webkit-patch --status-host=example.com build-and-test --no-clean --no-update --test --non-interactive --build-style=release --port=mac
    433433MOCK: update_status: commit-queue Passed tests
    434 MOCK: update_status: commit-queue Error: commit-queue did not process patch.
     434MOCK: update_status: commit-queue Error: commit-queue did not process patch. Reason: Patch is obsolete.
    435435MOCK: release_work_item: commit-queue 10000
    436436"""
Note: See TracChangeset for help on using the changeset viewer.