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

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
« no previous file with comments | « no previous file | appengine/findit/common/waterfall/test/buildbucket_client_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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',
38 'additional_build_parameters'))
39 ):
38 """Represents a try-job to be triggered through Buildbucket. 40 """Represents a try-job to be triggered through Buildbucket.
39 41
40 Tag for "user_agent" should not be set, as it will be added automatically. 42 Tag for "user_agent" should not be set, as it will be added automatically.
41 """ 43 """
42 44
43 def ToBuildbucketRequest(self): 45 def ToBuildbucketRequest(self):
44 parameters_json = { 46 parameters_json = {
45 'builder_name': self.builder_name, 47 'builder_name': self.builder_name,
46 'properties': self.properties, 48 'properties': self.properties,
47 } 49 }
50 if self.additional_build_parameters:
51 parameters_json['additional_build_parameters'] = (
52 self.additional_build_parameters)
48 if self.revision: 53 if self.revision:
49 parameters_json['changes'] = [ 54 parameters_json['changes'] = [
50 { 55 {
51 'author': { 56 'author': {
52 'email': _ROLE_EMAIL, 57 'email': _ROLE_EMAIL,
53 }, 58 },
54 'revision': self.revision, 59 'revision': self.revision,
55 }, 60 },
56 ] 61 ]
57 62
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 else: 189 else:
185 error_content = { 190 error_content = {
186 'error': { 191 'error': {
187 'reason': status_code, 192 'reason': status_code,
188 'message': content 193 'message': content
189 } 194 }
190 } 195 }
191 json_results.append(error_content) 196 json_results.append(error_content)
192 197
193 return _ConvertFuturesToResults(json_results) 198 return _ConvertFuturesToResults(json_results)
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/common/waterfall/test/buildbucket_client_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698