fix: return error from ScanAll when every scan attempt fails - #85
Open
Abhinesh Jha (Abhineshhh) wants to merge 1 commit into
Open
fix: return error from ScanAll when every scan attempt fails#85Abhinesh Jha (Abhineshhh) wants to merge 1 commit into
Abhinesh Jha (Abhineshhh) wants to merge 1 commit into
Conversation
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
Abhinesh Jha (Abhineshhh)
requested review from
Dariusz Porowski (DariuszPorowski) and
Mani Bindra (maniSbindra)
as code owners
July 16, 2026 19:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ScanAllalways 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 lintpasses locally - [x]task testpasses locally - [x] Documentation updated (if applicable)Stacking
Independent of the Trivy/registry stacks — can merge in any order relative to them.