Changeset 147984 in webkit


Ignore:
Timestamp:
Apr 8, 2013 11:44:56 PM (11 years ago)
Author:
rniwa@webkit.org
Message:

WKR (new-commit-bot) is too slow
https://bugs.webkit.org/show_bug.cgi?id=110087

Reviewed by Geoffrey Garen.

Running "svn up" or "git svn fetch" is way too slow (takes 2-3 minutes) on the machine I'm running the bot.
Just run "svn log -r <revision>" instead to cut down the delay.

Unfortunately, this work around doesn't work in a git checkout but who cares given I'm the one running the bot.

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

(NewCommitBot):
(NewCommitBot.next_work_item):
(NewCommitBot._is_empty_log):
(NewCommitBot._update_checkout):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r147982 r147984  
     12013-04-08  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        WKR (new-commit-bot) is too slow
     4        https://bugs.webkit.org/show_bug.cgi?id=110087
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Running "svn up" or "git svn fetch" is way too slow (takes 2-3 minutes) on the machine I'm running the bot.
     9        Just run "svn log -r <revision>" instead to cut down the delay.
     10
     11        Unfortunately, this work around doesn't work in a git checkout but who cares given I'm the one running the bot.
     12
     13        * Scripts/webkitpy/tool/commands/newcommitbot.py:
     14        (NewCommitBot):
     15        (NewCommitBot.next_work_item):
     16        (NewCommitBot._is_empty_log):
     17        (NewCommitBot._update_checkout):
     18
    1192013-04-08  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/Tools/Scripts/webkitpy/tool/commands/newcommitbot.py

    r144040 r147984  
    3232
    3333from webkitpy.common.config.committers import CommitterList
     34from webkitpy.common.system.executive import ScriptError
    3435from webkitpy.tool.bot.irc_command import IRCCommand
    3536from webkitpy.tool.bot.irc_command import Help
     
    5758    }
    5859
     60    _maximum_number_of_revisions_to_avoid_spamming_irc = 10
     61
    5962    # AbstractQueue methods
    6063
     
    7376        _log.info('Last SVN revision: %d' % self._last_svn_revision)
    7477
    75         _log.info('Updating checkout')
    76         self._update_checkout()
     78        if self._tool.scm().executable_name != 'svn':
     79            _log.error('This bot only works inside a SVN checkout')
    7780
    78         _log.info('Obtaining new SVN revisions')
    79         revisions = self._new_svn_revisions()
     81        for revision in range(self._last_svn_revision + 1, self._last_svn_revision + self._maximum_number_of_revisions_to_avoid_spamming_irc):
     82            try:
     83                commit_log = self._tool.scm().svn_commit_log(revision)
     84            except ScriptError:
     85                break
     86            if self._is_empty_log(commit_log):
     87                continue
     88            _log.info('Found revision %d' % revision)
     89            self._last_svn_revision = revision
     90            self._tool.irc().post(self._summarize_commit_log(commit_log).encode('utf-8'))
    8091
    81         _log.info('Obtaining commit logs for %d revisions' % len(revisions))
    82         for revision in revisions:
    83             commit_log = self._tool.scm().svn_commit_log(revision)
    84             self._tool.irc().post(self._summarize_commit_log(commit_log).encode('ascii', 'ignore'))
    85 
    86         return
     92    def _is_empty_log(self, commit_log):
     93        return re.match(r'^\-+$', commit_log)
    8794
    8895    def process_work_item(self, failure_map):
     
    9299        tool = self._tool
    93100        tool.executive.run_and_throw_if_fail(tool.deprecated_port().update_webkit_command(), quiet=True, cwd=tool.scm().checkout_root)
    94 
    95     def _new_svn_revisions(self):
    96         scm = self._tool.scm()
    97         current_head = int(scm.head_svn_revision())
    98         first_new_revision = self._last_svn_revision + 1
    99         self._last_svn_revision = current_head
    100         return range(max(first_new_revision, current_head - 20), current_head + 1)
    101101
    102102    _patch_by_regex = re.compile(r'^Patch\s+by\s+(?P<author>.+?)\s+on(\s+\d{4}-\d{2}-\d{2})?\n?', re.MULTILINE | re.IGNORECASE)
Note: See TracChangeset for help on using the changeset viewer.