Changeset 56964 in webkit
- Timestamp:
- Apr 1, 2010 9:31:54 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r56963 r56964 1 2010-04-01 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Improve the error handling in rollout a bit 6 https://bugs.webkit.org/show_bug.cgi?id=36995 7 8 This patch does a few things to make the error handling in rollout a 9 bit more robust. 10 11 * Scripts/webkitpy/common/checkout/api.py: 12 The old logic here was wrong. We don't want to resolve the 13 ChangeLogs (that would remove the old ChangeLog entry). Instead, 14 we want to revert the ChangeLogs so we can fill them with the new 15 message. 16 * Scripts/webkitpy/tool/commands/download_unittest.py: 17 Update test expectations because we're using a different mock object. 18 * Scripts/webkitpy/tool/commands/download.py: 19 - Added an update command to make updating from the SheriffBot more 20 robust. 21 - Now that we have CommitInfo, we can automatically CC the 22 responsible parties on the bug we create. 23 - Re-ordered the steps in create-rollout. Our original thinking 24 was that we always wanted to create the bug, but that's not 25 really true given how things appear to be playing out. If we 26 fail to apply the reverse diff, we don't want to create the bug. 27 * Scripts/webkitpy/tool/commands/sheriffbot.py: 28 - Use the new, more robust update command. 29 * Scripts/webkitpy/tool/steps/createbug.py: 30 Allow commands to pre-load who they want to be CCed on a new bug. 31 1 32 2010-04-01 Kent Tamura <tkent@chromium.org> 2 33 -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py
r56891 r56964 128 128 self._scm.apply_reverse_diff(revision) 129 129 130 # Fix any ChangeLogs if necessary.130 # We don't want to remove the old ChangeLog entry. 131 131 changelog_paths = self.modified_changelogs() 132 132 if len(changelog_paths): 133 # FIXME: Move _scm.script_path here once we get rid of all the dependencies. 134 run_command([self._scm.script_path('resolve-ChangeLogs')] + changelog_paths) 133 self._scm.revert_files(changelog_paths) 135 134 136 135 conflicts = self._scm.conflicted_files() -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/download.py
r56863 r56964 44 44 45 45 46 class Update(AbstractSequencedCommand): 47 name = "update" 48 help_text = "Update working copy (used internally)" 49 steps = [ 50 steps.CleanWorkingDirectory, 51 steps.Update, 52 ] 53 54 46 55 class Build(AbstractSequencedCommand): 47 56 name = "build" … … 244 253 argument_names = "REVISION REASON" 245 254 246 def _bug_id_for_revision(self, revision): 247 bug_id = self.tool.checkout().bug_id_for_revision(revision) 248 if bug_id: 249 log("Preparing rollout for bug %s." % bug_id) 250 return bug_id 255 def _commit_info(self, revision): 256 commit_info = self.tool.checkout().commit_info_for_revision(revision) 257 if commit_info.bug_id(): 258 # Note: Don't print a bug URL here because it will confuse the 259 # SheriffBot because the SheriffBot just greps the output 260 # of create-rollout for bug URLs. It should do better 261 # parsing instead. 262 log("Preparing rollout for bug %s." % commit_info.bug_id()) 263 return commit_info 251 264 log("Unable to parse bug number from diff.") 252 265 253 266 def _prepare_state(self, options, args, tool): 254 267 revision = args[0] 268 commit_info = self._commit_info(revision) 269 cc_list = sorted([party.bugzilla_email() 270 for party in commit_info.responsible_parties() 271 if party.bugzilla_email()]) 255 272 return { 256 "revision" : revision, 257 "bug_id" : self._bug_id_for_revision(revision), 258 "reason" : args[1], 273 "revision": revision, 274 "bug_id": commit_info.bug_id(), 275 # FIXME: We should used the list as the canonical representation. 276 "bug_cc": ",".join(cc_list), 277 "reason": args[1], 259 278 } 260 279 … … 279 298 help_text = "Creates a bug to track a broken SVN revision and uploads a rollout patch." 280 299 steps = [ 300 steps.CleanWorkingDirectory, 301 steps.Update, 302 steps.RevertRevision, 281 303 steps.CreateBug, 282 steps.CleanWorkingDirectory,283 steps.Update,284 steps.RevertRevision, # Notice that we still create the bug if this step fails.285 304 steps.PrepareChangeLogForRevert, 286 305 steps.PostDiffForRevert, -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py
r56494 r56964 118 118 119 119 def test_prepare_rollout(self): 120 expected_stderr ="Preparing rollout for bug 12345.\nUpdating working directory\nRunning prepare-ChangeLog\n"120 expected_stderr = "Preparing rollout for bug 42.\nUpdating working directory\nRunning prepare-ChangeLog\n" 121 121 self.assert_execute_outputs(PrepareRollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr) 122 122 123 123 def test_create_rollout(self): 124 expected_stderr ="Preparing rollout for bug 12345.\nMOCK create_bug\nbug_title: REGRESSION(r852): Reason\nbug_description: http://trac.webkit.org/changeset/852 broke the build:\nReason\nUpdating working directory\nRunning prepare-ChangeLog\n"124 expected_stderr = "Preparing rollout for bug 42.\nUpdating working directory\nMOCK create_bug\nbug_title: REGRESSION(r852): Reason\nbug_description: http://trac.webkit.org/changeset/852 broke the build:\nReason\nRunning prepare-ChangeLog\n" 125 125 self.assert_execute_outputs(CreateRollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr) 126 126 127 127 def test_rollout(self): 128 expected_stderr = "Preparing rollout for bug 12345.\nUpdating working directory\nRunning prepare-ChangeLog\nBuilding WebKit\n"128 expected_stderr = "Preparing rollout for bug 42.\nUpdating working directory\nRunning prepare-ChangeLog\nBuilding WebKit\n" 129 129 self.assert_execute_outputs(Rollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr) 130 130 -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
r56947 r56964 34 34 from webkitpy.tool.bot.sheriffircbot import SheriffIRCBot 35 35 from webkitpy.tool.commands.queues import AbstractQueue 36 from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler 36 37 37 class SheriffBot(AbstractQueue): 38 39 class SheriffBot(AbstractQueue, StepSequenceErrorHandler): 38 40 name = "sheriff-bot" 39 41 40 def update(self):41 self. tool.executive.run_and_throw_if_fail(WebKitPort.update_webkit_command(), quiet=True)42 def _update(self): 43 self.run_webkit_patch(["update", "--force-clean", "--quiet"]) 42 44 43 45 # AbstractQueue methods … … 54 56 def next_work_item(self): 55 57 self._irc_bot.process_pending_messages() 56 self. update()58 self._update() 57 59 for svn_revision, builders in self.tool.buildbot.revisions_causing_failures().items(): 58 60 if self.tool.status_server.svn_revision(svn_revision): … … 75 77 builders = failure_info["builders"] 76 78 77 self. update()79 self._update() 78 80 commit_info = self.tool.checkout().commit_info_for_revision(svn_revision) 79 81 self._sheriff.post_irc_warning(commit_info, builders) … … 87 89 def handle_unexpected_error(self, failure_info, message): 88 90 log(message) 91 92 # StepSequenceErrorHandler methods 93 94 @classmethod 95 def handle_script_error(cls, tool, state, script_error): 96 # Ideally we would post some information to IRC about what went wrong 97 # here, but we don't have the IRC password in the child process. 98 pass -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/createbug.py
r56497 r56964 43 43 if state.get("bug_id"): 44 44 return 45 state["bug_id"] = self._tool.bugs.create_bug(state["bug_title"], state["bug_description"], blocked=state.get("bug_blocked"), component=self._options.component, cc=self._options.cc) 45 cc = self._options.cc 46 if not cc: 47 cc = state["bug_cc"] 48 state["bug_id"] = self._tool.bugs.create_bug(state["bug_title"], state["bug_description"], blocked=state.get("bug_blocked"), component=self._options.component, cc=cc)
Note: See TracChangeset
for help on using the changeset viewer.