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

feat: Add semver_range to dependency processing and improve logging #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Ptradtya26
Copy link
Contributor

@Ptradtya26 Ptradtya26 commented Dec 13, 2024

Summary

Adds support for populating the semver_range field in the DependsOn table.
Improves logging for missing licenses and packages.

Changes

Modified _process_depends_on in core/db.py to include semver_range.
Improved logging in core/db.py for better debugging.

Why This Change is Necessary

Ensures the semver_range field is populated, making dependency data more granular and useful.
Provides clearer debugging messages for missing licenses and dependencies.

Additional Changes

Replaced all instances of self.logger.warn with self.logger.log as per feedback from the maintainers.

core/db.py Outdated Show resolved Hide resolved
@Ptradtya26
Copy link
Contributor Author

Fixed

@sanchitram1
Copy link
Member

sanchitram1 commented Jan 2, 2025

Sorry about the late review. Some comments:

  • think the indent is wrong.
  • rest of it looks good – nice to be consistent with the rest of it

dependency_id = self.package_cache.get(item["crate_id"])
version_id = self.version_cache.get(item["version_id"])

if not dependency_id:
Copy link
Member

Choose a reason for hiding this comment

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

indent start

version_id=version_id,
dependency_id=dependency_id,
semver_range=item.get("semver_range"), # Add semver_range
).to_dict()
Copy link
Member

Choose a reason for hiding this comment

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

indent end

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