From b5ae00ed71b5bd386c42e93edf6d2820b8fcd6b9 Mon Sep 17 00:00:00 2001 From: Jordan Hury Date: Wed, 17 Jun 2026 11:39:22 +0300 Subject: [PATCH] Log audit errors when partial results are allowed (v2 backport). When allow_partial_results is enabled, frogbot continued without failing but only logged a generic warning, hiding the underlying audit error. Include the actual error in the warning so pipelines remain debuggable. Backport of #1352 for master. Co-authored-by: Cursor --- scanrepository/scanrepository.go | 2 +- utils/utils.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scanrepository/scanrepository.go b/scanrepository/scanrepository.go index 0dee66434..111052f04 100644 --- a/scanrepository/scanrepository.go +++ b/scanrepository/scanrepository.go @@ -291,7 +291,7 @@ func (cfp *ScanRepositoryCmd) fixVulnerablePackages(repository *utils.Repository err = cfp.fixIssuesSeparatePRs(repository, vulnerabilitiesByWdMap) } if err != nil { - return utils.CreateErrorIfPartialResultsDisabled(cfp.scanDetails.AllowPartialResults(), fmt.Sprintf("failed to fix vulnerable dependencies: %s", err.Error()), err) + return utils.CreateErrorIfPartialResultsDisabled(cfp.scanDetails.AllowPartialResults(), "failed to fix vulnerable dependencies", err) } return } diff --git a/utils/utils.go b/utils/utils.go index fc422b595..a62dd3ef9 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -585,7 +585,7 @@ func isUrlAccessible(url string) bool { // This function checks if partial results are allowed by the user. If so instead of returning an error we log the error and continue as if we didn't have an error func CreateErrorIfPartialResultsDisabled(allowPartial bool, messageForLog string, err error) error { if allowPartial { - log.Warn(messageForLog) + log.Warn(fmt.Sprintf("%s: %v", messageForLog, err)) return nil } return err