Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from common import constants | |
| 5 from common.base_handler import BaseHandler | 6 from common.base_handler import BaseHandler |
| 6 from common.base_handler import Permission | 7 from common.base_handler import Permission |
| 8 from waterfall.flake.initialize_flake_pipeline import ScheduleAnalysisIfNeeded | |
| 9 | |
| 10 from google.appengine.api import users | |
|
chanli
2016/07/27 21:52:18
This import should be at the top and in a separate
caiw
2016/07/27 23:27:11
Done.
| |
| 7 | 11 |
| 8 | 12 |
| 9 class CheckFlake(BaseHandler): | 13 class CheckFlake(BaseHandler): |
| 10 PERMISSION_LEVEL = Permission.CORP_USER | 14 PERMISSION_LEVEL = Permission.CORP_USER |
| 11 | 15 |
| 12 def HandleGet(self): | 16 def HandleGet(self): |
| 13 | |
| 14 # Get input parameters. | 17 # Get input parameters. |
| 15 # pylint: disable=W0612 | 18 # pylint: disable=W0612 |
| 16 master_name = self.request.get('master_name').strip() | 19 master_name = self.request.get('master_name').strip() |
| 17 builder_name = self.request.get('builder_name').strip() | 20 builder_name = self.request.get('builder_name').strip() |
| 18 build_number = int(self.request.get('build_number').strip()) | 21 build_number = int(self.request.get('build_number').strip()) |
| 19 test_target_name = self.request.get('test_target_name').strip() | 22 step_name = self.request.get('test_target_name').strip() |
| 20 testcase = self.request.get('testcase').strip() | 23 test_name = self.request.get('test_name').strip() |
| 24 force = (users.is_current_user_admin() and | |
| 25 self.request.get('force') == '1') | |
| 21 | 26 |
| 22 # TODO(caiw): Get status of master_analysis from database. | 27 ScheduleAnalysisIfNeeded(master_name, builder_name, build_number, step_name, |
| 23 | 28 test_name, force=force, |
| 24 # TODO(caiw): If there is a completed master_analysis, return | 29 queue_name=constants.WATERFALL_ANALYSIS_QUEUE) |
| 25 # the template which displays it. | 30 return { |
| 26 | 31 'template': 'flake/result.html' |
| 27 # TODO(caiw): If the current master_analysis has an error, | 32 } |
| 28 # delete it. | |
| 29 | |
| 30 # TODO(caiw): If there is no master_analysis, create one. | |
| 31 | |
| 32 # TODO(caiw): Trigger pipeline. | |
| 33 | |
| 34 # TODO(caiw): Return the appropriate template based on the case. | |
| OLD | NEW |