Skip to content

update govulncheck integration #431

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 2 commits into from
Jul 7, 2023
Merged

Conversation

julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Jul 2, 2023

No description provided.

@oliverchang oliverchang requested a review from another-rex July 3, 2023 00:54
Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Thanks! Implementation looks good!, can you move the deleted test-project fixtures into sourceanalysis so we can still have the integration test?

if !ok { // If vulnerability not found, check if it contain any source information
fillNotImportedAnalysisInfo(vulnsByID, vulnID, pv, analysis)
continue
}
// Module list is unlikely to be very big, linear search is fine
containsModule := slices.ContainsFunc(gvcVuln.Modules, func(module *govulncheck.Module) bool {
return module.Path == pv.Package.Name
var modulePaths []string
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part can be replaced a direct map key check, something like:

called, hasModule := moduleToCalled[pv.Package.Name];
(*analysis)[vulnID] = models.AnalysisInfo{
	Called: hasModule && called,
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! I left out the hasModule bit, since we want to set Called to false regardless of if pv.Package.Name is not in the map, or is present but has a value of false

@julieqiu
Copy link
Contributor Author

julieqiu commented Jul 3, 2023

Thanks! Implementation looks good!, can you move the deleted test-project fixtures into sourceanalysis so we can still have the integration test?

Added

Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

LGTM!

@another-rex another-rex merged commit fc60a02 into google:main Jul 7, 2023
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