Changeset 48730 in webkit


Ignore:
Timestamp:
Sep 24, 2009 1:40:58 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-09-17 Eric Seidel <eric@webkit.org>

Reviewed by David Levin.

commit-queue needs web-based status reporting
https://bugs.webkit.org/show_bug.cgi?id=29307

Add a first-pass web-based status for the commit-queue.
The bot is currently reachable at:
http://webkit-commit-queue.appspot.com/

  • CommitQueueStatus/app.yaml: Added.
    • Application description file required by App Engine.
  • CommitQueueStatus/filters/init.py: Added.
    • Required by python to treat 'filters' as a module.
  • CommitQueueStatus/filters/webkit_extras.py: Added.
    • Support for turning 'bug 123' and 'patch 123' into links. This lets us use plain text strings in our logs yet display nice HTML (help prevent XSS attacks on the page).
  • CommitQueueStatus/index.html: Added.
  • CommitQueueStatus/index.yaml: Added.
    • Some auto-generated file from app engine.
  • CommitQueueStatus/queue_status.py: Added.
    • The core logic of this bot. We could eventually split this file out into pieces.
  • CommitQueueStatus/stylesheets/main.css: Added.
    • Some basic lame-o CSS to make the page look less awful.
  • CommitQueueStatus/update_status.html: Added.
    • The form that the commit-queue (or a human) can use to update the status.
  • Scripts/bugzilla-tool:
    • Add some very basic update_status calls.
  • Scripts/modules/statusbot.py: Added.
    • Knows how to post to the CommitQueueStatus web application.
Location:
trunk/WebKitTools
Files:
12 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r48722 r48730  
     12009-09-17  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by David Levin.
     4
     5        commit-queue needs web-based status reporting
     6        https://bugs.webkit.org/show_bug.cgi?id=29307
     7
     8        Add a first-pass web-based status for the commit-queue.
     9        The bot is currently reachable at:
     10        http://webkit-commit-queue.appspot.com/
     11
     12        * CommitQueueStatus/app.yaml: Added.
     13         - Application description file required by App Engine.
     14        * CommitQueueStatus/filters/__init__.py: Added.
     15         - Required by python to treat 'filters' as a module.
     16        * CommitQueueStatus/filters/webkit_extras.py: Added.
     17         - Support for turning 'bug 123' and 'patch 123' into links.
     18           This lets us use plain text strings in our logs yet display nice HTML (help prevent XSS attacks on the page).
     19        * CommitQueueStatus/index.html: Added.
     20        * CommitQueueStatus/index.yaml: Added.
     21         - Some auto-generated file from app engine.
     22        * CommitQueueStatus/queue_status.py: Added.
     23         - The core logic of this bot.  We could eventually split this file out into pieces.
     24        * CommitQueueStatus/stylesheets/main.css: Added.
     25         - Some basic lame-o CSS to make the page look less awful.
     26        * CommitQueueStatus/update_status.html: Added.
     27         - The form that the commit-queue (or a human) can use to update the status.
     28        * Scripts/bugzilla-tool:
     29         - Add some very basic update_status calls.
     30        * Scripts/modules/statusbot.py: Added.
     31         - Knows how to post to the CommitQueueStatus web application.
     32
    1332009-09-24  David Kilzer  <ddkilzer@apple.com>
    234
  • trunk/WebKitTools/Scripts/bugzilla-tool

    r48700 r48730  
    3838import time
    3939
    40 from datetime import datetime
     40from datetime import datetime, timedelta
    4141from optparse import OptionParser, IndentedHelpFormatter, SUPPRESS_USAGE, make_option
    4242
     
    4848from modules.scm import CommitMessage, detect_scm_system, ScriptError
    4949from modules.buildbot import BuildBot
     50from modules.statusbot import StatusBot
    5051
    5152def plural(noun):
     
    626627        options = [
    627628            make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Do not ask the user for confirmation before running the queue.  Dangerous!"),
     629            make_option("--status-host", action="store", type="string", dest="status_host", default=StatusBot.default_host, help="Do not ask the user for confirmation before running the queue.  Dangerous!"),
    628630        ]
    629631        Command.__init__(self, 'Run the commit queue.', options=options)
     
    634636    queue_log_path = 'commit_queue.log'
    635637    bug_logs_directory = 'commit_queue_logs'
     638
     639    log_date_format = "%Y-%m-%d %H:%M:%S"
     640    sleep_duration_text = "5 mins"
     641    seconds_to_sleep = 300
    636642
    637643    def _tee_outputs_to_files(self, files):
     
    646652            sys.stderr = self._original_stderr
    647653
    648     @staticmethod
    649     def _sleep(log_message):
    650         log("%s  Sleeping 5 minutes... %s" % (log_message, datetime.now()))
    651         time.sleep(300) # Wait 5 minutes
     654    @classmethod
     655    def _sleep_message(cls, message):
     656        wake_time = datetime.now() + timedelta(seconds=cls.seconds_to_sleep)
     657        return "%s Sleeping until %s (%s)." % (message, wake_time.strftime(cls.log_date_format), cls.sleep_duration_text)
     658
     659    @classmethod
     660    def _sleep(cls, message):
     661        log(cls._sleep_message(message))
     662        time.sleep(cls.seconds_to_sleep)
     663
     664    def _update_status_and_sleep(self, message):
     665        status_message = self._sleep_message(message)
     666        self.status_bot.update_status(status_message)
     667        log(status_message)
     668        time.sleep(self.seconds_to_sleep)
    652669
    653670    @staticmethod
     
    687704
    688705        queue_log = self._add_log_to_output_tee(self.queue_log_path)
    689         log("Running WebKit Commit Queue. %s" % datetime.now())
     706        log("Running WebKit Commit Queue. %s" % datetime.now().strftime(self.log_date_format))
     707
     708        self.status_bot = StatusBot(host=options.status_host)
    690709
    691710        while (True):
     
    696715                patches = tool.bugs.fetch_patches_from_commit_queue(reject_invalid_patches=True)
    697716                if not len(patches):
    698                     self._sleep("Empty queue.")
     717                    self._update_status_and_sleep("Empty queue.")
    699718                    continue
    700719                patch_ids = map(lambda patch: patch['id'], patches)
     
    703722
    704723                if not tool.buildbot.core_builders_are_green():
    705                     self._sleep("Builders are red.")
     724                    self._update_status_and_sleep("Builders (http://build.webkit.org) are red.")
    706725                    continue
     726
     727                self.status_bot.update_status("Landing patches from bug %s." % first_bug_id, bug_id=first_bug_id)
    707728            except Exception, e:
     729                # Don't try tell the status bot, in case telling it causes an exception.
    708730                self._sleep("Exception while checking queue and bots: %s." % e)
    709731                continue
     
    716738            self._remove_log_from_output_tee(bug_log)
    717739
    718         log("Finished WebKit Commit Queue. %s" % datetime.now())
     740        log("Finished WebKit Commit Queue. %s" % datetime.now().strftime(self.log_date_format))
    719741        self._remove_log_from_output_tee(queue_log)
    720742
Note: See TracChangeset for help on using the changeset viewer.