Title: [110997] trunk/Tools
Revision
110997
Author
aba...@webkit.org
Date
2012-03-16 06:13:14 -0700 (Fri, 16 Mar 2012)

Log Message

Remove sheriff-bot's last-green-revision command
https://bugs.webkit.org/show_bug.cgi?id=81314

Reviewed by Eric Seidel.

This command is a cruel joke.  WebKit doesn't really ever have a
last-green-revision.

* Scripts/webkitpy/common/net/buildbot/buildbot.py:
(BuildBot._find_green_revision):
* Scripts/webkitpy/common/net/buildbot/buildbot_mock.py:
(MockBuildBot.builder_statuses):
* Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
(test_find_green_revision):
* Scripts/webkitpy/tool/bot/irc_command.py:
(IRCCommand.execute):
* Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
(SheriffIRCBotTest.test_help):
* Scripts/webkitpy/tool/commands/queries.py:
(PatchesToReview.execute):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (110996 => 110997)


--- trunk/Tools/ChangeLog	2012-03-16 13:05:35 UTC (rev 110996)
+++ trunk/Tools/ChangeLog	2012-03-16 13:13:14 UTC (rev 110997)
@@ -1,3 +1,26 @@
+2012-03-16  Adam Barth  <aba...@webkit.org>
+
+        Remove sheriff-bot's last-green-revision command
+        https://bugs.webkit.org/show_bug.cgi?id=81314
+
+        Reviewed by Eric Seidel.
+
+        This command is a cruel joke.  WebKit doesn't really ever have a
+        last-green-revision.
+
+        * Scripts/webkitpy/common/net/buildbot/buildbot.py:
+        (BuildBot._find_green_revision):
+        * Scripts/webkitpy/common/net/buildbot/buildbot_mock.py:
+        (MockBuildBot.builder_statuses):
+        * Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
+        (test_find_green_revision):
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        (IRCCommand.execute):
+        * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+        (SheriffIRCBotTest.test_help):
+        * Scripts/webkitpy/tool/commands/queries.py:
+        (PatchesToReview.execute):
+
 2012-03-16  Tor Arne Vestbø  <tor.arne.ves...@nokia.com>
 
         [Qt] Make gccdepends test aware of broken icecream deps generation

Modified: trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py (110996 => 110997)


--- trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py	2012-03-16 13:05:35 UTC (rev 110996)
+++ trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py	2012-03-16 13:13:14 UTC (rev 110997)
@@ -473,30 +473,3 @@
             if len(builders_succeeded_in_future) == len(builder_revisions) and len(builders_succeeded_in_past) == len(builder_revisions):
                 return revision
         return None
-
-    def last_green_revision(self, builder_name_regex):
-        compiled_builder_name_regex = re.compile(builder_name_regex, flags=re.IGNORECASE)
-        builders = [builder for builder in self.builders() if compiled_builder_name_regex.search(builder.name())]
-        if len(builders) > 10:
-            return '"%s" matches too many bots' % builder_name_regex
-        elif not len(builders):
-            return '"%s" doesn\'t match any bot' % builder_name_regex
-
-        builder_revisions = {}
-        for builder in builders:
-            builder_revisions[builder] = self._revisions_for_builder(builder)
-
-        result = ''
-        revision_with_all_builders = self._find_green_revision(builder_revisions)
-        if revision_with_all_builders:
-            result += 'The last known green revision is %d\n' % revision_with_all_builders
-
-        for builder in builders:
-            succeeded_revisions = [revision for revision, succeeded in builder_revisions[builder] if succeeded]
-            if not succeeded_revisions:
-                result += '%s has had no green revision in the last %d runs' % (builder.name(), len(builder_revisions[builder]))
-            else:
-                result += '%s: %d' % (builder.name(), max(succeeded_revisions))
-            result += "\n"
-
-        return result

Modified: trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_mock.py (110996 => 110997)


--- trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_mock.py	2012-03-16 13:05:35 UTC (rev 110996)
+++ trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_mock.py	2012-03-16 13:13:14 UTC (rev 110997)
@@ -90,9 +90,6 @@
             self._mock_builder2_status,
         ]
 
-    def last_green_revision(self, builder_name):
-        return builder_name + ' 1: ' + str(9479) + '\n' + builder_name + ' 2: ' + str(9400)
-
     def light_tree_on_fire(self):
         self._mock_builder2_status["is_green"] = False
 

Modified: trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py (110996 => 110997)


--- trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py	2012-03-16 13:05:35 UTC (rev 110996)
+++ trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py	2012-03-16 13:13:14 UTC (rev 110997)
@@ -434,31 +434,6 @@
             'Builder 3': [(1, True), (3, True), (7, True), (11, False), (12, True)],
         }), 7)
 
-    def test_last_green_revision(self):
-        buildbot = BuildBot()
-
-        def mock_builds_from_builders():
-            return self._fake_builds_at_index(0)
-
-        # Revision, is_green
-        # Ordered from newest (highest number) to oldest.
-        fake_builder1 = Builder("Fake Builder 1", None)
-        fake_builder1.revisions = [(1, True), (3, False), (5, True), (10, True), (12, False)]
-        fake_builder2 = Builder("Fake Builder 2", None)
-        fake_builder2.revisions = [(1, True), (3, False), (7, True), (9, True), (12, False)]
-        some_builder = Builder("Some Builder", None)
-        some_builder.revisions = [(1, True), (3, True), (7, True), (11, False), (12, True)]
-
-        buildbot.builders = lambda: [fake_builder1, fake_builder2, some_builder]
-        buildbot._revisions_for_builder = lambda builder: builder.revisions
-        buildbot._latest_builds_from_builders = mock_builds_from_builders
-        self.assertEqual(buildbot.last_green_revision(''),
-            "The last known green revision is 7\nFake Builder 1: 10\nFake Builder 2: 9\nSome Builder: 12\n")
-
-        some_builder.revisions = [(1, False), (3, False)]
-        self.assertEqual(buildbot.last_green_revision(''),
-            "Fake Builder 1: 10\nFake Builder 2: 9\nSome Builder has had no green revision in the last 2 runs\n")
-
     def _fetch_build(self, build_number):
         if build_number == 5:
             return "correct build"

Modified: trunk/Tools/Scripts/webkitpy/tool/bot/irc_command.py (110996 => 110997)


--- trunk/Tools/Scripts/webkitpy/tool/bot/irc_command.py	2012-03-16 13:05:35 UTC (rev 110996)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/irc_command.py	2012-03-16 13:13:14 UTC (rev 110997)
@@ -52,16 +52,6 @@
         raise NotImplementedError, "subclasses must implement"
 
 
-class LastGreenRevision(IRCCommand):
-    def execute(self, nick, args, tool, sheriff):
-        if not args:
-            return "%s: Usage: last-green-revision BUILDER_NAME" % nick
-        result = tool.buildbot.last_green_revision(' '.join(args))
-        for line in result.split('\n'):
-            if line:
-                tool.irc().post("%s: %s" % (nick, line))
-
-
 class Restart(IRCCommand):
     def execute(self, nick, args, tool, sheriff):
         tool.irc().post("Restarting...")
@@ -257,7 +247,6 @@
 visible_commands = {
     "help": Help,
     "hi": Hi,
-    "last-green-revision": LastGreenRevision,
     "restart": Restart,
     "rollout": Rollout,
     "whois": Whois,

Modified: trunk/Tools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py (110996 => 110997)


--- trunk/Tools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py	2012-03-16 13:05:35 UTC (rev 110996)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py	2012-03-16 13:13:14 UTC (rev 110997)
@@ -82,13 +82,9 @@
         OutputCapture().assert_outputs(self, run, args=["hi"], expected_stderr=expected_stderr)
 
     def test_help(self):
-        expected_stderr = "MOCK: irc.post: mock_nick: Available commands: create-bug, help, hi, last-green-revision, restart, roll-chromium-deps, rollout, whois\n"
+        expected_stderr = "MOCK: irc.post: mock_nick: Available commands: create-bug, help, hi, restart, roll-chromium-deps, rollout, whois\n"
         OutputCapture().assert_outputs(self, run, args=["help"], expected_stderr=expected_stderr)
 
-    def test_lgr(self):
-        expected_stderr = "MOCK: irc.post: mock_nick: Some Builder 1: 9479\nMOCK: irc.post: mock_nick: Some Builder 2: 9400\n"
-        OutputCapture().assert_outputs(self, run, args=["last-green-revision Some Builder"], expected_stderr=expected_stderr)
-
     def test_restart(self):
         expected_stderr = "MOCK: irc.post: Restarting...\n"
         OutputCapture().assert_outputs(self, run, args=["restart"], expected_stderr=expected_stderr, expected_exception=TerminateQueue)

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queries.py (110996 => 110997)


--- trunk/Tools/Scripts/webkitpy/tool/commands/queries.py	2012-03-16 13:05:35 UTC (rev 110996)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queries.py	2012-03-16 13:13:14 UTC (rev 110997)
@@ -127,15 +127,6 @@
             print patch_id
 
 
-class LastGreenRevision(AbstractDeclarativeCommand):
-    name = "last-green-revision"
-    help_text = "Prints the last known good revision"
-    argument_names = "BUILDER_NAME"
-
-    def execute(self, options, args, tool):
-        print self._tool.buildbot.last_green_revision(args[0])
-
-
 class WhatBroke(AbstractDeclarativeCommand):
     name = "what-broke"
     help_text = "Print failing buildbots (%s) and what revisions broke them" % config_urls.buildbot_url
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to