Skip to content

Commit

Permalink
internal/report: add field unexcluded to YAML
Browse files Browse the repository at this point in the history
Record the reason a report was previously excluded when
unexcluding it. This will allow us to take this info into account
when deciding the priority of new reports.

Change-Id: I6ad08f28ca7f9bec78280f30db35b0b6546085db
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/592776
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
  • Loading branch information
tatianab committed Jun 20, 2024
1 parent 0fee238 commit 4ec3107
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/vulnreport/unexclude.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (u *unexclude) run(ctx context.Context, input any) (err error) {
if err != nil {
return err
}
r.Unexcluded = oldR.Excluded
if err := u.write(ctx, r); err != nil {
return err
}
Expand Down
4 changes: 4 additions & 0 deletions internal/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ type Report struct {
SourceMeta *SourceMeta `yaml:"source,omitempty"`

ReviewStatus ReviewStatus `yaml:"review_status,omitempty"`

// (For unexcluded reports) The reason this report was previously
// excluded. Not published to OSV.
Unexcluded ExcludedReason `yaml:"unexcluded,omitempty"`
}

// This wrapper is needed so we can define YAML functions on this type.
Expand Down

0 comments on commit 4ec3107

Please sign in to comment.