Skip to content

Commit 31eae95

Browse files
committed
Address review comments
Signed-off-by: Tushar Goel <[email protected]>
1 parent 4ca303e commit 31eae95

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
@@ -68,6 +68,9 @@ v33.1.0 (2024-02-02)
6868
`upload_file`.
6969
https://github.com/nexB/scancode.io/issues/708
7070

71+
- Add an add-on pipeline for collecting DWARF debug symbol compilation
72+
unit paths when available from elfs https://github.com/nexB/purldb/issues/260.
73+
7174
v33.0.0 (2024-01-16)
7275
--------------------
7376

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
@@ -2112,44 +2112,49 @@ def test_scanpipe_codebase_resource_queryset_has_directory_content_fingerprint(
21122112

21132113
def test_scanpipe_codebase_resource_queryset_elfs(self):
21142114
project = Project.objects.create(name="Test")
2115-
resource_starting_with_elf_and_executable_in_file_type = CodebaseResource.objects.create(
2115+
resource_starting_with_elf_and_executable_in_file_type = CodebaseResource(
21162116
file_type="""ELF 32-bit LSB executable, ARM, version 1 (ARM), statically
21172117
linked, with debug_info, not stripped""",
21182118
project=project,
21192119
path="a",
21202120
type=CodebaseResource.Type.FILE,
21212121
)
2122-
resource_with_executable_in_file_type = CodebaseResource.objects.create(
2122+
resource_starting_with_elf_and_executable_in_file_type.save()
2123+
resource_with_executable_in_file_type = CodebaseResource(
21232124
file_type="""32-bit LSB executable, ARM, version 1 (ARM), statically
21242125
linked, with debug_info, not stripped""",
21252126
project=project,
21262127
path="b",
21272128
type=CodebaseResource.Type.FILE,
21282129
)
2129-
resource_starting_with_elf_in_file_type = CodebaseResource.objects.create(
2130+
resource_with_executable_in_file_type.save()
2131+
resource_starting_with_elf_in_file_type = CodebaseResource(
21302132
file_type="""ELF 32-bit LSB resourcable, ARM, version 1 (ARM), statically
21312133
linked, with debug_info, not stripped""",
21322134
project=project,
21332135
path="c",
21342136
type=CodebaseResource.Type.FILE,
21352137
)
2136-
resource = CodebaseResource.objects.create(
2138+
resource_starting_with_elf_in_file_type.save()
2139+
resource = CodebaseResource(
21372140
file_type="""32-bit LSB relocatable, ARM, version 1 (ARM), statically
21382141
linked, with debug_info, not stripped""",
21392142
project=project,
21402143
path="d",
21412144
type=CodebaseResource.Type.FILE,
21422145
)
2143-
resource_starting_with_elf_and_relocatable_in_file_type = CodebaseResource.objects.create(
2146+
resource.save()
2147+
resource_starting_with_elf_and_relocatable_in_file_type = CodebaseResource(
21442148
file_type="""ELF 32-bit LSB relocatable, ARM, version 1 (ARM), statically
21452149
linked, with debug_info, not stripped""",
21462150
project=project,
21472151
path="e",
21482152
type=CodebaseResource.Type.FILE,
21492153
)
2154+
resource_starting_with_elf_and_relocatable_in_file_type.save()
21502155
paths = [str(resource.path) for resource in project.codebaseresources.elfs()]
2151-
assert "e" in paths
2152-
assert "a" in paths
2156+
self.assertTrue("e" in paths)
2157+
self.assertTrue("a" in paths)
21532158

21542159

21552160
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
load_sbom = scanpipe.pipelines.load_sbom:LoadSBOM

0 commit comments

Comments
 (0)