def _get_performance_report(fuzzer_name, job_type, performance_report_data): """Return performance report.""" bucket_name = data_handler.get_value_from_job_definition_or_environment( job_type, 'FUZZ_LOGS_BUCKET') # Load performance data as JSON. performance_report = json.loads(performance_report_data) # Get logs directory path containing the analyzed logs. logs_directory = fuzzer_logs.get_logs_directory(bucket_name, fuzzer_name, job_type) # Add other display metadata in report. for issue in performance_report['issues']: # Linkify the examples column. # TODO(mmoroz): build this in polymer using dom-repeat. issue['examples'] = '<br/>'.join([ _get_link_html(logs_directory, log_relative_path) for log_relative_path in issue['examples'] ]) # Add the solutions column explicitly. issue['solutions'] = constants.ISSUE_TYPE_SOLUTIONS_MAP[issue['type']] return performance_report
def _get_revision_vars_url_format(job_type): """Return REVISION_VARS_URL from job environment if available. Otherwise, default to one set in project.yaml. For custom binary jobs, this is not applicable.""" if job_type is None: # Force it to use env attribute in project.yaml. return local_config.ProjectConfig().get('env.REVISION_VARS_URL') custom_binary = data_handler.get_value_from_job_definition( job_type, 'CUSTOM_BINARY') if utils.string_is_true(custom_binary): return None return data_handler.get_value_from_job_definition_or_environment( job_type, 'REVISION_VARS_URL')
def _get_logs_bucket_from_job(self, job_type): """Get logs bucket from job.""" return data_handler.get_value_from_job_definition_or_environment( job_type, 'FUZZ_LOGS_BUCKET')