-
-
Notifications
You must be signed in to change notification settings - Fork 203
Upgrade ScanCode-toolkit to latest v32 #569 #715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 56 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
4ef592e
Upgrade ScanCode-toolkit to v32.0.0rc4 #569
tdruez 1756c3a
Migrate DiscoveredPackage model to toolkit v32 changes #569
tdruez b887491
Add new field in API serializer #569
tdruez e278f85
Fix the scan_package pipeline #569
tdruez 7ff0a5e
Fix unit tests and update expected files #569
tdruez 9a02875
Fix unit tests and update expected files #569
tdruez 87cfd93
Adjust new JSONField default as list #569
tdruez 8797ea5
Multiple adjustments for the v32 update #569
tdruez c135721
Refine get_declared_license_expression_spdx logic #569
tdruez 434b0e0
Remove the manifest_path and contains_source_code fields #569
tdruez 60ec5a1
Data migration for declared_license_expression_spdx #569
tdruez c73a0bb
Fix rendering for license_detections and other_license_detections #569
tdruez 0103927
Add get_declared_license_expression method #569
tdruez 3a36ba4
Regen asgiref-3.3.0_toolkit_scan.json in RegenTestData #569
tdruez a79cd7e
Base set of changes for the CodebaseResource migration #569
tdruez de7f6a1
Consolidate migrations #569
tdruez 09ebed8
Update code to resource model changes and fix parts of tests #569
tdruez 03cd314
Update test expected results files #569
tdruez e538e70
Fix unit test #569
tdruez 2a294e8
Refine migration files in 3 steps #569
tdruez 4a087bf
Add data mgiration for detected_license_expression #569
tdruez bca062e
Merge branch 'main' into 569-toolkit-upgrade-v32
tdruez f2b301f
Remove licenses_categories #569
tdruez 4d96857
Migrate attribution to new model fields #569
tdruez f494896
Migrate charts for detected_license_expression #569
tdruez bd17cb3
Migrate spdx to new model fields #569
tdruez 6736f87
Add proper help text for new fields #569
tdruez 3337314
Fix chart and filter for detected_license_expression #569
tdruez e029568
Fix the policy and compliance with new field #569
tdruez 66fb266
Refine loaded_license_expression using the expression #569
tdruez 7965f7d
Data migration for detection fields #569
tdruez 60a705e
Fix QS method call #569
tdruez 11fffe2
Add basic progress logging to data migrations #569
tdruez 29ff6a1
Optimize data migration using bulk_update #569
tdruez 9b7eb48
Display warning if one pipeline was run with old toolkit #569
tdruez 2e1e417
Merge main
tdruez ab71bd6
Merge main
tdruez 17d416b
Add package_assembly_codebase.json in the regen stack #569
tdruez 48eb798
Do not run the data migration operation during tests #569
tdruez 6f5762a
Add changelog entry #569
tdruez 13b5c8f
Update "Custom Pipeline Example" in documentation #569
tdruez a41a389
Add unit test for spdx_package_to_discovered_package_data #569
tdruez 0edc4c2
Fix _get_license_matches_grouped and improve testing #569
tdruez 49a9eb6
Enhance unit tests #569
tdruez c4e277f
Ensure the policies index is empty #569
tdruez 932046f
Store AttributeError as ProjectError during data migration #569
tdruez 2aa8c70
Merge branch 'main' into 569-toolkit-upgrade-v32
tdruez d01a9e1
Use proper model creation for ProjectError in data migration #569
tdruez 5dc9499
Refactored the compliance alert implementation #569
tdruez 62549d6
Fix problematic path in expected files #569
tdruez acc96ca
Add debug statement #569
tdruez ab8df20
Fix failing test expected file #569
tdruez 7b54a4d
Improve performances of the charts view (25x faster) #569
tdruez 3cf3d58
Add missing DB indexes on Project model #569
tdruez f94a76e
Bump version to not display warning on new runs #569
tdruez 4293f91
Replace Counter.total as not available before py3.10 #569
tdruez 8fd42e2
Update help_text for percentage_of_license_text field #569
tdruez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
121 changes: 121 additions & 0 deletions
121
scanpipe/migrations/0030_scancode_toolkit_v32_model_updates.py
This file contains hidden or 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,121 @@ | ||
| # Generated by Django 4.2 on 2023-05-05 06:52 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("scanpipe", "0029_codebaseresource_scanpipe_co_type_ea1dd7_idx_and_more"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RemoveIndex( | ||
| model_name="discoveredpackage", | ||
| name="scanpipe_di_license_e8ce32_idx", | ||
| ), | ||
| migrations.RenameField( | ||
| model_name="discoveredpackage", | ||
| old_name="license_expression", | ||
| new_name="declared_license_expression", | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="discoveredpackage", | ||
| name="declared_license_expression", | ||
| field=models.TextField( | ||
| blank=True, | ||
| help_text="The license expression for this package typically derived from its extracted_license_statement or from some other type-specific routine or convention.", | ||
| ), | ||
| ), | ||
| migrations.RenameField( | ||
| model_name="discoveredpackage", | ||
| old_name="declared_license", | ||
| new_name="extracted_license_statement", | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="discoveredpackage", | ||
| name="extracted_license_statement", | ||
| field=models.TextField( | ||
| blank=True, | ||
| help_text="The license statement mention, tag or text as found in a package manifest and extracted. This can be a string, a list or dict of strings possibly nested, as found originally in the manifest.", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="discoveredpackage", | ||
| name="declared_license_expression_spdx", | ||
| field=models.TextField( | ||
| blank=True, | ||
| help_text="The SPDX license expression for this package converted from its declared_license_expression.", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="discoveredpackage", | ||
| name="holder", | ||
| field=models.TextField( | ||
| blank=True, | ||
| help_text="Holders for this package. Typically one per line.", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="discoveredpackage", | ||
| name="license_detections", | ||
| field=models.JSONField( | ||
| blank=True, | ||
| default=list, | ||
| help_text="A list of LicenseDetection mappings typically derived from its extracted_license_statement or from some other type-specific routine or convention.", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="discoveredpackage", | ||
| name="other_license_detections", | ||
| field=models.JSONField( | ||
| blank=True, | ||
| default=list, | ||
| help_text="A list of LicenseDetection mappings which is different from the declared_license_expression, (i.e. not the primary license) These are detections for the detection for the license expressions in other_license_expression. ", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="discoveredpackage", | ||
| name="other_license_expression", | ||
| field=models.TextField( | ||
| blank=True, | ||
| help_text="The license expression for this package which is different from the declared_license_expression, (i.e. not the primary license) routine or convention.", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="discoveredpackage", | ||
| name="other_license_expression_spdx", | ||
| field=models.TextField( | ||
| blank=True, | ||
| help_text="The other SPDX license expression for this package converted from its other_license_expression.", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="codebaseresource", | ||
| name="detected_license_expression", | ||
| field=models.TextField(blank=True, help_text="The license expression summarizing the license info for this resource, combined from all the license detections"), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="codebaseresource", | ||
| name="detected_license_expression_spdx", | ||
| field=models.TextField(blank=True, help_text="The detected license expression for this file, with SPDX license keys"), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="codebaseresource", | ||
| name="license_detections", | ||
| field=models.JSONField( | ||
| blank=True, default=list, help_text="List of license detection details." | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="codebaseresource", | ||
| name="license_clues", | ||
| field=models.JSONField( | ||
| blank=True, default=list, help_text="List of license matches that are not proper detections and potentially just clues to licenses or likely false positives. Those are not included in computing the detected license expression for the resource." | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="codebaseresource", | ||
| name="percentage_of_license_text", | ||
| field=models.FloatField(blank=True, help_text="The percentage of words in the whole resource which are legal words, i.e. words that typically contain license related information.", null=True), | ||
| ), | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.