Skip to content

Commit a460ba8

Browse files
committed
cmd/vulnreport: fix excluded folder bug
Fix bug in which excluded reports would be published to the wrong folder. This was accidentally introduced in a recent refactor and no reports were actually published to the wrong folder (this would have been caught before submit if it had occurred). Change-Id: Icc9eb99b2ceb185310e99eaa39e45072e0ae6c80 Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/590280 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Damien Neil <[email protected]>
1 parent 2b1dca0 commit a460ba8

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

cmd/vulnreport/creator.go

+16-11
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,21 @@ func (c *creator) reportFromMeta(ctx context.Context, meta *reportMeta) error {
139139
report.WithAliases(aliases),
140140
report.WithReviewStatus(meta.reviewStatus),
141141
)
142+
143+
if meta.excluded != "" {
144+
raw = &report.Report{
145+
ID: meta.id,
146+
Modules: []*report.Module{
147+
{
148+
Module: meta.modulePath,
149+
},
150+
},
151+
Excluded: meta.excluded,
152+
CVEs: raw.CVEs,
153+
GHSAs: raw.GHSAs,
154+
}
155+
}
156+
142157
fname, err := raw.YAMLFilename()
143158
if err != nil {
144159
return err
@@ -173,17 +188,7 @@ func (c *creator) reportFromMeta(ctx context.Context, meta *reportMeta) error {
173188

174189
switch {
175190
case meta.excluded != "":
176-
r.Report = &report.Report{
177-
ID: meta.id,
178-
Modules: []*report.Module{
179-
{
180-
Module: meta.modulePath,
181-
},
182-
},
183-
Excluded: meta.excluded,
184-
CVEs: r.CVEs,
185-
GHSAs: r.GHSAs,
186-
}
191+
// nothing
187192
case meta.reviewStatus == report.Unreviewed:
188193
r.Description = ""
189194
addNotes := true

0 commit comments

Comments
 (0)