Skip to content

Commit

Permalink
internal/report: add single-report priority override
Browse files Browse the repository at this point in the history
Change-Id: Icc3df6dc395a05e834c342f2ca7f848299e23f81
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/620356
Reviewed-by: Maceo Thompson <maceothompson@google.com>
Auto-Submit: Tatiana Bradley <tatianabradley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
  • Loading branch information
tatianab authored and gopherbot committed Oct 16, 2024
1 parent ebbdcbc commit 20d13ad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func TestLintReports(t *testing.T) {
// This can happen because the initial quick triage algorithm
// doesn't know about all affected modules - just the one
// listed in the Github issue.
if r.IsUnreviewed() {
if r.IsUnreviewed() && !r.UnreviewedOK {
pr, _ := priority.AnalyzeReport(r, rc, modulesToImports)
if pr.Priority == priority.High {
t.Errorf("UNREVIEWED report %s is high priority (should be REVIEWED) - reason: %s", filename, pr.Reason)
Expand Down
1 change: 1 addition & 0 deletions data/reports/GO-2024-3171.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ source:
id: GHSA-mc76-5925-c5p6
created: 2024-10-11T13:24:14.982923-04:00
review_status: UNREVIEWED
unreviewed_ok: true
3 changes: 3 additions & 0 deletions internal/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ type Report struct {
SourceMeta *SourceMeta `yaml:"source,omitempty"`

ReviewStatus ReviewStatus `yaml:"review_status,omitempty"`
// Allow this report to be UNREVIEWED regardless of it's modules'
// priorities.
UnreviewedOK bool `yaml:"unreviewed_ok,omitempty"`

// (For unexcluded reports) The reason this report was previously
// excluded. Not published to OSV.
Expand Down
2 changes: 0 additions & 2 deletions internal/triage/priority/priority.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ var override map[string]Priority = map[string]Priority{
// information without intervention.
"github.com/argoproj/argo-cd": Low,
"github.com/argoproj/argo-cd/v2": Low,
// For #3171
"github.com/containers/common": Low,
}

func priority(mp string, importers int, sc map[reportState]int) *Result {
Expand Down

0 comments on commit 20d13ad

Please sign in to comment.