Skip to content

Commit 9ad48fc

Browse files
committed
Define the groups and steps as empty list when not provided
Signed-off-by: tdruez <[email protected]>
1 parent 9d41ad3 commit 9ad48fc

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

scanpipe/pipelines/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ def __init__(self, run_instance):
179179
self.pipeline_class = run_instance.pipeline_class
180180
self.pipeline_name = run_instance.pipeline_name
181181

182-
self.selected_groups = run_instance.selected_groups
183-
self.selected_steps = run_instance.selected_steps
182+
self.selected_groups = run_instance.selected_groups or []
183+
self.selected_steps = run_instance.selected_steps or []
184184

185185
self.ecosystem_config = None
186186

scanpipe/pipes/d2d_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def load_ecosystem_config(pipeline, options):
156156
- which source files to get source symbols from
157157
- which unmapped paths to ignore in deployed binaries
158158
"""
159-
# Add default configurations which are common accross ecosystems
159+
# Add default configurations which are common across ecosystems
160160
pipeline.ecosystem_config = ECOSYSTEM_CONFIGS.get("Default")
161161

162162
# Add configurations for each selected ecosystem

scanpipe/tests/test_pipelines.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,11 +1388,11 @@ def test_scanpipe_fetch_scores_pipeline_integration(self, mock_is_available):
13881388
"scoring_tool_documentation_url": "https://github.com/[trunc...]",
13891389
"score_date": "2025-07-24T18:50:16Z",
13901390
}
1391-
with mock.patch("scorecode.ossf_scorecard.fetch_scorecard") as fetch:
1391+
with mock.patch("scorecode.ossf_scorecard.fetch_scorecard_info") as fetch:
13921392
fetch.return_value = PackageScore(**package_score_data)
1393-
exitcode, out = pipeline.execute()
1394-
self.assertEqual(0, exitcode, msg=out)
1393+
exitcode, out = pipeline.execute()
13951394

1395+
self.assertEqual(0, exitcode, msg=out)
13961396
package1.refresh_from_db()
13971397
scorecard_entry = package1.scores.filter(scoring_tool="ossf-scorecard").first()
13981398
self.assertIsNotNone(scorecard_entry)
@@ -1747,6 +1747,20 @@ def test_scanpipe_deploy_to_develop_pipeline_with_about_file(
17471747
)
17481748
self.assertIn(expected, message.description)
17491749

1750+
def test_scanpipe_deploy_to_develop_pipeline_without_selected_groups(self):
1751+
pipeline_name = "map_deploy_to_develop"
1752+
project1 = make_project(name="Analysis")
1753+
1754+
data_dir = self.data / "d2d" / "about_files"
1755+
project1.copy_input_from(data_dir / "from-with-about-file.zip")
1756+
project1.copy_input_from(data_dir / "to-with-jar.zip")
1757+
1758+
run = project1.add_pipeline(pipeline_name=pipeline_name)
1759+
pipeline = run.make_pipeline_instance()
1760+
1761+
exitcode, out = pipeline.execute()
1762+
self.assertEqual(0, exitcode, msg=out)
1763+
17501764
@mock.patch("scanpipe.pipes.purldb.request_post")
17511765
@mock.patch("scanpipe.pipes.purldb.is_available")
17521766
def test_scanpipe_populate_purldb_pipeline_integration(

0 commit comments

Comments
 (0)