Changeset 51264 in webkit
- Timestamp:
- Nov 20, 2009 5:02:41 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r51263 r51264 1 2009-11-20 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Teach the StatusBot how to support more than just the commit-queue 6 https://bugs.webkit.org/show_bug.cgi?id=31754 7 8 * CommitQueueStatus/index.yaml: 9 - Add indices required for the new queries. 10 * CommitQueueStatus/queue_status.py: 11 - Add a patch-status page and move update_status to update-status. 12 - Only display "commit-queue" status records for the commit-queue. 13 - Add support for a queue_name property on status records. 14 - Fix _int_from_request to actually work. 15 * CommitQueueStatus/update_status.html: 16 - Add support for a queue_name on status records. 17 - Remove unused list of bug ids. 18 * Scripts/modules/commands/queues.py 19 - Make the queues pass the patch instead of the bug_id to StatusBot. 20 * Scripts/modules/statusbot.py: 21 - Support passing the queue_name to the status updates. 22 - Support fetching patch status with patch_status(). 23 * Scripts/modules/workqueue.py: 24 - Pass the patch to the StatusBot instead of the bug_id. 25 - Let WorkQueues have a name. 26 1 27 2009-11-20 Adam Barth <abarth@webkit.org> 2 28 -
trunk/WebKitTools/CommitQueueStatus/index.yaml
r48730 r51264 10 10 # automatically uploaded to the admin console when you next deploy 11 11 # your application using appcfg.py. 12 13 - kind: QueueStatus 14 properties: 15 - name: active_patch_id 16 - name: queue_name 17 - name: date 18 direction: desc 19 20 - kind: QueueStatus 21 properties: 22 - name: queue_name 23 - name: date 24 direction: desc -
trunk/WebKitTools/CommitQueueStatus/queue_status.py
r48730 r51264 42 42 webapp.template.register_template_library('filters.webkit_extras') 43 43 44 44 45 class QueueStatus(db.Model): 45 46 author = db.UserProperty() 47 queue_name = db.StringProperty() 46 48 active_bug_id = db.IntegerProperty() 47 49 active_patch_id = db.IntegerProperty() … … 49 51 date = db.DateTimeProperty(auto_now_add=True) 50 52 53 51 54 class MainPage(webapp.RequestHandler): 52 55 def get(self): 53 statuses_query = QueueStatus.all(). order('-date')56 statuses_query = QueueStatus.all().filter('queue_name =', 'commit-queue').order('-date') 54 57 statuses = statuses_query.fetch(6) 58 if not statuses: 59 return self.response.out.write("No status to report.") 55 60 template_values = { 56 61 'last_status' : statuses[0], … … 58 63 } 59 64 self.response.out.write(template.render('index.html', template_values)) 65 66 67 class PatchStatus(webapp.RequestHandler): 68 def get(self, queue_name, attachment_id): 69 statuses = QueueStatus.all().filter('queue_name =', queue_name).filter('active_patch_id =', attachment_id).order('-date') 70 if not statuses: 71 self.error(404) 72 self.response.out.write(statuses[0].message) 73 60 74 61 75 class UpdateStatus(webapp.RequestHandler): … … 67 81 try: 68 82 int_value = int(string_value) 83 return int_value 69 84 except ValueError, TypeError: 70 85 pass … … 77 92 queue_status.author = users.get_current_user() 78 93 94 queue_name = self.request.get('queue_name') 95 queue_status.queue_name = queue_name 79 96 queue_status.active_bug_id = self._int_from_request('bug_id') 80 97 queue_status.active_patch_id = self._int_from_request('patch_id') … … 83 100 self.redirect('/') 84 101 102 85 103 routes = [ 86 104 ('/', MainPage), 87 ('/update_status', UpdateStatus) 105 ('/update-status', UpdateStatus), 106 (r'/patch-status/(.*)/(.*)', PatchStatus), 88 107 ] 89 108 -
trunk/WebKitTools/CommitQueueStatus/update_status.html
r48730 r51264 1 Update the current status of the commit-queue:2 1 <form name="update_status" method="post"> 2 Update status for a queue: <input name="queue_name"> 3 3 <div> 4 4 Active Bug Id: … … 9 9 <input name="patch_id"> 10 10 </div> 11 <div>12 Space separated list of other bugs in queue:13 <input name="bugs_in_queue">14 </div>15 11 <div> 12 Status Text:<br> 16 13 <textarea name="status" rows="3" cols="60"></textarea> 17 14 </div> -
trunk/WebKitTools/Scripts/modules/commands/queues.py
r51263 r51264 107 107 self.options = options 108 108 self.tool = tool 109 work_queue = WorkQueue(self )109 work_queue = WorkQueue(self, self.name) 110 110 work_queue.run() 111 111 … … 132 132 red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names. 133 133 return (False, "Builders [%s] are red. See http://build.webkit.org." % ", ".join(red_builders_names), None) 134 return (True, "Landing patch %s from bug %s." % (patch["id"], patch["bug_id"]), patch ["bug_id"])134 return (True, "Landing patch %s from bug %s." % (patch["id"], patch["bug_id"]), patch) 135 135 136 136 def process_work_item(self, patch): … … 173 173 174 174 def should_proceed_with_work_item(self, patch): 175 return (True, "Checking style for patch %s on bug %s." % (patch["id"], patch["bug_id"]), patch ["bug_id"])175 return (True, "Checking style for patch %s on bug %s." % (patch["id"], patch["bug_id"]), patch) 176 176 177 177 def process_work_item(self, patch): … … 194 194 except ScriptError, e: 195 195 return (False, "Unable to perform a build.", None) 196 return (True, "Building patch %s on bug %s." % (patch["id"], patch["bug_id"]), patch ["bug_id"])196 return (True, "Building patch %s on bug %s." % (patch["id"], patch["bug_id"]), patch) 197 197 198 198 def process_work_item(self, patch): -
trunk/WebKitTools/Scripts/modules/statusbot.py
r51018 r51264 47 47 exit(1) 48 48 49 import urllib2 50 51 49 52 class StatusBot: 50 53 default_host = "webkit-commit-queue.appspot.com" … … 53 56 self.statusbot_host = host 54 57 self.statusbot_server_url = "http://%s" % self.statusbot_host 55 self.update_status_url = "%s/update_status" % self.statusbot_server_url56 58 self.browser = Browser() 57 59 58 def update_status(self, status, bug_id=None, patch_id=None):60 def update_status(self, queue_name, status, patch): 59 61 # During unit testing, statusbot_host is None 60 62 if not self.statusbot_host: 61 63 return 62 self.browser.open(self.update_status_url) 64 65 update_status_url = "%s/update-status" % self.statusbot_server_url 66 self.browser.open(update_status_url) 63 67 self.browser.select_form(name="update_status") 64 if bug_id: 65 self.browser['bug_id'] = str(bug_id) 66 if patch_id: 67 self.browser['patch_id'] = str(patch_id) 68 self.browser['queue_name'] = queue_name 69 if patch: 70 if patch.get('bug_id'): 71 self.browser['bug_id'] = str(patch['bug_id']) 72 if patch.get('id'): 73 self.browser['patch_id'] = str(patch['id']) 68 74 self.browser['status'] = status 69 75 self.browser.submit() 76 77 def patch_status(self, queue_name, patch_id): 78 update_status_url = "%s/patch-status/%s/%s" % (self.statusbot_server_url, queue_name, patch_id) 79 try: 80 return urllib2.urlopen(update_status_url).read() 81 except urllib2.HTTPError, e: 82 if e.code == 404: 83 return None 84 raise e -
trunk/WebKitTools/Scripts/modules/workqueue.py
r51031 r51264 39 39 40 40 class WorkQueueDelegate: 41 def queue_name(self): 42 raise NotImplementedError, "subclasses must implement" 43 41 44 def queue_log_path(self): 42 45 raise NotImplementedError, "subclasses must implement" … … 58 61 59 62 def should_proceed_with_work_item(self, work_item): 60 # returns (safe_to_proceed, waiting_message, bug_id)63 # returns (safe_to_proceed, waiting_message, patch) 61 64 raise NotImplementedError, "subclasses must implement" 62 65 … … 69 72 70 73 class WorkQueue: 71 def __init__(self, delegate): 74 def __init__(self, name, delegate): 75 self._name = name 72 76 self._delegate = delegate 73 77 self._output_tee = OutputTee() … … 96 100 self._update_status_and_sleep("Empty queue.") 97 101 continue 98 (safe_to_proceed, waiting_message, bug_id) = self._delegate.should_proceed_with_work_item(work_item)102 (safe_to_proceed, waiting_message, patch) = self._delegate.should_proceed_with_work_item(work_item) 99 103 if not safe_to_proceed: 100 104 self._update_status_and_sleep(waiting_message) 101 105 continue 102 self.status_bot.update_status( waiting_message, bug_id=bug_id)106 self.status_bot.update_status(self._name, waiting_message, patch) 103 107 except Exception, e: 104 108 # Don't try tell the status bot, in case telling it causes an exception.
Note: See TracChangeset
for help on using the changeset viewer.