예제 #1
0
  def get(self):
    """The get handler method is called from a cron job.

    It expects no parameters and has no output. It checks all current bisect try
    jobs and send comments to an issue on the issue tracker if a bisect job has
    completed.
    """
    issue_tracker = issue_tracker_service.IssueTrackerService(
        utils.ServiceAccountHttp())

    # Set privilege so we can also fetch internal try_job entities.
    datastore_hooks.SetPrivilegedRequest()

    jobs_to_check = try_job.TryJob.query(
        try_job.TryJob.status.IN(['started', 'pending'])).fetch()
    all_successful = True

    for job in jobs_to_check:
      try:
        _CheckJob(job, issue_tracker)
      except Exception as e:  # pylint: disable=broad-except
        logging.error('Caught Exception %s: %s\n%s',
                      type(e).__name__, e, traceback.format_exc())
        all_successful = False

    if all_successful:
      utils.TickMonitoringCustomMetric('UpdateBugWithResults')
예제 #2
0
 def post(self):
     """Runs auto bisects."""
     if 'stats' in self.request.query_string:
         self.RenderHtml('result.html', _PrintStartedAndFailedBisectJobs())
         return
     datastore_hooks.SetPrivilegedRequest()
     if _RestartFailedBisectJobs():
         utils.TickMonitoringCustomMetric('RestartFailedBisectJobs')
예제 #3
0
  def post(self):
    """Performs any automatic triaging operations.

    This will include updating Anomaly entities, and checking whether they
    should be marked as "recovered", as well as updating Bug entities, and
    commenting on the issue tracker if all alerts for a bug are recovered.
    """
    datastore_hooks.SetPrivilegedRequest()

    # Handle task queue requests.
    if self.request.get('update_recovered_bug'):
      bug_id = int(self.request.get('bug_id'))
      TriageBugs.UpdateRecoveredBugs(bug_id)
      return

    logging.info('Triaging anomalies')
    TriageAnomalies.Process()
    utils.TickMonitoringCustomMetric('TriageAnomalies')
    logging.info('Triaging bugs')
    TriageBugs.Process()
    utils.TickMonitoringCustomMetric('TriageBugs')
    logging.info('/auto_triage complete')