OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Access the commit queue from the command line. | 6 """Access the commit queue from the command line. |
7 """ | 7 """ |
8 | 8 |
9 __version__ = '0.1' | 9 __version__ = '0.1' |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 _apply_on_issue(_get_commit, obj, issue) | 98 _apply_on_issue(_get_commit, obj, issue) |
99 | 99 |
100 def set_commit(obj, issue, flag): | 100 def set_commit(obj, issue, flag): |
101 """Sets the commit bit flag on an issue.""" | 101 """Sets the commit bit flag on an issue.""" |
102 def _set_commit(properties): | 102 def _set_commit(properties): |
103 print obj.set_flag(issue, properties['patchsets'][-1], 'commit', flag) | 103 print obj.set_flag(issue, properties['patchsets'][-1], 'commit', flag) |
104 return 0 | 104 return 0 |
105 _apply_on_issue(_set_commit, obj, issue) | 105 _apply_on_issue(_set_commit, obj, issue) |
106 | 106 |
107 | 107 |
108 def get_master_builder_map(config_path): | 108 def get_master_builder_map(config_path): |
tandrii(chromium)
2016/01/14 09:36:06
how about adding here "include_experimental=True,
Michael Achenbach
2016/01/14 09:56:04
How about now?
| |
109 """Returns a map of master -> [builders] from cq config.""" | 109 """Returns a map of master -> [builders] from cq config.""" |
110 with open(config_path) as config_file: | 110 with open(config_path) as config_file: |
111 cq_config = config_file.read() | 111 cq_config = config_file.read() |
112 | 112 |
113 config = cq_pb2.Config() | 113 config = cq_pb2.Config() |
114 text_format.Merge(cq_config, config) | 114 text_format.Merge(cq_config, config) |
115 masters = {} | 115 masters = {} |
116 if config.HasField('verifiers') and config.verifiers.HasField('try_job'): | 116 if config.HasField('verifiers') and config.verifiers.HasField('try_job'): |
117 for bucket in config.verifiers.try_job.buckets: | 117 for bucket in config.verifiers.try_job.buckets: |
118 masters.setdefault(bucket.name, []) | 118 masters.setdefault(bucket.name, []) |
119 for builder in bucket.builders: | 119 for builder in bucket.builders: |
120 if not builder.HasField('experiment_percentage'): | 120 if (not builder.HasField('experiment_percentage') and |
121 not builder.HasField('triggered_by')): | |
121 masters[bucket.name].append(builder.name) | 122 masters[bucket.name].append(builder.name) |
122 return masters | 123 return masters |
123 | 124 |
124 | 125 |
125 @need_issue | 126 @need_issue |
126 def CMDset(parser, args): | 127 def CMDset(parser, args): |
127 """Sets the commit bit.""" | 128 """Sets the commit bit.""" |
128 options, args, obj = parser.parse_args(args) | 129 options, args, obj = parser.parse_args(args) |
129 if args: | 130 if args: |
130 parser.error('Unrecognized args: %s' % ' '.join(args)) | 131 parser.error('Unrecognized args: %s' % ' '.join(args)) |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 return CMDhelp(parser, args) | 269 return CMDhelp(parser, args) |
269 | 270 |
270 | 271 |
271 if __name__ == "__main__": | 272 if __name__ == "__main__": |
272 fix_encoding.fix_encoding() | 273 fix_encoding.fix_encoding() |
273 try: | 274 try: |
274 sys.exit(main()) | 275 sys.exit(main()) |
275 except KeyboardInterrupt: | 276 except KeyboardInterrupt: |
276 sys.stderr.write('interrupted\n') | 277 sys.stderr.write('interrupted\n') |
277 sys.exit(1) | 278 sys.exit(1) |
OLD | NEW |