Skip to content

Fix get_data_from_manifests returning wrong type on early exit#2182

Open
prajakta128 wants to merge 1 commit into
aboutcode-org:mainfrom
prajakta128:fix/get-data-from-manifests-inconsistent-return-type
Open

Fix get_data_from_manifests returning wrong type on early exit#2182
prajakta128 wants to merge 1 commit into
aboutcode-org:mainfrom
prajakta128:fix/get-data-from-manifests-inconsistent-return-type

Conversation

@prajakta128

Copy link
Copy Markdown

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 prajakta128 force-pushed the fix/get-data-from-manifests-inconsistent-return-type branch 2 times, most recently from 64e8a8a to c8b1677 Compare June 25, 2026 05:23
When manifest_resources is empty, the function returned a bare []
instead of ([], []). All callers unpack the result as a two-tuple:

    packages, dependencies = get_data_from_manifests(...)

This caused a ValueError crash in the LoadSBOM and
ResolveDependencies pipelines when no manifest resources exist.

Fix: return [], [] to match the expected return type consistently.
Add a regression test to verify the function always returns a tuple.

Signed-off-by: Prajakta Kamble <prajuu2812@gmail.com>
@prajakta128 prajakta128 force-pushed the fix/get-data-from-manifests-inconsistent-return-type branch from c8b1677 to 52a51e5 Compare June 25, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant