Skip to content

Conversation

ziadhany
Copy link
Collaborator

@ziadhany ziadhany commented Aug 25, 2025

Add a test for the ProjectKB importer and  collect fix commits pipeline.

Signed-off-by: ziad hany <[email protected]>
@ziadhany ziadhany requested review from TG1999 and keshav-space and removed request for keshav-space October 15, 2025 14:50
Copy link
Member

@keshav-space keshav-space left a comment

Choose a reason for hiding this comment

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

Thanks @ziadhany, see some suggestions.

if not commit_id or not repo_url:
continue

commit_url = repo_url.replace(".git", "") + "/commit/" + commit_id
Copy link
Member

Choose a reason for hiding this comment

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

This path is only valid for GitHub repos, are we sure we only have GitHub repos in project kb advisory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, Project KB Advisory is just one GitHub repository.

Comment on lines +54 to +56
advisories = AdvisoryV2.objects.filter(advisory_id__in=vuln_ids).prefetch_related(
"impacted_packages__affecting_packages"
)
Copy link
Member

Choose a reason for hiding this comment

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

We do not want to merge the advisory info coming from different source.

for impact in advisory.impacted_packages.all():
for pkg in impact.affecting_packages.all():
codefixes.append(
CodeFixV2(
Copy link
Member

Choose a reason for hiding this comment

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

IMHO we should treat this as an advisory and update impact_package model to hold the fixed and affecting commit.

Copy link
Collaborator Author

@ziadhany ziadhany Oct 20, 2025

Choose a reason for hiding this comment

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

The main issue is how to relate a fix commit to an impacted package.
A large portion of existing fix commit databases only provide the CVE-XXXX, the Git commit, and the repository.

IMHO, we should have an advisory, but the code fix should be considered as a reference URL, with an optional relation to the impacted packages. Since we don't know which version or package (purl) is going to be impacted by this commit.

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.

2 participants