OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import argparse | 5 import argparse |
6 import collections | 6 import collections |
7 import datetime | 7 import datetime |
8 import math | 8 import math |
9 import re | 9 import re |
10 import urllib | 10 import urllib |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 def maybe_trigger(self, **additional_properties): | 1002 def maybe_trigger(self, **additional_properties): |
1003 triggers = self.bot_config.get('triggers') | 1003 triggers = self.bot_config.get('triggers') |
1004 if triggers: | 1004 if triggers: |
1005 properties = { | 1005 properties = { |
1006 'revision': self.revision, | 1006 'revision': self.revision, |
1007 'parent_got_revision': self.revision, | 1007 'parent_got_revision': self.revision, |
1008 'parent_got_revision_cp': self.revision_cp, | 1008 'parent_got_revision_cp': self.revision_cp, |
1009 } | 1009 } |
1010 if self.m.tryserver.is_tryserver: | 1010 if self.m.tryserver.is_tryserver: |
1011 properties.update( | 1011 properties.update( |
| 1012 category=self.m.properties['category'], |
1012 issue=self.m.properties['issue'], | 1013 issue=self.m.properties['issue'], |
| 1014 master=str(self.m.properties['master']), |
1013 patch_project=str(self.m.properties['patch_project']), | 1015 patch_project=str(self.m.properties['patch_project']), |
1014 patch_storage=str(self.m.properties['patch_storage']), | 1016 patch_storage=str(self.m.properties['patch_storage']), |
1015 patchset=str(self.m.properties['patchset']), | 1017 patchset=str(self.m.properties['patchset']), |
| 1018 reason=str(self.m.properties['reason']), |
1016 requester=str(self.m.properties['requester']), | 1019 requester=str(self.m.properties['requester']), |
1017 rietveld=str(self.m.properties['rietveld']), | 1020 rietveld=str(self.m.properties['rietveld']), |
1018 ) | 1021 ) |
| 1022 |
| 1023 # TODO(machenbach): Also set meaningful buildbucket tags of triggering |
| 1024 # parent. |
| 1025 |
1019 swarm_hashes = self.m.isolate.isolated_tests | 1026 swarm_hashes = self.m.isolate.isolated_tests |
1020 if swarm_hashes: | 1027 if swarm_hashes: |
1021 properties['swarm_hashes'] = swarm_hashes | 1028 properties['swarm_hashes'] = swarm_hashes |
1022 properties.update(**additional_properties) | 1029 properties.update(**additional_properties) |
1023 self.m.trigger(*[{ | 1030 self.m.trigger(*[{ |
1024 'builder_name': builder_name, | 1031 'builder_name': builder_name, |
1025 'properties': properties, | 1032 'properties': properties, |
1026 } for builder_name in triggers]) | 1033 } for builder_name in triggers]) |
1027 | 1034 |
1028 def get_change_range(self): | 1035 def get_change_range(self): |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 def report_culprits(self, culprit_range): | 1151 def report_culprits(self, culprit_range): |
1145 assert culprit_range | 1152 assert culprit_range |
1146 if len(culprit_range) > 1: | 1153 if len(culprit_range) > 1: |
1147 text = 'Suspecting multiple commits' | 1154 text = 'Suspecting multiple commits' |
1148 else: | 1155 else: |
1149 text = 'Suspecting %s' % culprit_range[0][:8] | 1156 text = 'Suspecting %s' % culprit_range[0][:8] |
1150 | 1157 |
1151 step_result = self.m.step(text, cmd=None) | 1158 step_result = self.m.step(text, cmd=None) |
1152 for culprit in culprit_range: | 1159 for culprit in culprit_range: |
1153 step_result.presentation.links[culprit[:8]] = COMMIT_TEMPLATE % culprit | 1160 step_result.presentation.links[culprit[:8]] = COMMIT_TEMPLATE % culprit |
OLD | NEW |