Changeset 60924 in webkit
- Timestamp:
- Jun 9, 2010 5:28:03 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r60903 r60924 1 2010-06-09 Ojan Vafai <ojan@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 make rietveld upload faster and avoid posting to bug on errors 6 https://bugs.webkit.org/show_bug.cgi?id=40389 7 8 Only grab the first item of the upload queue instead of trying 9 to compute the whole list upfront (which is O(n) bugzilla lookups!). 10 11 Also, don't post comments to the bug when uploading fails. 12 13 * Scripts/webkitpy/common/net/bugzilla.py: 14 * Scripts/webkitpy/tool/commands/queues.py: 15 * Scripts/webkitpy/tool/commands/queues_unittest.py: 16 * Scripts/webkitpy/tool/commands/stepsequence.py: 17 * Scripts/webkitpy/tool/mocktool.py: 18 1 19 2010-06-09 Ojan Vafai <ojan@chromium.org> 2 20 -
trunk/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
r60903 r60924 206 206 207 207 def in_rietveld_queue_patches(self): 208 return [patch for patch in self.patches() if patch.in_rietveld() == "?"] 208 return [patch for patch in self.patches() if ( 209 patch.in_rietveld() == "?" or patch.in_rietveld() == None and patch.review() == "?")] 209 210 210 211 … … 271 272 for bug_id in self.fetch_bug_ids_from_commit_queue()], []) 272 273 273 def _fetch_bug_ids_from_rietveld_queue(self): 274 def _fetch_rietveld_queue_patch(self, query_url): 275 bugs = self._fetch_bug_ids_advanced_query(query_url) 276 if not len(bugs): 277 return None 278 279 patches = self._fetch_bug(bugs[0]).in_rietveld_queue_patches() 280 return patches[0] if len(patches) else None 281 282 def fetch_first_patch_from_rietveld_queue(self): 274 283 # rietveld-queue processes in-rietveld? patches and then marks them in-rietveld-/+. 275 284 # in-rietveld? patches 276 285 rietveld_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=in-rietveld%3F&order=Last+Changed" 277 in_rietveld_bugs = self._fetch_bug_ids_advanced_query(rietveld_queue_url) 286 patch = self._fetch_rietveld_queue_patch(rietveld_queue_url) 287 if patch: 288 return patch 278 289 279 290 # review? patches that don't have an in-rietveld flag. 280 291 review_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=review%3F&field0-1-0=flagtypes.name&type0-1-0=notsubstring&value0-1-0=in-rietveld&order=Last+Changed" 281 in_rietveld_bugs.extend(self._fetch_bug_ids_advanced_query(review_queue_url)) 282 283 return in_rietveld_bugs 284 285 def fetch_patches_from_rietveld_queue(self): 286 return sum([self._fetch_bug(bug_id).in_rietveld_queue_patches() 287 for bug_id in self._fetch_bug_ids_from_rietveld_queue()], []) 292 patch = self._fetch_rietveld_queue_patch(review_queue_url) 293 if patch: 294 return patch 295 296 return None 288 297 289 298 def _fetch_bug_ids_from_review_queue(self): -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
r60903 r60924 290 290 291 291 # StepSequenceErrorHandler methods 292 @staticmethod 293 def _error_message_for_bug(tool, status_id, script_error): 294 if not script_error.output: 295 return script_error.message_with_output() 296 results_link = tool.status_server.results_url_for_status(status_id) 297 return "%s\nFull output: %s" % (script_error.message_with_output(), results_link) 292 298 293 299 @classmethod … … 307 313 308 314 def next_work_item(self): 309 patch es = self.tool.bugs.queries.fetch_patches_from_rietveld_queue()310 if patch es:311 return patch es[0]315 patch_id = self.tool.bugs.queries.fetch_first_patch_from_rietveld_queue() 316 if patch_id: 317 return patch_id 312 318 self._update_status("Empty queue") 313 319 … … 326 332 raise e 327 333 328 def _reject_patch(self, patch, message): 329 comment_text = "Could not upload patch %s to rietveld. Rietveld is down or there's a bug in the upload bot." % patch.id() 330 self.tool.bugs.set_flag_on_attachment(patch.id(), "in-rietveld", "-", comment_text, message) 334 def _reject_patch(self, patch_id, message): 335 self.tool.bugs.set_flag_on_attachment(patch_id, "in-rietveld", "-") 331 336 332 337 def handle_unexpected_error(self, patch, message): 333 self._reject_patch(patch , message)338 self._reject_patch(patch.id(), message) 334 339 335 340 # StepSequenceErrorHandler methods … … 338 343 def handle_script_error(cls, tool, state, script_error): 339 344 status_id = cls._update_status_for_script_error(tool, state, script_error) 340 cls._reject_patch( patch, cls._error_message_for_bug(tool, status_id, script_error))345 cls._reject_patch(state["patch"].id()) 341 346 342 347 -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
r60903 r60924 206 206 "should_proceed_with_work_item": "MOCK: update_status: rietveld-upload-queue Uploading patch\n", 207 207 "process_work_item": "MOCK: update_status: rietveld-upload-queue Pass\n", 208 "handle_unexpected_error": "MOCK setting flag 'in-rietveld' to '-' on attachment '1234' with comment ' Could not upload patch 1234 to rietveld. Rietveld is down or there's a bug in the upload bot.' and additional comment 'Mock error message'\n",208 "handle_unexpected_error": "MOCK setting flag 'in-rietveld' to '-' on attachment '1234' with comment 'None' and additional comment 'None'\n", 209 209 } 210 210 self.assert_queue_outputs(RietveldUploadQueue(), expected_stderr=expected_stderr) -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/stepsequence.py
r60635 r60924 36 36 37 37 class StepSequenceErrorHandler(): 38 # FIXME: StepSequenceErrorHandler is just an interface definition.39 # It shouldn't have any implementations.40 # Create an intermediate class that inherits from StepSequenceErrorHandler41 # that the appropriate queues inherit from.42 @staticmethod43 def _error_message_for_bug(tool, status_id, script_error):44 if not script_error.output:45 return script_error.message_with_output()46 results_link = tool.status_server.results_url_for_status(status_id)47 return "%s\nFull output: %s" % (script_error.message_with_output(), results_link)48 49 38 @classmethod 50 39 def handle_script_error(cls, tool, patch, script_error): -
trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py
r60903 r60924 226 226 return sum([bug.reviewed_patches() for bug in self._all_bugs()], []) 227 227 228 def fetch_patches_from_rietveld_queue(self): 229 return sum([bug.in_rietveld_queue_patches() for bug in self._all_bugs()], []) 228 def fetch_first_patch_from_rietveld_queue(self): 229 for bug in self._all_bugs(): 230 patches = bug.in_rietveld_queue_patches() 231 if len(patches): 232 return patches[0] 233 raise Exception('No patches in the rietveld queue') 230 234 231 235 # FIXME: Bugzilla is the wrong Mock-point. Once we have a BugzillaNetwork
Note: See TracChangeset
for help on using the changeset viewer.