Skip to content

Commit

Permalink
Rename the Resolver groups with a no-spaces syntax #1306
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Jul 2, 2024
1 parent 2a8abf2 commit 8dad27f
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ v34.6.4 (unreleased)
related work directories created more than a specified number of days ago.
https://github.com/nexB/scancode.io/issues/1289

- Update the ``inspect_packages`` pipeline to have an optional ``Static Resolver``
- Update the ``inspect_packages`` pipeline to have an optional ``StaticResolver``
group to create resolved packages and dependency relationships from lockfiles
and manifests having pre-resolved dependencies. Also update this pipeline to
perform package assembly from multiple manifests and files to create
discovered packages. Also update the ``resolve_dependencies`` pipeline to have
the same ``Static Resolver`` group and mode the dynamic resolution part to a new
optional ``Dynamic Resolver`` group.
the same ``StaticResolver`` group and mode the dynamic resolution part to a new
optional ``DynamicResolver`` group.
See https://github.com/nexB/scancode.io/pull/1244

- Add a new attribute ``is_direct`` to the DiscoveredDependency model and two new
Expand Down
2 changes: 1 addition & 1 deletion docs/command-line-interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ For example, running the ``inspect_packages`` pipeline on a manifest file:
.. tip:: Use the "pipeline_name:group1,group2" syntax to select steps groups::

$ run inspect_packages:"Static Resolver" package.json > results.json
$ run inspect_packages:StaticResolver package.json > results.json

In the following example, running the ``scan_codebase`` followed by the
``find_vulnerabilities`` pipelines on a codebase directory:
Expand Down
2 changes: 1 addition & 1 deletion scanpipe/pipelines/inspect_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def scan_for_application_packages(self):
progress_logger=self.log,
)

@group("Static Resolver")
@group("StaticResolver")
def resolve_dependencies(self):
"""
Create packages and dependency relationships from
Expand Down
8 changes: 4 additions & 4 deletions scanpipe/pipelines/resolve_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_manifest_inputs(self):
"""Locate package manifest files with a supported package resolver."""
self.manifest_resources = resolve.get_manifest_resources(self.project)

@group("Static Resolver")
@group("StaticResolver")
def scan_for_application_packages(self):
"""
Scan and assemble application packages from package manifests
Expand All @@ -70,15 +70,15 @@ def scan_for_application_packages(self):
progress_logger=self.log,
)

@group("Static Resolver")
@group("StaticResolver")
def create_packages_and_dependencies(self):
"""
Create the statically resolved packages and their dependencies
in the database.
"""
scancode.process_package_data(self.project, static_resolve=True)

@group("Dynamic Resolver")
@group("DynamicResolver")
def get_packages_from_manifest(self):
"""
Resolve package data from lockfiles/requirement files with package
Expand All @@ -91,7 +91,7 @@ def get_packages_from_manifest(self):
model="get_packages_from_manifest",
)

@group("Dynamic Resolver")
@group("DynamicResolver")
def create_resolved_packages(self):
"""
Create the dynamically resolved packages and their dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"pipeline_name": "resolve_dependencies",
"status": "not_started",
"selected_groups": [
"Static Resolver"
"StaticResolver"
],
"scancodeio_version": "",
"task_id": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"pipeline_name": "inspect_packages",
"status": "not_started",
"selected_groups": [
"Static Resolver"
"StaticResolver"
],
"scancodeio_version": "",
"task_id": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"pipeline_name": "resolve_dependencies",
"status": "not_started",
"selected_groups": [
"Static Resolver"
"StaticResolver"
],
"scancodeio_version": "",
"task_id": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"pipeline_name": "resolve_dependencies",
"status": "not_started",
"selected_groups": [
"Static Resolver"
"StaticResolver"
],
"scancodeio_version": "",
"task_id": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"pipeline_name": "inspect_packages",
"status": "not_started",
"selected_groups": [
"Static Resolver"
"StaticResolver"
],
"scancodeio_version": "",
"task_id": null,
Expand Down
4 changes: 2 additions & 2 deletions scanpipe/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def test_scanpipe_management_command_run(self):
out = StringIO()
with redirect_stdout(out):
options = [
"inspect_packages:Static Resolver",
"inspect_packages:StaticResolver",
"do_nothing:Group1,Group2",
input_location,
]
Expand All @@ -694,7 +694,7 @@ def test_scanpipe_management_command_run(self):
json_data = json.loads(out.getvalue())
runs = json_data["headers"][0]["runs"]
self.assertEqual("inspect_packages", runs[0]["pipeline_name"])
self.assertEqual(["Static Resolver"], runs[0]["selected_groups"])
self.assertEqual(["StaticResolver"], runs[0]["selected_groups"])

self.assertEqual("do_nothing", runs[1]["pipeline_name"])
self.assertEqual(["Group1", "Group2"], runs[1]["selected_groups"])
Expand Down
10 changes: 5 additions & 5 deletions scanpipe/tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ def test_scanpipe_inspect_packages_with_resolved_dependencies_npm(self):

run = project1.add_pipeline(
pipeline_name=pipeline_name,
selected_groups=["Static Resolver"],
selected_groups=["StaticResolver"],
)
pipeline = run.make_pipeline_instance()

Expand All @@ -854,7 +854,7 @@ def test_scanpipe_inspect_packages_with_resolved_dependencies_poetry(self):

run = project1.add_pipeline(
pipeline_name=pipeline_name,
selected_groups=["Static Resolver"],
selected_groups=["StaticResolver"],
)
pipeline = run.make_pipeline_instance()

Expand Down Expand Up @@ -883,7 +883,7 @@ def test_scanpipe_resolved_dependencies_cocoapods(self):

run = project1.add_pipeline(
pipeline_name=pipeline_name,
selected_groups=["Static Resolver"],
selected_groups=["StaticResolver"],
)
pipeline = run.make_pipeline_instance()

Expand All @@ -910,7 +910,7 @@ def test_scanpipe_resolved_dependencies_pip_inspect(self):

run = project1.add_pipeline(
pipeline_name=pipeline_name,
selected_groups=["Static Resolver"],
selected_groups=["StaticResolver"],
)
pipeline = run.make_pipeline_instance()

Expand All @@ -936,7 +936,7 @@ def test_scanpipe_resolved_dependencies_nuget(self):

run = project1.add_pipeline(
pipeline_name=pipeline_name,
selected_groups=["Static Resolver"],
selected_groups=["StaticResolver"],
)
pipeline = run.make_pipeline_instance()

Expand Down

0 comments on commit 8dad27f

Please sign in to comment.