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

Side by Side Diff: infra/tools/send_monitoring_event/send_event.py

Issue 1815413002: Add support for patch_url field in BuildEvent (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Added test Created 4 years, 9 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 | infra_libs/event_mon/monitoring.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 import argparse 5 import argparse
6 import glob 6 import glob
7 import json 7 import json
8 import logging 8 import logging
9 import os 9 import os
10 import re 10 import re
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 build_group.add_argument('--build-event-result', 114 build_group.add_argument('--build-event-result',
115 choices=event_mon.BUILD_RESULTS, 115 choices=event_mon.BUILD_RESULTS,
116 help='Result of build or step depending on ' 116 help='Result of build or step depending on '
117 'whether any \n--build-event-step-* options have ' 117 'whether any \n--build-event-step-* options have '
118 'been provided or not.') 118 'been provided or not.')
119 119
120 build_group.add_argument('--build-event-extra-result-code', 120 build_group.add_argument('--build-event-extra-result-code',
121 help='Extra result code. String, comma-separated ' 121 help='Extra result code. String, comma-separated '
122 'list of strings or json-encoded list of string. ' 122 'list of strings or json-encoded list of string. '
123 'Each one must be less than 20 characters long.') 123 'Each one must be less than 20 characters long.')
124 build_group.add_argument('--build-event-patch-url',
125 help='URL of the patchset that triggered build')
124 126
125 build_group.add_argument('--build-event-goma-stats-path', 127 build_group.add_argument('--build-event-goma-stats-path',
126 metavar='FILENAME', 128 metavar='FILENAME',
127 help='File containing a serialized GomaStats ' 129 help='File containing a serialized GomaStats '
128 'protobuf.') 130 'protobuf.')
129 build_group.add_argument('--build-event-goma-error', 131 build_group.add_argument('--build-event-goma-error',
130 choices=event_mon.GOMA_ERROR_TYPES, 132 choices=event_mon.GOMA_ERROR_TYPES,
131 help='Reason for no GomaStats protobuf.') 133 help='Reason for no GomaStats protobuf.')
132 build_group.add_argument('--build-event-goma-crash-report-id-path', 134 build_group.add_argument('--build-event-goma-crash-report-id-path',
133 metavar='FILENAME', 135 metavar='FILENAME',
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 return bool(event_mon.send_build_event( 319 return bool(event_mon.send_build_event(
318 args.build_event_type, 320 args.build_event_type,
319 args.build_event_hostname, 321 args.build_event_hostname,
320 args.build_event_build_name, 322 args.build_event_build_name,
321 build_number=args.build_event_build_number, 323 build_number=args.build_event_build_number,
322 build_scheduling_time=args.build_event_build_scheduling_time, 324 build_scheduling_time=args.build_event_build_scheduling_time,
323 step_name=args.build_event_step_name, 325 step_name=args.build_event_step_name,
324 step_number=args.build_event_step_number, 326 step_number=args.build_event_step_number,
325 result=args.build_event_result, 327 result=args.build_event_result,
326 extra_result_code=args.build_event_extra_result_code, 328 extra_result_code=args.build_event_extra_result_code,
329 patch_url=args.build_event_patch_url,
327 timestamp_kind=args.event_mon_timestamp_kind, 330 timestamp_kind=args.event_mon_timestamp_kind,
328 event_timestamp=args.event_mon_event_timestamp, 331 event_timestamp=args.event_mon_event_timestamp,
329 goma_stats=goma_stats, 332 goma_stats=goma_stats,
330 goma_error=args.build_event_goma_error, 333 goma_error=args.build_event_goma_error,
331 goma_crash_report_id=goma_crash_report_id)) 334 goma_crash_report_id=goma_crash_report_id))
332 335
333 336
334 def send_events_from_file(args): 337 def send_events_from_file(args):
335 """Entry point when --events-from-file is passed.""" 338 """Entry point when --events-from-file is passed."""
336 file_list = get_event_file_list(args.events_from_file) 339 file_list = get_event_file_list(args.events_from_file)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 args.get('build-event-hostname'), 405 args.get('build-event-hostname'),
403 args.get('build-event-build-name'), 406 args.get('build-event-build-name'),
404 build_number=args.get('build-event-build-number'), 407 build_number=args.get('build-event-build-number'),
405 build_scheduling_time=args.get('build-event-build-scheduling-time'), 408 build_scheduling_time=args.get('build-event-build-scheduling-time'),
406 step_name=args.get('build-event-step-name'), 409 step_name=args.get('build-event-step-name'),
407 step_number=args.get('build-event-step-number'), 410 step_number=args.get('build-event-step-number'),
408 result=args.get('build-event-result'), 411 result=args.get('build-event-result'),
409 extra_result_code=args.get('build-event-extra-result-code'), 412 extra_result_code=args.get('build-event-extra-result-code'),
410 timestamp_kind=args.get('event-mon-timestamp-kind'), 413 timestamp_kind=args.get('event-mon-timestamp-kind'),
411 event_timestamp=args.get('event-mon-event-timestamp'), 414 event_timestamp=args.get('event-mon-event-timestamp'),
412 service_name=args.get('event-mon-service-name'))) 415 service_name=args.get('event-mon-service-name'),
416 patch_url=args.get('build-event-patch-url')))
413 else: 417 else:
414 LOGGER.warning('build-event-type field not found, skipping line ' 418 LOGGER.warning('build-event-type field not found, skipping line '
415 '%d in %s', lineno, filename) 419 '%d in %s', lineno, filename)
416 return events 420 return events
OLDNEW
« no previous file with comments | « no previous file | infra_libs/event_mon/monitoring.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698