Ejemplo n.º 1
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)
Ejemplo n.º 3
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)
Ejemplo n.º 4
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)