Changeset 90507 in webkit
- Timestamp:
- Jul 6, 2011 3:49:48 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r90506 r90507 1 2011-07-06 Adam Barth <abarth@webkit.org> 2 3 Add roll-chromium-deps command to sheriff-bot 4 https://bugs.webkit.org/show_bug.cgi?id=64037 5 6 Reviewed by Eric Seidel. 7 8 Lo, and the DEPS were rolled on command. 9 10 * Scripts/webkitpy/tool/bot/irc_command.py: 11 * Scripts/webkitpy/tool/bot/irc_command_unittest.py: 12 * Scripts/webkitpy/tool/bot/sheriff.py: 13 * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py: 14 * Scripts/webkitpy/tool/commands/roll.py: 15 * Scripts/webkitpy/tool/commands/roll_unittest.py: 16 * Scripts/webkitpy/tool/steps/updatechromiumdeps.py: 17 1 18 2011-07-06 Eric Seidel <eric@webkit.org> 2 19 -
trunk/Tools/Scripts/webkitpy/tool/bot/irc_command.py
r89520 r90507 38 38 from webkitpy.tool.grammar import join_with_separators 39 39 40 41 def _post_error_and_check_for_bug_url(tool, nicks_string, exception): 42 tool.irc().post("%s" % exception) 43 bug_id = parse_bug_id(exception.output) 44 if bug_id: 45 bug_url = tool.bugs.bug_url_for_bug_id(bug_id) 46 tool.irc().post("%s: Ugg... Might have created %s" % (nicks_string, bug_url)) 47 48 40 49 # FIXME: Merge with Command? 41 50 class IRCCommand(object): … … 113 122 except ScriptError, e: 114 123 tool.irc().post("%s: Failed to create rollout patch:" % nicks_string) 115 tool.irc().post("%s" % e) 116 bug_id = parse_bug_id(e.output) 117 if bug_id: 118 tool.irc().post("%s: Ugg... Might have created %s" % (nicks_string, tool.bugs.bug_url_for_bug_id(bug_id))) 124 _post_error_and_check_for_bug_url(tool, nicks_string, e) 125 126 127 class RollChromiumDEPS(IRCCommand): 128 def _parse_args(self, args): 129 if not args: 130 return 131 revision = args[0].lstrip("r") 132 if not revision.isdigit(): 133 return 134 return revision 135 136 def execute(self, nick, args, tool, sheriff): 137 revision = self._parse_args(args) 138 139 roll_target = "r%s" % revision if revision else "last-known good revision" 140 tool.irc().post("%s: Rolling Chromium DEPS to %s" % (nick, roll_target)) 141 142 try: 143 bug_id = sheriff.post_chromium_deps_roll(revision) 144 bug_url = tool.bugs.bug_url_for_bug_id(bug_id) 145 tool.irc().post("%s: Created DEPS roll: %s" % (nick, bug_url)) 146 except ScriptError, e: 147 match = re.search(r"Current Chromium DEPS revision \d+ is newer than \d+\.", e.output) 148 if match: 149 tool.irc().post("%s: %s" % (nick, match.group(0))) 150 return 151 tool.irc().post("%s: Failed to create DEPS roll:" % nick) 152 _post_error_and_check_for_bug_url(tool, nick, e) 119 153 120 154 … … 187 221 "whois": Whois, 188 222 "create-bug": CreateBug, 223 "roll-chromium-deps": RollChromiumDEPS, 189 224 } -
trunk/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py
r89480 r90507 29 29 import unittest 30 30 31 from webkitpy.common.system.outputcapture import OutputCapture 31 32 from webkitpy.tool.bot.irc_command import * 32 33 from webkitpy.tool.mocktool import MockTool … … 71 72 create_bug.execute("tom", example_args, tool, None)) 72 73 74 def test_roll_chromium_deps(self): 75 roll = RollChromiumDEPS() 76 self.assertEquals(None, roll._parse_args([])) 77 self.assertEquals("1234", roll._parse_args(["1234"])) 78 73 79 def test_rollout(self): 74 80 rollout = Rollout() -
trunk/Tools/Scripts/webkitpy/tool/bot/sheriff.py
r89480 r90507 90 90 return parse_bug_id(output) 91 91 92 def post_chromium_deps_roll(self, revision): 93 args = [ 94 "post-chromium-deps-roll", 95 "--force-clean", 96 "--non-interactive", 97 "--parent-command=sheriff-bot", 98 ] 99 if revision: 100 args += [revision] 101 output = self._sheriffbot.run_webkit_patch(args) 102 return parse_bug_id(output) 103 92 104 def post_blame_comment_on_bug(self, commit_info, builders, tests): 93 105 if not commit_info.bug_id(): -
trunk/Tools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py
r89618 r90507 83 83 84 84 def test_help(self): 85 expected_stderr = "MOCK: irc.post: mock_nick: Available commands: whois, create-bug, hi, last-green-revision, rollout, restart, help\n"85 expected_stderr = "MOCK: irc.post: mock_nick: Available commands: hi, help, last-green-revision, rollout, roll-chromium-deps, create-bug, restart, whois\n" 86 86 OutputCapture().assert_outputs(self, run, args=["help"], expected_stderr=expected_stderr) 87 87 … … 97 97 expected_stderr = "MOCK: irc.post: mock_nick, abarth, darin, eseidel: Preparing rollout for http://trac.webkit.org/changeset/21654...\nMOCK: irc.post: mock_nick, abarth, darin, eseidel: Created rollout: http://example.com/36936\n" 98 98 OutputCapture().assert_outputs(self, run, args=["rollout 21654 This patch broke the world"], expected_stderr=expected_stderr) 99 100 def test_roll_chromium_deps(self): 101 expected_stderr = "MOCK: irc.post: mock_nick: Rolling Chromium DEPS to r21654\nMOCK: irc.post: mock_nick: Created DEPS roll: http://example.com/36936\n" 102 OutputCapture().assert_outputs(self, run, args=["roll-chromium-deps 21654"], expected_stderr=expected_stderr) 103 104 def test_roll_chromium_deps_to_lkgr(self): 105 expected_stderr = "MOCK: irc.post: mock_nick: Rolling Chromium DEPS to last-known good revision\nMOCK: irc.post: mock_nick: Created DEPS roll: http://example.com/36936\n" 106 OutputCapture().assert_outputs(self, run, args=["roll-chromium-deps"], expected_stderr=expected_stderr) 99 107 100 108 def test_multi_rollout(self): -
trunk/Tools/Scripts/webkitpy/tool/commands/roll.py
r77913 r90507 47 47 "chromium_revision": (args and args[0]), 48 48 } 49 50 51 class PostChromiumDEPSRoll(AbstractSequencedCommand): 52 name = "post-chromium-deps-roll" 53 help_text = "Posts a patch to update Chromium DEPS (defaults to the last-known good revision of Chromium)" 54 argument_names = "[CHROMIUM_REVISION]" 55 steps = [ 56 steps.CleanWorkingDirectory, 57 steps.Update, 58 steps.UpdateChromiumDEPS, 59 steps.PrepareChangeLogForDEPSRoll, 60 steps.CreateBug, 61 steps.PostDiff, 62 ] 63 64 def _prepare_state(self, options, args, tool): 65 options.review = False 66 options.request_commit = True 67 68 chromium_revision = (args and args[0]) 69 return { 70 "chromium_revision": chromium_revision, 71 "bug_title": "Roll Chromium DEPS to r%s" % chromium_revision, 72 "bug_description": "A DEPS roll a day keeps the build break away.", 73 } -
trunk/Tools/Scripts/webkitpy/tool/commands/roll_unittest.py
r82771 r90507 44 44 45 45 def test_update_chromium_deps_older_revision(self): 46 options = MockOptions(non_interactive=False) 46 47 expected_stderr = """Current Chromium DEPS revision 6564 is newer than 5764. 47 48 ERROR: Unable to update Chromium DEPS 48 49 """ 49 self.assert_execute_outputs(RollChromiumDEPS(), [5764], expected_stderr=expected_stderr, expected_exception=SystemExit)50 self.assert_execute_outputs(RollChromiumDEPS(), [5764], options=options, expected_stderr=expected_stderr, expected_exception=SystemExit) -
trunk/Tools/Scripts/webkitpy/tool/steps/updatechromiumdeps.py
r76926 r90507 36 36 37 37 class UpdateChromiumDEPS(AbstractStep): 38 @classmethod 39 def options(cls): 40 return AbstractStep.options() + [ 41 Options.non_interactive, 42 ] 43 38 44 # Notice that this method throws lots of exciting exceptions! 39 45 def _fetch_last_known_good_revision(self): … … 42 48 def _validate_revisions(self, current_chromium_revision, new_chromium_revision): 43 49 if new_chromium_revision < current_chromium_revision: 44 log("Current Chromium DEPS revision %s is newer than %s." % (current_chromium_revision, new_chromium_revision)) 50 message = "Current Chromium DEPS revision %s is newer than %s." % (current_chromium_revision, new_chromium_revision) 51 if self._options.non_interactive: 52 error(message) # Causes the process to terminate. 53 log(message) 45 54 new_chromium_revision = self._tool.user.prompt("Enter new chromium revision (enter nothing to cancel):\n") 46 55 try:
Note: See TracChangeset
for help on using the changeset viewer.