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

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

Issue 1898493002: [Findit] Adding support for disabling test try jobs for given master/builder (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 8 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 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 9 from common.base_handler import BaseHandler
10 from common.base_handler import Permission 10 from common.base_handler import Permission
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return False 134 return False
135 for trybot_config in builders.values(): 135 for trybot_config in builders.values():
136 if not isinstance(trybot_config, dict): 136 if not isinstance(trybot_config, dict):
137 return False 137 return False
138 if (not trybot_config.get('mastername') or 138 if (not trybot_config.get('mastername') or
139 not trybot_config.get('buildername')): 139 not trybot_config.get('buildername')):
140 return False 140 return False
141 if (trybot_config.has_key('strict_regex') and 141 if (trybot_config.has_key('strict_regex') and
142 not isinstance(trybot_config['strict_regex'], bool)): 142 not isinstance(trybot_config['strict_regex'], bool)):
143 return False 143 return False
144 if (trybot_config.has_key('enable_tests') and
stgao 2016/04/16 01:04:04 Is seems we only want to set this field to disable
lijeffrey 2016/04/16 02:57:27 Done.
145 not isinstance(trybot_config['enable_tests'], bool)):
146 return False
144 return True 147 return True
145 148
146 149
147 def _ValidateTryJobSettings(settings): 150 def _ValidateTryJobSettings(settings):
148 return (isinstance(settings, dict) and 151 return (isinstance(settings, dict) and
149 isinstance(settings.get('server_query_interval_seconds'), int) and 152 isinstance(settings.get('server_query_interval_seconds'), int) and
150 isinstance(settings.get('job_timeout_hours'), int) and 153 isinstance(settings.get('job_timeout_hours'), int) and
151 isinstance(settings.get('allowed_response_error_times'), int)) 154 isinstance(settings.get('allowed_response_error_times'), int))
152 155
153 156
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 new_config_dict = json.loads(data) 246 new_config_dict = json.loads(data)
244 if not _ConfigurationDictIsValid(new_config_dict): # pragma: no cover 247 if not _ConfigurationDictIsValid(new_config_dict): # pragma: no cover
245 return self.CreateError( 248 return self.CreateError(
246 'New configuration settings is not properly formatted.', 400) 249 'New configuration settings is not properly formatted.', 400)
247 250
248 wf_config.FinditConfig.Get().Update(users.get_current_user(), 251 wf_config.FinditConfig.Get().Update(users.get_current_user(),
249 users.IsCurrentUserAdmin(), 252 users.IsCurrentUserAdmin(),
250 **new_config_dict) 253 **new_config_dict)
251 254
252 return self.HandleGet() 255 return self.HandleGet()
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/handlers/test/config_test.py » ('j') | appengine/findit/waterfall/try_job_util.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698