 Chromium Code Reviews
 Chromium Code Reviews Issue 14336002:
  Let Blink try jobs use a Blink-specific LKGR  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
    
  
    Issue 14336002:
  Let Blink try jobs use a Blink-specific LKGR  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/tools/build| OLD | NEW | 
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be | 
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. | 
| 4 | 4 | 
| 5 import re | 5 import re | 
| 6 import traceback | 6 import traceback | 
| 7 import sys | 7 import sys | 
| 8 | 8 | 
| 9 from buildbot.process.properties import Properties | 9 from buildbot.process.properties import Properties | 
| 10 from buildbot.schedulers.trysched import TryBase | 10 from buildbot.schedulers.trysched import TryBase | 
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 repository=parsed_job['repository'] or '', | 254 repository=parsed_job['repository'] or '', | 
| 255 changeids=changeids) | 255 changeids=changeids) | 
| 256 | 256 | 
| 257 d.addCallback(self.create_buildset, parsed_job) | 257 d.addCallback(self.create_buildset, parsed_job) | 
| 258 d.addErrback(log.err, "Failed to queue a try job!") | 258 d.addErrback(log.err, "Failed to queue a try job!") | 
| 259 return d | 259 return d | 
| 260 | 260 | 
| 261 def get_lkgr(self, options): | 261 def get_lkgr(self, options): | 
| 262 """Grabs last known good revision number if necessary.""" | 262 """Grabs last known good revision number if necessary.""" | 
| 263 options['rietveld'] = (self.code_review_sites or {}).get(options['project']) | 263 options['rietveld'] = (self.code_review_sites or {}).get(options['project']) | 
| 264 last_good_url = (self.last_good_urls or {}).get(options['project']) | 264 | 
| 265 # TODO: crbug.com/233148 - Only use the blink url for jobs with the blink | |
| 
iannucci
2013/04/19 00:36:20
wrong bug!
 | |
| 266 # project set. This will require us to always set the project in blink | |
| 267 # configs. | |
| 268 project = options['project'] | |
| 269 if project == 'chrome' and all('_layout_' in bot for bot in options['bot']): | |
| 270 project = 'blink' | |
| 271 last_good_url = (self.last_good_urls or {}).get(project) | |
| 272 | |
| 265 if options['revision'] or not last_good_url: | 273 if options['revision'] or not last_good_url: | 
| 266 return defer.succeed(0) | 274 return defer.succeed(0) | 
| 267 | 275 | 
| 268 def Success(result): | 276 def Success(result): | 
| 269 try: | 277 try: | 
| 270 new_value = int(result.strip()) | 278 new_value = int(result.strip()) | 
| 271 except (TypeError, ValueError): | 279 except (TypeError, ValueError): | 
| 272 new_value = None | 280 new_value = None | 
| 273 if new_value and (not self._last_lkgr or new_value > self._last_lkgr): | 281 if new_value and (not self._last_lkgr or new_value > self._last_lkgr): | 
| 274 self._last_lkgr = new_value | 282 self._last_lkgr = new_value | 
| 275 options['revision'] = self._last_lkgr or 'HEAD' | 283 options['revision'] = self._last_lkgr or 'HEAD' | 
| 276 | 284 | 
| 277 def Failure(result): | 285 def Failure(result): | 
| 278 options['revision'] = self._last_lkgr or 'HEAD' | 286 options['revision'] = self._last_lkgr or 'HEAD' | 
| 279 | 287 | 
| 280 connection = client.getPage(last_good_url, agent='buildbot') | 288 connection = client.getPage(last_good_url, agent='buildbot') | 
| 281 connection.addCallbacks(Success, Failure) | 289 connection.addCallbacks(Success, Failure) | 
| 282 return connection | 290 return connection | 
| OLD | NEW |