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

Side by Side Diff: appengine/findit/common/waterfall/buildbucket_client.py

Issue 1991333002: [Findit] Send targeted_tests to try-job in build_parameter instend of build_property (Findit side). (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 7 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 """"Serves as a client for selected APIs in Buildbucket.""" 5 """"Serves as a client for selected APIs in Buildbucket."""
6 6
7 import collections 7 import collections
8 import json 8 import json
9 import logging 9 import logging
10 10
(...skipping 16 matching lines...) Expand all
27 name, while Findit uses shortened master name (tryserver.chromium.linux). 27 name, while Findit uses shortened master name (tryserver.chromium.linux).
28 """ 28 """
29 prefix = 'master.' 29 prefix = 'master.'
30 if master_name.startswith(prefix): 30 if master_name.startswith(prefix):
31 return master_name 31 return master_name
32 return '%s%s' % (prefix, master_name) 32 return '%s%s' % (prefix, master_name)
33 33
34 34
35 class TryJob(collections.namedtuple( 35 class TryJob(collections.namedtuple(
36 'TryJobNamedTuple', 36 'TryJobNamedTuple',
37 ('master_name', 'builder_name', 'revision', 'properties', 'tags'))): 37 ('master_name', 'builder_name', 'revision', 'properties', 'tags', 'tests'))
stgao 2016/05/20 05:15:48 How about making this generic enough for other cha
38 ):
38 """Represents a try-job to be triggered through Buildbucket. 39 """Represents a try-job to be triggered through Buildbucket.
39 40
40 Tag for "user_agent" should not be set, as it will be added automatically. 41 Tag for "user_agent" should not be set, as it will be added automatically.
41 """ 42 """
42 43
43 def ToBuildbucketRequest(self): 44 def ToBuildbucketRequest(self):
44 parameters_json = { 45 parameters_json = {
45 'builder_name': self.builder_name, 46 'builder_name': self.builder_name,
46 'properties': self.properties, 47 'properties': self.properties,
47 } 48 }
49 if self.tests:
50 parameters_json['tests'] = self.tests
48 if self.revision: 51 if self.revision:
49 parameters_json['changes'] = [ 52 parameters_json['changes'] = [
50 { 53 {
51 'author': { 54 'author': {
52 'email': _ROLE_EMAIL, 55 'email': _ROLE_EMAIL,
53 }, 56 },
54 'revision': self.revision, 57 'revision': self.revision,
55 }, 58 },
56 ] 59 ]
57 60
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 else: 187 else:
185 error_content = { 188 error_content = {
186 'error': { 189 'error': {
187 'reason': status_code, 190 'reason': status_code,
188 'message': content 191 'message': content
189 } 192 }
190 } 193 }
191 json_results.append(error_content) 194 json_results.append(error_content)
192 195
193 return _ConvertFuturesToResults(json_results) 196 return _ConvertFuturesToResults(json_results)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698