From a19946b5d9c6b5103161c5bf4c964089065de159 Mon Sep 17 00:00:00 2001 From: Thomas Druez Date: Fri, 3 Mar 2023 17:25:24 +0100 Subject: [PATCH] Add CHANGELOG entry and fix typo #583 Signed-off-by: Thomas Druez --- CHANGELOG.rst | 7 +++++++ scanpipe/cyclonedx/__init__.py | 9 ++++----- scanpipe/spdx/__init__.py | 2 +- scanpipe/tests/test_pipelines.py | 6 ++---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6d81ad479..34b735c30 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,10 @@ Changelog v33.0.0 (unreleased) -------------------- +- Add support for CycloneDX 1.4 to the "inspect-manifest" pipeline to import SBOM into + a Project. + https://github.com/nexB/scancode.io/issues/583 + - Refine the "Command Line Interface" documentation about the ``scanpipe`` command usages in the Docker context. Add the /app workdir in the "PYTHONPATH" env of the Docker file to make the @@ -17,6 +21,9 @@ v33.0.0 (unreleased) - Use CodebaseResource ``path`` instead of ``id`` as slug_field in URL navigation. https://github.com/nexB/scancode.io/issues/242 +- Remove dead code related to the project_tree view + https://github.com/nexB/scancode.io/issues/623 + v32.0.1 (2023-02-20) -------------------- diff --git a/scanpipe/cyclonedx/__init__.py b/scanpipe/cyclonedx/__init__.py index fd330ca5c..4f2cacc57 100644 --- a/scanpipe/cyclonedx/__init__.py +++ b/scanpipe/cyclonedx/__init__.py @@ -25,7 +25,6 @@ from collections import defaultdict import jsonschema -from hoppr_cyclonedx_models.cyclonedx_1_4 import Component from hoppr_cyclonedx_models.cyclonedx_1_4 import ( CyclonedxSoftwareBillOfMaterialsStandard as Bom_1_4, ) @@ -137,17 +136,17 @@ def get_external_references(external_references): if not external_references: return {} - refrences = defaultdict(lambda: []) + references = defaultdict(lambda: []) for ref in external_references: - refrences[ref.type.value].append(ref.url) + references[ref.type.value].append(ref.url) - return dict(refrences) + return dict(references) def validate_document(document, schema=CYCLONEDX_JSON_SCHEMA_PATH): """ - CycloneDX document validation. + Check the validity of this CycloneDX document. """ if isinstance(document, str): document = json.loads(document) diff --git a/scanpipe/spdx/__init__.py b/scanpipe/spdx/__init__.py index 423d7f52d..ac807d341 100644 --- a/scanpipe/spdx/__init__.py +++ b/scanpipe/spdx/__init__.py @@ -639,7 +639,7 @@ def safe_document_name(name): def validate(self, schema): """ - Check the validation of this SPDX document. + Check the validity of this SPDX document. """ return validate_document(document=self.as_dict(), schema=schema) diff --git a/scanpipe/tests/test_pipelines.py b/scanpipe/tests/test_pipelines.py index c022b12c4..3691fb7b9 100644 --- a/scanpipe/tests/test_pipelines.py +++ b/scanpipe/tests/test_pipelines.py @@ -684,7 +684,7 @@ def test_scanpipe_inspect_manifest_pipeline_aboutfile_integration_test(self): self.assertEqual("4.0.8", discoveredpackage.version) self.assertEqual("bsd-new", discoveredpackage.license_expression) - def test_scanpipe_inspect_manifest_pipeline_spdx_document_integration_test(self): + def test_scanpipe_inspect_manifest_pipeline_spdx_integration_test(self): pipeline_name = "inspect_manifest" project1 = Project.objects.create(name="Analysis") @@ -706,9 +706,7 @@ def test_scanpipe_inspect_manifest_pipeline_spdx_document_integration_test(self) self.assertEqual("MIT", discoveredpackage.declared_license) self.assertEqual("mit", discoveredpackage.license_expression) - def test_scanpipe_inspect_manifest_pipeline_cyclonedx_document_integration_test( - self, - ): + def test_scanpipe_inspect_manifest_pipeline_cyclonedx_integration_test(self): pipeline_name = "inspect_manifest" project1 = Project.objects.create(name="Analysis")