Skip to content

fix: return error from ScanAll when every scan attempt fails - #85

Open
Abhinesh Jha (Abhineshhh) wants to merge 1 commit into
microsoft:mainfrom
Abhineshhh:fix/scanall-error-aggregation
Open

fix: return error from ScanAll when every scan attempt fails#85
Abhinesh Jha (Abhineshhh) wants to merge 1 commit into
microsoft:mainfrom
Abhineshhh:fix/scanall-error-aggregation

Conversation

@Abhineshhh

@Abhineshhh Abhinesh Jha (Abhineshhh) commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description ScanAll always returned nil even when every repository/image failed, so total outages still exited 0 and report generation ran against a stale DB (including nightly commits). ## Related Issue Fixes #77 ## Changes - Track attempt/failure counts across repo discovery and image scans - Continue on partial failure (unchanged behavior) - Return error only when all attempts fail - Log summary on partial failure - Unit tests for scan stats evaluation ## Checklist - [x] task lint passes locally - [x] task test passes locally - [x] Documentation updated (if applicable)


Stacking

Independent of the Trivy/registry stacks — can merge in any order relative to them.

ScanAll logged per-image and per-repository errors but always returned
nil, so a total outage still exited successfully and report generation
ran against a stale database (including nightly commits).

Track attempt/failure counts, keep partial-success behavior, and fail
only when all attempts fail. Log a summary on partial failure.

Fixes microsoft#77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ScanAll always returns nil even when every scan operation fails

1 participant