예제 #1
0
def main():
    parser = optparse.OptionParser(description=sys.modules['__main__'].__doc__)
    parser.add_option('-d', '--delay', default=3 * 60 * 60, type='int')
    parser.add_option('-u', '--user')
    parser.add_option('-v', '--verbose', action='store_true')
    options, args = parser.parse_args(None)
    if options.verbose:
        logging.basicConfig(level=logging.DEBUG)
    else:
        logging.basicConfig(level=logging.ERROR)
    if len(args) != 1:
        parser.error('Need 1 arg')

    url = args[0].rstrip('/') + '/'
    if not 'http' in url:
        url = 'http://' + url
    obj = rietveld.Rietveld(args[0], options.user, None)
    notified = []
    while True:
        now = time.time()
        earliest = now - options.delay
        for issue in obj.search(commit='1', closed='2'):
            print '%d' % issue['issue']
            if issue['issue'] in notified:
                continue
            if (not issue['base_url']
                    or to_epoch(issue['modified']) < earliest):
                data = ['%s%d' % (url, issue['issue']), issue['base_url']]
                breakpad.SendStack(str(now), data)
                notified.append(issue['issue'])
        time.sleep(5 * 60)
    return 0
예제 #2
0
파일: gcl.py 프로젝트: miaosf/depot_tools
def OptionallyDoPresubmitChecks(change_info, committing, args):
  if FilterFlag(args, "--no_presubmit") or FilterFlag(args, "--force"):
    breakpad.SendStack(
        breakpad.DEFAULT_URL + '/breakpad',
        'GclHooksBypassedCommit',
        'Issue %s/%s bypassed hook when committing' %
        (change_info.rietveld, change_info.issue),
        verbose=False)
    return presubmit_support.PresubmitOutput()
  return DoPresubmitChecks(change_info, committing, True)
예제 #3
0
 def verify(self, pending):
     matches = filter(None, (re.match(r, pending.base_url)
                             for r in self.project_bases))
     if not matches:
         logging.info('%s not in whitelist' % pending.base_url)
         state = base.IGNORED
     else:
         if len(matches) != 1:
             breakpad.SendStack(
                 Exception('pending.base_url triggered multiple matches'),
                 '')
         match = matches[0]
         if match.lastindex:
             pending.relpath = match.group(
                 match.lastindex).lstrip('/').replace('/', os.sep)
         state = base.SUCCEEDED
     pending.verifications[self.name] = base.SimpleStatus(state)
예제 #4
0
 def _check(self, obj, result):
     self._part_1_setup_mocks(result)
     self.mox.ReplayAll()
     breakpad.SendStack(obj, 'bar')
     self._part_2_verify_stdout(result)
예제 #5
0
def send_stack(e):
    breakpad.SendStack(e,
                       ''.join(traceback.format_tb(sys.exc_info()[2])),
                       maxlen=2000)