Skip to content
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

Add children_packages m2m and rename resolved_to_package #1066 #1252

Merged
merged 6 commits into from
Jun 4, 2024

Conversation

tdruez
Copy link
Contributor

@tdruez tdruez commented Jun 3, 2024

  1. Rename DiscoveredDependency resolved_to to resolved_to_package, and resolved_dependencies to resolved_from_dependencies for clarity and consistency.
  2. Add children_packages and parent_packages ManyToMany field on the DiscoveredPackage model.
  3. Add full dependency tree in the CycloneDX output.

We now have:

  • DiscoveredDependency.for_package: The package that declares this dependency.
  • DiscoveredDependency.resolved_to_package: The resolved package for this dependency. If empty, it indicates the dependency is unresolved.
  • DiscoveredPackage.children_packages: List of direct dependency packages.
  • DiscoveredPackage.parent_packages: List of direct parent packages.
  • DiscoveredPackage.declared_dependencies: List of declared dependencies in this package.
  • DiscoveredPackage.resolved_from_dependencies: List of dependencies resolved from this package.

You'll notice that field names are now explicit and consistent:

  • *_package is a package instance
  • *_packages is a package queryset
  • *_dependency is a dependency instance
  • *_dependencies is a dependency queryset

@pombredanne @AyanSinhaMahapatra @Hritik14 Please have a look at those changes and additions and let me know you thoughts.

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! this looks great.
FWIW: I am not convinced that the parent/children name is the best, but I have no immediate alternative to offer... we could evolve this later

Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tdruez This looks great thanks! I will update my PR accordingly once this is merged.

@tdruez tdruez merged commit 49f9c07 into main Jun 4, 2024
8 checks passed
@tdruez tdruez deleted the 1066-dependencies branch June 4, 2024 07:37
@tdruez tdruez mentioned this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants