Changeset 143109 in webkit


Ignore:
Timestamp:
Feb 16, 2013 1:57:17 PM (11 years ago)
Author:
rniwa@webkit.org
Message:

We need a CIA replacement
https://bugs.webkit.org/show_bug.cgi?id=110008

Reviewed by Andreas Kling.

Added new-commit-bot.

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

(QueueEngine.init):
(QueueEngine): Made the sleep tiem configurable.
(QueueEngine._sleep_message):
(QueueEngine._sleep):

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

(QueueEngineTest.test_sleep_message):

  • Scripts/webkitpy/tool/commands/init.py:
  • Scripts/webkitpy/tool/commands/newcommitbot.py: Added.

(PingPong): Added. Implements the ping pong protocol.
(NewCommitBot):
(NewCommitBot.begin_work_queue):
(NewCommitBot.work_item_log_path):
(NewCommitBot.next_work_item): Update SVN revision and report any new commits made since
the last time we checked the head SVN revision.
(NewCommitBot.process_work_item):
(NewCommitBot._update_checkout): svn up.
(NewCommitBot._new_svn_revisions): Returns a range of new revisions.
(NewCommitBot._summarize_commit_log): Summarize a commit log to be posted on IRC.
(NewCommitBot.handle_unexpected_error):
(NewCommitBot.handle_script_error):

  • Scripts/webkitpy/tool/commands/newcommitbot_unittest.py: Added.

(NewCommitBotTest.test_summarize_commit_log_basic): Tests for summarizing non-rollout commits.
(NewCommitBotTest.test_summarize_commit_log_rollout): Tests for summarizing rollouts.

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

(AbstractQueue.execute):

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

(MockQueueEngine.init):

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

(SheriffBotTest.test_command_aliases):

  • Scripts/webkitpy/tool/main.py:

(WebKitPatch):

Location:
trunk/Tools
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r143106 r143109  
     12013-02-16  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        We need a CIA replacement
     4        https://bugs.webkit.org/show_bug.cgi?id=110008
     5
     6        Reviewed by Andreas Kling.
     7
     8        Added new-commit-bot.
     9
     10        * Scripts/webkitpy/tool/bot/queueengine.py:
     11        (QueueEngine.__init__):
     12        (QueueEngine): Made the sleep tiem configurable.
     13        (QueueEngine._sleep_message):
     14        (QueueEngine._sleep):
     15        * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
     16        (QueueEngineTest.test_sleep_message):
     17        * Scripts/webkitpy/tool/commands/__init__.py:
     18        * Scripts/webkitpy/tool/commands/newcommitbot.py: Added.
     19        (PingPong): Added. Implements the ping pong protocol.
     20        (NewCommitBot):
     21        (NewCommitBot.begin_work_queue):
     22        (NewCommitBot.work_item_log_path):
     23        (NewCommitBot.next_work_item): Update SVN revision and report any new commits made since
     24        the last time we checked the head SVN revision.
     25        (NewCommitBot.process_work_item):
     26        (NewCommitBot._update_checkout): svn up.
     27        (NewCommitBot._new_svn_revisions): Returns a range of new revisions.
     28        (NewCommitBot._summarize_commit_log): Summarize a commit log to be posted on IRC.
     29        (NewCommitBot.handle_unexpected_error):
     30        (NewCommitBot.handle_script_error):
     31        * Scripts/webkitpy/tool/commands/newcommitbot_unittest.py: Added.
     32        (NewCommitBotTest.test_summarize_commit_log_basic): Tests for summarizing non-rollout commits.
     33        (NewCommitBotTest.test_summarize_commit_log_rollout): Tests for summarizing rollouts.
     34        * Scripts/webkitpy/tool/commands/queues.py:
     35        (AbstractQueue.execute):
     36        * Scripts/webkitpy/tool/commands/queuestest.py:
     37        (MockQueueEngine.__init__):
     38        * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
     39        (SheriffBotTest.test_command_aliases):
     40        * Scripts/webkitpy/tool/main.py:
     41        (WebKitPatch):
     42
    1432013-02-16  Jochen Eisinger  <jochen@chromium.org>
    244
  • trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py

    r136221 r143109  
    7070
    7171class QueueEngine:
    72     def __init__(self, name, delegate, wakeup_event):
     72    def __init__(self, name, delegate, wakeup_event, seconds_to_sleep=120):
    7373        self._name = name
    7474        self._delegate = delegate
    7575        self._wakeup_event = wakeup_event
    7676        self._output_tee = OutputTee()
     77        self._seconds_to_sleep = seconds_to_sleep
    7778
    7879    log_date_format = "%Y-%m-%d %H:%M:%S"
    79     sleep_duration_text = "2 mins"  # This could be generated from seconds_to_sleep
    80     seconds_to_sleep = 120
    8180    handled_error_code = 2
    8281
     
    154153
    155154    def _sleep_message(self, message):
    156         wake_time = self._now() + timedelta(seconds=self.seconds_to_sleep)
    157         return "%s Sleeping until %s (%s)." % (message, wake_time.strftime(self.log_date_format), self.sleep_duration_text)
     155        wake_time = self._now() + timedelta(seconds=self._seconds_to_sleep)
     156        if self._seconds_to_sleep < 3 * 60:
     157            sleep_duration_text = str(self._seconds_to_sleep) + ' seconds'
     158        else:
     159            sleep_duration_text = str(round(self._seconds_to_sleep / 60)) + ' minutes'
     160        return "%s Sleeping until %s (%s)." % (message, wake_time.strftime(self.log_date_format), sleep_duration_text)
    158161
    159162    def _sleep(self, message):
    160163        _log.info(self._sleep_message(message))
    161         self._wakeup_event.wait(self.seconds_to_sleep)
     164        self._wakeup_event.wait(self._seconds_to_sleep)
    162165        self._wakeup_event.clear()
  • trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py

    r140510 r143109  
    174174        engine = QueueEngine("test", None, None)
    175175        engine._now = lambda: datetime.datetime(2010, 1, 1)
    176         expected_sleep_message = "MESSAGE Sleeping until 2010-01-01 00:02:00 (2 mins)."
     176        expected_sleep_message = "MESSAGE Sleeping until 2010-01-01 00:02:00 (120 seconds)."
    177177        self.assertEqual(engine._sleep_message("MESSAGE"), expected_sleep_message)
    178178
  • trunk/Tools/Scripts/webkitpy/tool/commands/__init__.py

    r134363 r143109  
    1111from webkitpy.tool.commands.findusers import FindUsers
    1212from webkitpy.tool.commands.gardenomatic import GardenOMatic
     13from webkitpy.tool.commands.newcommitbot import NewCommitBot
    1314from webkitpy.tool.commands.openbugs import OpenBugs
    1415from webkitpy.tool.commands.perfalizer import Perfalizer
  • trunk/Tools/Scripts/webkitpy/tool/commands/queues.py

    r138826 r143109  
    149149        self._options = options # FIXME: This code is wrong.  Command.options is a list, this assumes an Options element!
    150150        self._tool = tool  # FIXME: This code is wrong too!  Command.bind_to_tool handles this!
    151         return engine(self.name, self, self._tool.wakeup_event).run()
     151        return engine(self.name, self, self._tool.wakeup_event, self._options.seconds_to_sleep).run()
    152152
    153153    @classmethod
  • trunk/Tools/Scripts/webkitpy/tool/commands/queuestest.py

    r140510 r143109  
    3838
    3939class MockQueueEngine(object):
    40     def __init__(self, name, queue, wakeup_event):
     40    def __init__(self, name, queue, wakeup_event, seconds_to_sleep):
    4141        pass
    4242
  • trunk/Tools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py

    r139592 r143109  
    3838        options = MockOptions()
    3939        options.ensure_value("confirm", False)
     40        options.ensure_value("seconds_to_sleep", 120)
    4041        sheriffbot = SheriffBot()
    4142        sheriffbot.execute(options, [], tool, MockQueueEngine)
  • trunk/Tools/Scripts/webkitpy/tool/main.py

    r138775 r143109  
    4949        make_option("--bot-id", action="store", dest="bot_id", type="string", help="Identifier for this bot (if multiple bots are running for a queue)"),
    5050        make_option("--irc-password", action="store", dest="irc_password", type="string", help="Password to use when communicating via IRC."),
     51        make_option("--seconds-to-sleep", action="store", default=120, type="int", help="Number of seconds to sleep in the task queue."),
    5152        make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, qt, gtk, ...)."),
    5253    ]
Note: See TracChangeset for help on using the changeset viewer.