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

scan and report dependency groups of vulnerabilities #655

Merged
merged 20 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
cuixq committed Nov 27, 2023
commit a9a213ec2c5b9a5e22f2167d1b2471e1149a37d8
4 changes: 1 addition & 3 deletions internal/ci/vulnerability_result_diff.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package ci

import (
"reflect"

"github.com/google/osv-scanner/pkg/grouper"
"github.com/google/osv-scanner/pkg/models"
"golang.org/x/exp/slices"
Expand All @@ -28,7 +26,7 @@ func DiffVulnerabilityResults(oldRes, newRes models.VulnerabilityResults) models
resultPS := &result.Results[len(result.Results)-1]
for _, pv := range ps.Packages {
pkgs := oldRes.Results[sourceIdx].Packages
pkgIdx := slices.IndexFunc(pkgs, func(elem models.PackageVulns) bool { return reflect.DeepEqual(elem.Package, pv.Package) })
pkgIdx := slices.IndexFunc(pkgs, func(elem models.PackageVulns) bool { return elem.Package == pv.Package })
if pkgIdx == -1 {
// Newly introduced package, so all results for this package are going to be new, add everything for this package
resultPS.Packages = append(resultPS.Packages, pv)
Expand Down
1 change: 1 addition & 0 deletions pkg/lockfile/parse-requirements-txt.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func parseRequirementsTxt(f DepFile, requiredAlready map[string]struct{}) ([]Pac
return true
}
}

return false
}

Expand Down
Loading