Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: appengine/findit/handlers/trigger_analyses.py

Issue 2425453002: [Findit] Process analysis requests of Waterfall failures concurrently. (Closed)
Patch Set: fix nit. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/handlers/test/trigger_analyses_test.py ('k') | appengine/findit/main.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/handlers/trigger_analyses.py
diff --git a/appengine/findit/handlers/trigger_analyses.py b/appengine/findit/handlers/trigger_analyses.py
deleted file mode 100644
index f08f1ca8bf2c77e4a658d6cb5b7c2f4391ed9c0b..0000000000000000000000000000000000000000
--- a/appengine/findit/handlers/trigger_analyses.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import json
-
-from common import constants
-from common.base_handler import BaseHandler
-from common.base_handler import Permission
-from common.http_client_appengine import HttpClientAppengine
-from waterfall import buildbot
-from waterfall import build_failure_analysis_pipelines
-from waterfall import build_util
-
-
-def _TriggerNewAnalysesOnDemand(builds):
- for build in builds:
- master_name = build['master_name']
- builder_name = build['builder_name']
- build_number = build['build_number']
- failed_steps = build.get('failed_steps')
-
- # TODO(stgao): make builder_alerts send information of whether a build
- # is completed.
- build = build_util.DownloadBuildData(
- master_name, builder_name, build_number)
- if not build or not build.data:
- continue # Skip the build, wait for next request to recheck.
-
- build_info = buildbot.ExtractBuildInfo(
- master_name, builder_name, build_number, build.data)
-
- build_failure_analysis_pipelines.ScheduleAnalysisIfNeeded(
- master_name, builder_name, build_number, failed_steps=failed_steps,
- build_completed=build_info.completed,
- force=False, queue_name=constants.WATERFALL_ANALYSIS_QUEUE)
-
-
-class TriggerAnalyses(BaseHandler):
- """Triggers new analyses on demand.
-
- This handler checks the build failures in the request, and triggers new
- analyes for a build in two situations:
- 1. A new step failed.
- 2. The build became completed after last analysis. This will potentially
- trigger a try-job run.
- """
-
- PERMISSION_LEVEL = Permission.ADMIN
-
- def HandlePost(self):
- builds = json.loads(self.request.body).get('builds', [])
- _TriggerNewAnalysesOnDemand(builds)
« no previous file with comments | « appengine/findit/handlers/test/trigger_analyses_test.py ('k') | appengine/findit/main.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698