Skip to content

Commit

Permalink
Set the is_runtime and is_resolved flags #1145
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <tdruez@nexb.com>
  • Loading branch information
tdruez committed Jul 29, 2024
1 parent fe6d04c commit 17d65fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions scanpipe/pipelines/load_sbom.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def create_dependencies(self):
dependency_uid=str(uuid.uuid4()),
for_package=package,
resolved_to_package=resolved_to_package,
is_runtime=True,
is_resolved=True,
)
# dependency_data = {
# "for_package": package,
Expand Down
7 changes: 5 additions & 2 deletions scanpipe/tests/pipes/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,10 @@ def test_scanpipe_pipes_outputs_get_cyclonedx_bom_dependency_tree(self):
a = make_package(project, "pkg:type/a")
b = make_package(project, "pkg:type/b")
c = make_package(project, "pkg:type/c")
make_package(project, "pkg:type/z")

# A -> B -> C
# Project -> A -> B -> C
# Project -> Z
make_dependency(project, for_package=a, resolved_to_package=b)
make_dependency(project, for_package=b, resolved_to_package=c)

Expand All @@ -296,12 +298,13 @@ def test_scanpipe_pipes_outputs_get_cyclonedx_bom_dependency_tree(self):

expected = [
{
"dependsOn": ["pkg:type/a", "pkg:type/b", "pkg:type/c"],
"dependsOn": ["pkg:type/a", "pkg:type/b", "pkg:type/c", "pkg:type/z"],
"ref": str(project.uuid),
},
{"dependsOn": ["pkg:type/b"], "ref": "pkg:type/a"},
{"dependsOn": ["pkg:type/c"], "ref": "pkg:type/b"},
{"ref": "pkg:type/c"},
{"ref": "pkg:type/z"},
]
self.assertEqual(expected, results_json["dependencies"])

Expand Down

0 comments on commit 17d65fc

Please sign in to comment.