Skip to content

fix: surface rest data setup errors from Setup - #471

Open
Satarupa22-SD wants to merge 1 commit into
ossf:mainfrom
Satarupa22-SD:fix-bugs
Open

fix: surface rest data setup errors from Setup#471
Satarupa22-SD wants to merge 1 commit into
ossf:mainfrom
Satarupa22-SD:fix-bugs

Conversation

@Satarupa22-SD

Copy link
Copy Markdown
Contributor

Fixes #42

@Satarupa22-SD
Satarupa22-SD requested a review from a team as a code owner August 31, 2026 19:50
@github-actions github-actions Bot added the fix label Aug 31, 2026
Signed-off-by: Satarupa22-SD <satarupa2212@gmail.com>

@jmeridth jmeridth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 (summary) Good fix for #42, and the design nailed the part I was most worried about: the joined error is caught and Warn-logged in payload.go rather than propagating to the orchestrator, so scans still degrade gracefully instead of aborting, and every per-domain error-flag contract survives (I traced all consumers). errors.Join with per-domain prefixes is the right shape. Two findings inline; the first matters because it is the PR's whole purpose.

Comment thread data/rest-data.go
wg.Wait()
return nil

return errors.Join(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 (medium) The propagation this PR exists to add is not pinned by any test: I applied two mutations in a temp tree (the vuln-reporting fetcher swallowing real API errors again, and Setup discarding the errors.Join result and returning nil) and the full suite passed both times. The changed tests only assert NoError on success and expected-absence rows. One test that injects a failing fetch and asserts Setup returns a non-nil error naming that domain would lock the behavior in.

Comment thread data/vuln_reporting.go
}
msg := err.Error()
for _, code := range codes {
if strings.Contains(msg, fmt.Sprintf("%d", code)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 (low, non-blocking) Matching "403"/"404" as substrings of the whole error text can misclassify: MakeApiCall and the retry wrapper embed the full endpoint URL in the message, so a repo or owner named "404" (these exist on GitHub) turns a real outage into an "expected absence" and silently drops it from the joined warn log. Matching against a typed status (or anchoring on "status code: 404" style substrings) avoids it. Verdicts are unaffected either way, hence non-blocking.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rest data setup method not returning error conditions

2 participants