scancode.io icon indicating copy to clipboard operation
scancode.io copied to clipboard

Fix get_data_from_manifests returning wrong type on early exit

Open prajakta128 opened this issue 5 months ago • 1 comments

What

Fix get_data_from_manifests returning a bare [] instead of ([], []) when no manifest resources exist.

Why

All callers unpack the return value as a two-tuple:

packages, dependencies = resolve.get_data_from_manifests(...)

This is done in two pipelines:

  • scanpipe/pipelines/load_sbom.py line 59
  • scanpipe/pipelines/resolve_dependencies.py line 87

When manifest_resources.exists() is False, the function hit:

return []   ← wrong type

This causes a ValueError: not enough values to unpack crash, crashing the entire LoadSBOM and ResolveDependencies pipelines whenever a project has no manifest resources.

Fix

One character change in scanpipe/pipes/resolve.py:

  • return []
  • return [], []

Added a regression test to verify the function always returns a two-tuple even when manifest_resources is empty.

prajakta128 avatar Jun 25 '26 05:06 prajakta128

Hi maintainers! This PR fixes get_data_from_manifests returning a bare [] instead of ([], []) when no manifest resources exist, which causes a ValueError crash in the LoadSBOM and ResolveDependencies pipelines. Would love to get your feedback when you have a chance. Happy to make any changes needed. Thank you!

prajakta128 avatar Jul 04 '26 15:07 prajakta128