Changeset 53570 in webkit
- Timestamp:
- Jan 20, 2010 3:01:22 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r53567 r53570 1 2010-01-20 Eric Seidel <eric@webkit.org> 2 3 No review, rolling out r53537. 4 http://trac.webkit.org/changeset/53537 5 https://bugs.webkit.org/show_bug.cgi?id=33496 6 7 Added a failure condition to the commit-queue and looks to 8 have broken the EWS bots 9 10 * Scripts/webkitpy/commands/early_warning_system.py: 11 * Scripts/webkitpy/commands/queues.py: 12 * Scripts/webkitpy/queueengine.py: 13 * Scripts/webkitpy/scm.py: 14 * Scripts/webkitpy/scm_unittest.py: 15 1 16 2010-01-20 Jon Honeycutt <jhoneycutt@apple.com> 2 17 -
trunk/WebKitTools/Scripts/webkitpy/commands/early_warning_system.py
r53537 r53570 71 71 72 72 @classmethod 73 def _report_patch_failure(cls, tool, patch, script_error): 73 def handle_script_error(cls, tool, state, script_error): 74 is_svn_apply = script_error.command_name() == "svn-apply" 75 status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply) 76 if is_svn_apply: 77 QueueEngine.exit_after_handled_error(script_error) 74 78 results_link = tool.status_server.results_url_for_status(status_id) 75 message = "Attachment %s did not build on %s:\nBuild output: %s" % (patch.id(), cls.port_name, results_link) 76 tool.bugs.post_comment_to_bug(patch.bug_id(), message, cc=cls.watchers) 79 message = "Attachment %s did not build on %s:\nBuild output: %s" % (state["patch"].id(), cls.port_name, results_link) 80 tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers) 81 exit(1) 77 82 78 83 -
trunk/WebKitTools/Scripts/webkitpy/commands/queues.py
r53537 r53570 107 107 raise NotImplementedError, "subclasses must implement" 108 108 109 # Subclasses are expected to post the message somewhere it can be read by a human.110 # They should also prevent the queue from processing this patch again.111 109 def handle_unexpected_error(self, work_item, message): 112 110 raise NotImplementedError, "subclasses must implement" … … 128 126 129 127 @classmethod 130 def _update_status_for_script_error(cls, tool, state, script_error, patch_has_failed_this_queue=True):128 def _update_status_for_script_error(cls, tool, state, script_error, is_error=False): 131 129 message = script_error.message 132 # Error: turns the status bubble purple and means that the error was such that we can't tell if the patch fails or not. 133 if not patch_has_failed_this_queue: 130 if is_error: 134 131 message = "Error: %s" % message 135 status_id = tool.status_server.update_status(cls.name, message, state["patch"], StringIO(script_error.output)) 136 # In the case we know that this patch actually failed the queue, we make a second status entry (mostly because the server doesn't 137 # understand messages prefixed with "Fail:" to mean failures, and thus would leave the status bubble yellow instead of red). 138 # FIXME: Fail vs. Error should really be stored on a separate field from the message on the server. 139 if patch_has_failed_this_queue: 140 tool.status_server.update_status(cls.name, cls._fail_status) 141 return status_id # Return the status id to the original message with all the script output. 142 143 @classmethod 144 def _format_script_error_output_for_bug(tool, status_id, script_error): 145 if not script_error.output: 146 return script_error.message_with_output() 147 results_link = tool.status_server.results_url_for_status(status_id) 148 return "%s\nFull output: %s" % (script_error.message_with_output(), results_link) 132 return tool.status_server.update_status(cls.name, message, state["patch"], StringIO(script_error.output)) 149 133 150 134 … … 176 160 return patches[0] 177 161 178 def _c urrent_checkout_builds_and_passes_tests(self):162 def _can_build_and_test(self): 179 163 try: 180 164 self.run_webkit_patch(["build-and-test", "--force-clean", "--non-interactive", "--build-style=both", "--quiet"]) 181 165 except ScriptError, e: 166 self._update_status("Unabled to successfully build and test", None) 182 167 return False 183 168 return True … … 194 179 if not self._builders_are_green(): 195 180 return False 196 current_revision = self.tool.scm().checkout_revision() 197 self._update_status("Building and testing r%s before landing patch" % current_revision, patch) 198 if not self._current_checkout_builds_and_passes_tests(): 199 self._update_status("Failed to build and test r%s, will try landing later" % current_revision, patch) 181 if not self._can_build_and_test(): 200 182 return False 201 183 if not self._builders_are_green(): … … 204 186 return True 205 187 206 # FIXME: This should be unified with AbstractReviewQueue's implementation. (Mostly _review_patch just needs a rename.)207 188 def process_work_item(self, patch): 208 # We pass --no-update here because we've already validated 209 # that the current revision actually builds and passes the tests. 210 # If we update, we risk moving to a revision that doesn't! 211 self.run_webkit_patch(["land-attachment", "--force-clean", "--non-interactive", "--no-update", "--parent-command=commit-queue", "--build-style=both", "--quiet", patch.id()]) 212 self._did_pass(patch) 189 try: 190 self._cc_watchers(patch.bug_id()) 191 # We pass --no-update here because we've already validated 192 # that the current revision actually builds and passes the tests. 193 # If we update, we risk moving to a revision that doesn't! 194 self.run_webkit_patch(["land-attachment", "--force-clean", "--non-interactive", "--no-update", "--parent-command=commit-queue", "--build-style=both", "--quiet", patch.id()]) 195 self._did_pass(patch) 196 except ScriptError, e: 197 self._did_fail(patch) 198 raise e 213 199 214 200 def handle_unexpected_error(self, patch, message): 215 self._did_fail(patch) 216 self._cc_watchers(patch.bug_id()) 217 self.committer_validator.reject_patch_from_commit_queue(patch.id(), message) # Should instead pass cls.watchers as a CC list here. 201 self.committer_validator.reject_patch_from_commit_queue(patch.id(), message) 218 202 219 203 # StepSequenceErrorHandler methods 220 204 205 @staticmethod 206 def _error_message_for_bug(tool, status_id, script_error): 207 if not script_error.output: 208 return script_error.message_with_output() 209 results_link = tool.status_server.results_url_for_status(status_id) 210 return "%s\nFull output: %s" % (script_error.message_with_output(), results_link) 211 221 212 @classmethod 222 213 def handle_script_error(cls, tool, state, script_error): 223 status_id = cls._update_status_for_script_error(tool, state, script_error , patch_has_failed_this_queue=True)224 script_error_output = cls._format_script_error_output_for_bug(tool, status_id, script_error)225 self._cc_watchers(patch.bug_id())226 CommitterValidator(tool.bugs).reject_patch_from_commit_queue(state["patch"].id(), script_error_output) # Should instead pass cls.watchers as a CC list here. 214 status_id = cls._update_status_for_script_error(tool, state, script_error) 215 validator = CommitterValidator(tool.bugs) 216 validator.reject_patch_from_commit_queue(state["patch"].id(), cls._error_message_for_bug(tool, status_id, script_error)) 217 227 218 228 219 class AbstractReviewQueue(AbstractQueue, PersistentPatchCollectionDelegate, StepSequenceErrorHandler): … … 260 251 261 252 def process_work_item(self, patch): 262 self._review_patch(patch) 263 self._did_pass(patch) 253 try: 254 self._review_patch(patch) 255 self._did_pass(patch) 256 except ScriptError, e: 257 if e.exit_code != QueueEngine.handled_error_code: 258 self._did_fail(patch) 259 raise e 264 260 265 261 def handle_unexpected_error(self, patch, message): 266 log(message) # Unit tests expect us to log, we could eventually remove this since post_comment_to_bug will log as well. 267 self._did_fail(patch) 268 self.tool.bugs.post_comment_to_bug(patch.bug_id(), message, cc=self.watchers) 269 270 @classmethod 271 def _report_patch_failure(cls, tool, patch, script_error): 272 raise NotImplementedError, "subclasses must implement" 273 274 @classmethod 275 def handle_script_error(cls, tool, state, script_error): 276 patch_has_failed = script_error.command_name() != "svn-apply" # svn-apply failures do not necessarily mean the patch would fail to build. 277 status_id = cls._update_status_for_script_error(tool, state, script_error, patch_has_failed_this_queue=patch_has_failed) 278 if patch_has_failed: 279 return # No need to update the bug for svn-apply failures. 280 cls._report_patch_failure(tool, patch, script_error) 262 log(message) 281 263 282 264 # StepSequenceErrorHandler methods … … 300 282 301 283 @classmethod 302 def _style_error_message_for_bug(cls, patch_id, script_error_output): 303 check_style_command = "check-webkit-style" 304 message_header = "Attachment %s did not pass %s:" % (patch_id, cls.name) 305 message_footer = "If any of these errors are false positives, please file a bug against %s." % check_style_command 306 return "%s\n\n%s\n\n%s" % (message_header, script_error_output, message_footer) 307 308 @classmethod 309 def _report_patch_failure(cls, tool, patch, script_error): 310 script_error_output = self._format_script_error_output_for_bug(tool, status_id, script_error) 311 bug_message = cls._style_error_message_for_bug(patch.id(), script_error_output) 312 tool.bugs.post_comment_to_bug(patch.bug_id(), message, cc=cls.watchers) 284 def handle_script_error(cls, tool, state, script_error): 285 is_svn_apply = script_error.command_name() == "svn-apply" 286 status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply) 287 if is_svn_apply: 288 QueueEngine.exit_after_handled_error(script_error) 289 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." % (state["patch"].id(), cls.name, script_error.message_with_output(output_limit=3*1024)) 290 tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers) 291 exit(1) -
trunk/WebKitTools/Scripts/webkitpy/queueengine.py
r53537 r53570 108 108 if e.exit_code == self.handled_error_code: 109 109 continue 110 tool_name = "webkit-patch" # QueueEngine has no way to get to tool.name() at current. 111 message_header = "Unexpected failure while processing patch! Please file a bug against %s." % tool_name 112 message = "%s\n\n%s" % (message_header, e.message_with_output()) 110 message = "Unexpected failure when landing patch! Please file a bug against webkit-patch.\n%s" % e.message_with_output() 113 111 self._delegate.handle_unexpected_error(work_item, message) 114 112 except KeyboardInterrupt, e: -
trunk/WebKitTools/Scripts/webkitpy/scm.py
r53537 r53570 234 234 raise NotImplementedError, "subclasses must implement" 235 235 236 def checkout_revision(self):237 raise NotImplementedError, "subclasses must implement"238 239 236 # Subclasses must indicate if they support local commits, 240 237 # but the SCM baseclass will only call local_commits methods when this is true. … … 366 363 return self.svn_commit_log('BASE') 367 364 368 def checkout_revision(self):369 return int(self.value_from_svn_info(self.checkout_root, 'Revision'))370 371 365 # All git-specific logic should go here. 372 366 class Git(SCM): … … 466 460 def last_svn_commit_log(self): 467 461 return run_command(['git', 'svn', 'log', '--limit=1']) 468 469 def checkout_revision(self):470 return int(run_command(["git", "svn", "find-rev", "HEAD"]).rstrip())471 462 472 463 # Git-specific methods: -
trunk/WebKitTools/Scripts/webkitpy/scm_unittest.py
r53537 r53570 205 205 self.assertTrue(re.search('test2', self.scm.diff_for_revision(2))) 206 206 207 def _shared_test_checkout_revision(self):208 self.assertEqual(self.scm.checkout_revision(), 4)209 210 207 def _shared_test_svn_apply_git_patch(self): 211 208 self._setup_webkittools_scripts_symlink(self.scm) … … 469 466 self._shared_test_diff_for_revision() 470 467 471 def test_checkout_revision(self):472 self._shared_test_checkout_revision()473 474 468 def test_svn_apply_git_patch(self): 475 469 self._shared_test_svn_apply_git_patch() … … 563 557 def test_diff_for_revision(self): 564 558 self._shared_test_diff_for_revision() 565 566 def test_checkout_revision(self):567 self._shared_test_checkout_revision()568 559 569 560 def test_svn_apply_git_patch(self):
Note: See TracChangeset
for help on using the changeset viewer.