Skip to content

depsdev: FetchAdvisoriesBatch silently drops fetch failures (severity data loss) #445

@kotakanbe

Description

@kotakanbe

Surfaced during review of #440 (pre-existing; out of scope for that PR).

internal/infrastructure/depsdev/advisory.goFetchAdvisoriesBatch returns map[string]*AdvisoryDetail with no error return. On a per-advisory fetch failure it logs at DEBUG and drops the entry:

detail, err := c.FetchAdvisory(ctx, advisoryID)
if err != nil {
    slog.Debug("failed to fetch advisory detail", "id", advisoryID, "error", err)
    return "", nil, false   // dropped — caller cannot distinguish "no advisory" from "fetch failed"
}

The completion log is also DEBUG, so a partial result (e.g. severity data missing due to a transient 5xx) is indistinguishable downstream from "package has no advisories". This can understate vulnerability severity silently.

Fix options

  • Return a failed-ID set (or error) alongside the map so callers can surface/retry, or
  • At minimum, log failures at WARN with a count after the batch.

Acceptance

  • Advisory fetch failures are observable to callers or surfaced at WARN with counts (not silently dropped at DEBUG).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglang:go

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions