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

Side by Side Diff: appengine/findit/handlers/config.py

Issue 2438673004: [Findit] Post analysis results of flakes to bug filed by chromium-try-flakes. (Closed)
Patch Set: Add a config flag to enable/disable updating monorail bug. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 """Handles requests to the findit config page.""" 5 """Handles requests to the findit config page."""
6 6
7 import json 7 import json
8 8
9 from common.base_handler import BaseHandler, Permission 9 from common.base_handler import BaseHandler, Permission
10 from model import wf_config 10 from model import wf_config
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 settings.get('cr_notification_latency_limit_minutes'), int)) 184 settings.get('cr_notification_latency_limit_minutes'), int))
185 185
186 186
187 def _ValidateCheckFlakeSettings(settings): 187 def _ValidateCheckFlakeSettings(settings):
188 return (isinstance(settings, dict) and 188 return (isinstance(settings, dict) and
189 isinstance(settings.get('lower_flake_threshold'), float) and 189 isinstance(settings.get('lower_flake_threshold'), float) and
190 isinstance(settings.get('upper_flake_threshold'), float) and 190 isinstance(settings.get('upper_flake_threshold'), float) and
191 isinstance(settings.get('max_flake_in_a_row'), int) and 191 isinstance(settings.get('max_flake_in_a_row'), int) and
192 isinstance(settings.get('max_stable_in_a_row'), int) and 192 isinstance(settings.get('max_stable_in_a_row'), int) and
193 isinstance(settings.get('iterations_to_rerun'), int) and 193 isinstance(settings.get('iterations_to_rerun'), int) and
194 isinstance(settings.get('max_build_numbers_to_look_back'), int)) 194 isinstance(settings.get('max_build_numbers_to_look_back'), int) and
195 isinstance(settings.get('update_monorail_bug'), bool))
195 196
196 197
197 # Maps config properties to their validation functions. 198 # Maps config properties to their validation functions.
198 _CONFIG_VALIDATION_FUNCTIONS = { 199 _CONFIG_VALIDATION_FUNCTIONS = {
199 'steps_for_masters_rules': _ValidateMastersAndStepsRulesMapping, 200 'steps_for_masters_rules': _ValidateMastersAndStepsRulesMapping,
200 'builders_to_trybots': _ValidateTrybotMapping, 201 'builders_to_trybots': _ValidateTrybotMapping,
201 'try_job_settings': _ValidateTryJobSettings, 202 'try_job_settings': _ValidateTryJobSettings,
202 'swarming_settings': _ValidateSwarmingSettings, 203 'swarming_settings': _ValidateSwarmingSettings,
203 'download_build_data_settings': _ValidateDownloadBuildDataSettings, 204 'download_build_data_settings': _ValidateDownloadBuildDataSettings,
204 'action_settings': _ValidateActionSettings, 205 'action_settings': _ValidateActionSettings,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 new_config_dict = json.loads(data) 281 new_config_dict = json.loads(data)
281 if not _ConfigurationDictIsValid(new_config_dict): # pragma: no cover 282 if not _ConfigurationDictIsValid(new_config_dict): # pragma: no cover
282 return self.CreateError( 283 return self.CreateError(
283 'New configuration settings is not properly formatted.', 400) 284 'New configuration settings is not properly formatted.', 400)
284 285
285 wf_config.FinditConfig.Get().Update(users.get_current_user(), 286 wf_config.FinditConfig.Get().Update(users.get_current_user(),
286 users.IsCurrentUserAdmin(), 287 users.IsCurrentUserAdmin(),
287 **new_config_dict) 288 **new_config_dict)
288 289
289 return self.HandleGet() 290 return self.HandleGet()
OLDNEW
« no previous file with comments | « appengine/findit/common/appengine_util.py ('k') | appengine/findit/handlers/flake/check_flake.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698