| 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 """Presubmit script for //content/browser/frame_host. | 4 """Presubmit script for //content/browser/frame_host. |
| 5 | 5 |
| 6 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 6 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 7 for more details about the presubmit API built into depot_tools. | 7 for more details about the presubmit API built into depot_tools. |
| 8 """ | 8 """ |
| 9 | 9 |
| 10 import re | 10 import re |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 # out a way to augment the default set. | 26 # out a way to augment the default set. |
| 27 return {} | 27 return {} |
| 28 | 28 |
| 29 | 29 |
| 30 def PostUploadHook(cl, change, output_api): | 30 def PostUploadHook(cl, change, output_api): |
| 31 """git cl upload will call this hook after the issue is created/modified. | 31 """git cl upload will call this hook after the issue is created/modified. |
| 32 | 32 |
| 33 This hook adds extra try bots to the CL description in order to run site | 33 This hook adds extra try bots to the CL description in order to run site |
| 34 isolation tests in addition to CQ try bots. | 34 isolation tests in addition to CQ try bots. |
| 35 """ | 35 """ |
| 36 rietveld_obj = cl.RpcServer() | 36 return output_api.EnsureCQIncludeTrybotsAreAdded( |
| 37 issue = cl.issue | 37 cl, |
| 38 description = rietveld_obj.get_description(issue) | 38 [ |
| 39 if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I): | 39 'master.tryserver.chromium.linux:linux_site_isolation' |
| 40 return [] | 40 ], |
| 41 | 41 'Automatically added site isolation trybots to run tests on CQ.') |
| 42 masters = _GetTryMasters(None, change) | |
| 43 results = [] | |
| 44 new_description = description | |
| 45 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join( | |
| 46 '%s:%s' % (master, ','.join(bots)) | |
| 47 for master, bots in masters.iteritems()) | |
| 48 results.append(output_api.PresubmitNotifyResult( | |
| 49 'Automatically added site isolation trybots to run tests on CQ.')) | |
| 50 | |
| 51 rietveld_obj.update_description(issue, new_description) | |
| 52 | |
| 53 return results | |
| OLD | NEW |