Skip to content

Commit

Permalink
Merge pull request #130 from lishengbao/tmp_fix_bug
Browse files Browse the repository at this point in the history
Fix graduation security_binary_artifact_detail metric
  • Loading branch information
lishengbao authored Sep 29, 2024
2 parents e201b01 + 53eb2e6 commit 06390c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/models/tpc_software_report_metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,13 @@ def self.get_security_binary_artifact(binary_checker_result)
end

raw_data = {
"binary_file_list": (binary_checker_result.dig("binary_archive_list") || []).take(30),
"binary_archive_list": (binary_checker_result.dig("binary_archive_list") || []).take(30),
"binary_file_list": (binary_checker_result.dig("binary_archive_list") || []).take(5),
"binary_archive_list": (binary_checker_result.dig("binary_archive_list") || []).take(5),
}

{
security_binary_artifact: score,
security_binary_artifact_detail: binary_archive_list.take(5).to_json,
security_binary_artifact_detail: binary_archive_list.take(1).to_json,
security_binary_artifact_raw: raw_data.to_json
}
end
Expand Down
4 changes: 3 additions & 1 deletion app/services/tpc_software_metric_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ def analyze_metric_by_tpc_service(report_id, report_metric_id, report_type)
when Report_Type_Selection
commands = %w[osv-scanner scancode binary-checker sonar-scanner dependency-checker]
when Report_Type_Graduation
# commands = %w[scancode sonar-scanner binary-checker osv-scanner release-checker readme-checker
# maintainers-checker build-doc-checker api-doc-checker readme-opensource-checker]
commands = %w[scancode sonar-scanner binary-checker osv-scanner release-checker readme-checker
maintainers-checker build-doc-checker api-doc-checker readme-opensource-checker]
maintainers-checker readme-opensource-checker]
end
payload = {
commands: commands,
Expand Down

0 comments on commit 06390c1

Please sign in to comment.