-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure pipelines for verbosity (#1074)
* Restructure pipelines for verbosity Remove scan_codebase_packages pipeline, and restructure inspect_packages pipeline into load_sbom and resolve_packages pipelines. Reference: #1035 Reference: #1034 Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> * Refactor functions and improve docstrings Reference: #1074 Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> * Add unittests for new functions Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> * Update docs and add CHANGELOG entry Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> * Improve docstrings for pipelines Suggested-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com> --------- Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
- Loading branch information
1 parent
100b64e
commit 7bb4499
Showing
18 changed files
with
434 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Generated by Django 5.0.1 on 2024-02-09 15:05 | ||
|
||
from django.db import migrations | ||
|
||
|
||
pipeline_old_names_mapping = { | ||
"scan_codebase_packages": "inspect_packages", | ||
} | ||
|
||
|
||
def rename_pipelines_data(apps, schema_editor): | ||
Run = apps.get_model("scanpipe", "Run") | ||
for old_name, new_name in pipeline_old_names_mapping.items(): | ||
Run.objects.filter(pipeline_name=old_name).update(pipeline_name=new_name) | ||
|
||
|
||
def reverse_rename_pipelines_data(apps, schema_editor): | ||
Run = apps.get_model("scanpipe", "Run") | ||
for old_name, new_name in pipeline_old_names_mapping.items(): | ||
Run.objects.filter(pipeline_name=new_name).update(pipeline_name=old_name) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("scanpipe", "0052_run_selected_groups"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
rename_pipelines_data, | ||
reverse_code=reverse_rename_pipelines_data, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.