Пример #1
0
def _CheckFYIBisectJob(job, issue_tracker):
    bisect_results = _GetBisectResults(job)
    if not bisect_results:
        logging.info(
            'Bisect FYI: [%s] No bisect results, job might be pending.',
            job.job_name)
        return
    logging.info('Bisect FYI: [%s] Bisect job status: %s.', job.job_name,
                 bisect_results['status'])
    try:
        if bisect_results['status'] == 'Completed':
            _PostSucessfulResult(job, bisect_results, issue_tracker)
            # Below in VerifyBisectFYIResults we verify whether the actual
            # results matches with the expectations; if they don't match then
            # bisect_results['status'] gets set to 'Failure'.
            bisect_fyi.VerifyBisectFYIResults(job, bisect_results)
        elif 'Failure' in bisect_results['status']:
            _PostFailedResult(job,
                              bisect_results,
                              issue_tracker,
                              add_bug_comment=True)
            bisect_results[
                'errors'] = 'Bisect FYI job failed:\n%s' % bisect_results
    except BugUpdateFailure as e:
        bisect_results['status'] = 'Failure'
        bisect_results['error'] = 'Bug update Failed: %s' % e
    finally:
        _SendFYIBisectEmail(job, bisect_results)
        job.key.delete()
Пример #2
0
def _CheckFYIBisectJob(job, issue_tracker):
    try:
        if not job.buildbucket_job_id:
            job.key.delete()
            return

        if not job.results_data:
            raise BisectJobFailure(
                'Bisect job completed, but results data is not '
                'found, bot might have failed to post results.')
        # FAILED implies failed or cancelled jobs.
        if job.status == FAILED:
            raise BisectJobFailure(
                _BUILD_FAILURE_REASON.get(
                    job.results_data.get('failure_reason'), 'Unknown'))
        error_message = bisect_fyi.VerifyBisectFYIResults(job)
        _PostSuccessfulResult(job, issue_tracker)
        if not bisect_fyi.IsBugUpdated(job, issue_tracker):
            error_message += '\nFailed to update bug with bisect results.'
    except BisectJobFailure as e:
        error_message = 'Bisect job failed because, %s' % e
    except BugUpdateFailure as e:
        error_message = 'Failed to update bug with bisect results: %s' % e
    except Exception as e:  # pylint: disable=broad-except
        error_message = 'Failed to update bug with bisect results: %s' % e
    finally:
        if ((job.results_data and job.results_data.get('status') == FAILED)
                or error_message):
            job.SetFailed()
            _SendFYIBisectEmail(job, error_message)
def _CheckFYIBisectJob(job, issue_tracker):
    try:
        if job.use_buildbucket and not job.buildbucket_job_id:
            job.key.delete()
            return

        if not _IsBisectJobCompleted(job):
            return
        if not job.results_data:
            raise BisectJobFailure(
                'Bisect job completed, but results data is not '
                'found, bot might have failed to post results.')
        error_message = bisect_fyi.VerifyBisectFYIResults(job)
        _PostSuccessfulResult(job, issue_tracker)
        if not bisect_fyi.IsBugUpdated(job, issue_tracker):
            error_message += '\nFailed to update bug with bisect results.'
    except BisectJobFailure as e:
        error_message = 'Bisect job failed because, %s' % e
    except BugUpdateFailure as e:
        error_message = 'Failed to update bug with bisect results: %s' % e
    finally:
        job_info = buildbucket_service.GetJobStatus(job.buildbucket_job_id)
        job_info = job_info.get('build', {})
        if not job.results_data:
            job.results_data = {}
        job.results_data['buildbot_log_url'] = str(job_info.get('url'))

    # When the job fails before getting to the point where it post bisect results
    # to the dashboard, the tryjob's results_data is not set.
    # As a special case for Bisect FYI jobs, we query buildbucket to get the
    # bisect job's status.
    if ((job.results_data and job.results_data.get('status') == FAILED)
            or error_message):
        job.SetFailed()
        _SendFYIBisectEmail(job, error_message)
Пример #4
0
def _CheckFYIBisectJob(job, issue_tracker):
    try:
        _PostResult(job, issue_tracker)
        error_message = bisect_fyi.VerifyBisectFYIResults(job)
        if not bisect_fyi.IsBugUpdated(job, issue_tracker):
            error_message += '\nFailed to update bug with bisect results.'
    except BugUpdateFailure as e:
        error_message = 'Failed to update bug with bisect results: %s' % e
    if job.results_data['status'] == FAILED or error_message:
        _SendFYIBisectEmail(job, error_message)
Пример #5
0
def _CheckFYIBisectJob(job, issue_tracker):
  try:
    if not _IsBisectJobCompleted(job):
      return
    error_message = bisect_fyi.VerifyBisectFYIResults(job)
    _PostResult(job, issue_tracker)
    if not bisect_fyi.IsBugUpdated(job, issue_tracker):
      error_message += '\nFailed to update bug with bisect results.'
  except BisectJobFailure as e:
    error_message = 'Bisect job failed because, %s' % e
  except BugUpdateFailure as e:
    error_message = 'Failed to update bug with bisect results: %s' % e
  if job.results_data['status'] == FAILED or error_message:
    job.SetFailed()
    _SendFYIBisectEmail(job, error_message)