Implement DiscoveredDependency model - #486
Conversation
a5594ae to
6fe6052
Compare
|
@tdruez What would be a better way to write this migration query? https://github.com/nexB/scancode.io/blob/e2c9bcdae3530c379f17478f40303a94a9939659/scanpipe/migrations/0023_migrate_dependencies.py#L8 I am trying to populate the DiscoveredDependency table from the dependency data stored in the JSON fields on DiscoveredPackage before I remove the field. |
@JonoYang unfortunatly, I don't think there's an easy way here to use I would refactor the code into something along: |
7413e38 to
f301e27
Compare
2cc57ed to
250a7ce
Compare
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Thomas Druez <tdruez@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
This reverts commit c9b8bed. Sorting Packages, Dependencies, and Resources from DatafileHandler.assemble() will never work. The code needs to be changed in scancode-toolkit. Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
* This is so we are consistent with scancode-toolkit JSON output
* Update expected test results
Signed-off-by: Jono Yang <jyang@nexb.com>
* Update test expectations Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
* Create new dependency list and detail views
* Update assemble_packages() to create DiscoveredDependencies
* Update test expectations
Signed-off-by: Jono Yang <jyang@nexb.com>
* Remove for_package_uid and replace with ForeignKey for_package
* Remove datafile_path and replace with ForeignKey datafile_resource
* Create properties for the two removed fields
* Update dependency views to link to datafile_resource
* Update expected test results
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
* Add strip_datafile_path_root to DiscoveredDependency.create_from_data
* This argument strips the root path segment from `datafile_path` before using the path to look up the corresponding CodebaseResource
* This is used in the case where we are importing a scan from scancode-toolkit, where the root path segments are not stripped by default
* Update expected test results
Signed-off-by: Jono Yang <jyang@nexb.com>
* Used cached_property for DiscoveredDependency properties Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
* Order DiscoveredDependencies by is_runtime, is_optional, is_resolved, and dependency_uid
* Do not show dependency_uid value in DiscoveredDependency list view
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
9c54a9b to
b63981c
Compare
* Use updated table header include
* Update dependency presentation in package detail view
* Show package uid on hover on for package tab
Signed-off-by: Jono Yang <jyang@nexb.com>
b63981c to
633a656
Compare
* Update DiscoveredDependency ordering Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
* Update DiscoveredDependency ordering
* Update daglib test expectations
Signed-off-by: Jono Yang <jyang@nexb.com>
* Update test expectations Signed-off-by: Jono Yang <jyang@nexb.com>
00f803e to
40862fe
Compare
Signed-off-by: Thomas Druez <tdruez@nexb.com>
Signed-off-by: Thomas Druez <tdruez@nexb.com>
Signed-off-by: Thomas Druez <tdruez@nexb.com>
Signed-off-by: Thomas Druez <tdruez@nexb.com>
Signed-off-by: Thomas Druez <tdruez@nexb.com>
|
@JonoYang What's the status on your side? Could you provide a list of what's left todo on this one?
|
Signed-off-by: Thomas Druez <tdruez@nexb.com>
* Only show links in dependency for_package tab or dependency datafile_resource tab if there is a value Signed-off-by: Jono Yang <jyang@nexb.com>
* Use UpdateFromDataMixin in DiscoveredDependency
* Create test for DiscoveredDependency.update_from_data()
Signed-off-by: Jono Yang <jyang@nexb.com>
f4fc4d1 to
0fa6783
Compare
I think we're ready to go for now as the important stuff is here:
I was taking a look at #445 with this branch and I run into an issue with rubygem packages and their dependencies being reported multiple times. This is an issue with scancode-toolkit, and not scancode.io (aboutcode-org/scancode-toolkit#3072). I've also run into the license scan errors that you reported earlier.
Thanks! I've updated the
I skipped this initially because we did not have purl fields in the DiscoveredDependency model. We can have this check again now that we're using the PURL field mixin in DiscoveredDependencies. |
Signed-off-by: Thomas Druez <tdruez@nexb.com>

This PR adds the DiscoveredDependency model to scancode.io. New views, based off the existing DiscoveredPackage views, have been added for DiscoveredDependency.
This is the second PR split from #482 and is built on top of #485