Skip to content

Commit 35b271a

Browse files
committed
Address review comments
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent e0c6a2b commit 35b271a

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Unreleased
3131
by adding "#from" or "#to" fragments at the end of the download URLs.
3232
https://github.com/nexB/scancode.io/issues/708
3333

34+
- Add an add-on pipeline for collecting DWARF debug symbol compilation
35+
unit paths when available from elfs https://github.com/nexB/purldb/issues/260.
36+
3437
v33.0.0 (2024-01-16)
3538
--------------------
3639

scanpipe/pipelines/get_dwarfs_from_elfs.py renamed to scanpipe/pipelines/inspect_elf_binaries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def steps(cls):
3939

4040
def collect_dwarf_source_path_references(self):
4141
"""
42-
Update ``extra_data`` of project with
42+
Update ``extra_data`` of elf files with
4343
dwarf data extracted from elf files.
4444
"""
4545
for elf in self.project.codebaseresources.elfs():

scanpipe/tests/test_models.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,44 +2087,49 @@ def test_scanpipe_codebase_resource_queryset_has_directory_content_fingerprint(
20872087

20882088
def test_scanpipe_codebase_resource_queryset_elfs(self):
20892089
project = Project.objects.create(name="Test")
2090-
resource_starting_with_elf_and_executable_in_file_type = CodebaseResource.objects.create(
2090+
resource_starting_with_elf_and_executable_in_file_type = CodebaseResource(
20912091
file_type="""ELF 32-bit LSB executable, ARM, version 1 (ARM), statically
20922092
linked, with debug_info, not stripped""",
20932093
project=project,
20942094
path="a",
20952095
type=CodebaseResource.Type.FILE,
20962096
)
2097-
resource_with_executable_in_file_type = CodebaseResource.objects.create(
2097+
resource_starting_with_elf_and_executable_in_file_type.save()
2098+
resource_with_executable_in_file_type = CodebaseResource(
20982099
file_type="""32-bit LSB executable, ARM, version 1 (ARM), statically
20992100
linked, with debug_info, not stripped""",
21002101
project=project,
21012102
path="b",
21022103
type=CodebaseResource.Type.FILE,
21032104
)
2104-
resource_starting_with_elf_in_file_type = CodebaseResource.objects.create(
2105+
resource_with_executable_in_file_type.save()
2106+
resource_starting_with_elf_in_file_type = CodebaseResource(
21052107
file_type="""ELF 32-bit LSB resourcable, ARM, version 1 (ARM), statically
21062108
linked, with debug_info, not stripped""",
21072109
project=project,
21082110
path="c",
21092111
type=CodebaseResource.Type.FILE,
21102112
)
2111-
resource = CodebaseResource.objects.create(
2113+
resource_starting_with_elf_in_file_type.save()
2114+
resource = CodebaseResource(
21122115
file_type="""32-bit LSB relocatable, ARM, version 1 (ARM), statically
21132116
linked, with debug_info, not stripped""",
21142117
project=project,
21152118
path="d",
21162119
type=CodebaseResource.Type.FILE,
21172120
)
2118-
resource_starting_with_elf_and_relocatable_in_file_type = CodebaseResource.objects.create(
2121+
resource.save()
2122+
resource_starting_with_elf_and_relocatable_in_file_type = CodebaseResource(
21192123
file_type="""ELF 32-bit LSB relocatable, ARM, version 1 (ARM), statically
21202124
linked, with debug_info, not stripped""",
21212125
project=project,
21222126
path="e",
21232127
type=CodebaseResource.Type.FILE,
21242128
)
2129+
resource_starting_with_elf_and_relocatable_in_file_type.save()
21252130
paths = [str(resource.path) for resource in project.codebaseresources.elfs()]
2126-
assert "e" in paths
2127-
assert "a" in paths
2131+
self.assertTrue("e" in paths)
2132+
self.assertTrue("a" in paths)
21282133

21292134

21302135
class ScanPipeModelsTransactionTest(TransactionTestCase):

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ scancodeio_pipelines =
127127
analyze_root_filesystem_or_vm_image = scanpipe.pipelines.root_filesystem:RootFS
128128
analyze_windows_docker_image = scanpipe.pipelines.docker_windows:DockerWindows
129129
find_vulnerabilities = scanpipe.pipelines.find_vulnerabilities:FindVulnerabilities
130-
get_dwarfs_from_elfs = scanpipe.pipelines.get_dwarfs_from_elfs:InspectElfBinaries
130+
inspect_elf_binaries = scanpipe.pipelines.inspect_elf_binaries:InspectElfBinaries
131131
inspect_packages = scanpipe.pipelines.inspect_packages:InspectPackages
132132
load_inventory = scanpipe.pipelines.load_inventory:LoadInventory
133133
map_deploy_to_develop = scanpipe.pipelines.deploy_to_develop:DeployToDevelop

0 commit comments

Comments
 (0)