Skip to content

Commit

Permalink
snyk: skip writing of scan metadata when no supported project
Browse files Browse the repository at this point in the history
Reproducer: csmock -r rhel-9-x86_64 -t snyk -f octavia-amphora-image-vert-fips-x86_64-18.0-20240305.1.el9ost.src.rpm

Related: https://issues.redhat.com/browse/OSH-583

When an snyk-unsupported project is scanned using snyk, no stats are generated.
  • Loading branch information
jperezdealgaba committed Mar 18, 2024
1 parent 802bbf3 commit b90b8e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion py/plugins/snyk.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ def scan_hook(results, mock, props):
if ec == 3:
# If there are no supported project, we return no results but no crash.
results.print_with_ts("snyk-code: no supported project for Snyk")
# If no supported project, no results file is generated
# If no supported project, no results file is generated and no stats are generated
props.copy_out_files.remove(SNYK_OUTPUT)
props.post_process_hooks.remove(write_snyk_stats_metadata)
return 0
if ec not in [0, 1]:
results.error("snyk code returned unexpected exit status: %d" % ec, ec=ec)
Expand Down

0 comments on commit b90b8e8

Please sign in to comment.