Skip to content

fix(backend): continue evidence collection after a plain 403 (#621) - #640

Open
Yuncan050115 wants to merge 1 commit into
FindAny:mainfrom
Yuncan050115:fix/hydrate-evidence-plain-403
Open

Yuncan050115 wants to merge 1 commit into
FindAny:mainfrom
Yuncan050115:fix/hydrate-evidence-plain-403

Conversation

@Yuncan050115

@Yuncan050115 Yuncan050115 commented Nov 4, 2026 •

Copy link
Copy Markdown

hydrateTopRepoEvidence intended to skip repositories with unavailable evidence, but restGet wraps ErrGitHubUnavailable with %w. Comparing the returned error with != therefore made a plain README 403 abort the loop; later repositories were never hydrated. This is the behavior isolated by @321sssrt-bit in #621.

Use errors.Is for README and language errors. The existing retryable-rate-limit error and unwrapped 404 handling are unchanged. This is deliberately the helper-level portion of #621: the caller's ignored errors and second-pass evidence merge still need their own handling; no scoring rules or coverage semantics are changed.

Added four httptest cases covering continued collection after plain README and languages 403s, aborting when a primary rate-limit response is exhausted, and missing README handling. The 403 tests fail with the original comparison and all four pass after the fix. Retry-After, cancellation, and the two-pass Collect merge are not covered by these tests.

Verified on Windows (Go 1.27.3)

  • go test ./internal/backend/ -run '^TestHydrateTopRepoEvidence' -count=1: 4/4 passed.
  • go vet ./internal/backend/ and go build ./internal/backend/: passed.
  • gofmt: clean.
  • node ops/open-core/split.mjs check: 2292 files classified, 0 public-to-private references.
  • node ops/open-core/split.mjs blockers: 0.

The complete backend suite has the same 73 pre-existing CGO/go-sqlite3 failures before and after this change (sorted failure names compared). The full module build exhausts local GC-worker memory. pnpm scoring:boundary hits the repository's C:\\C:\\... Windows path issue; scoring/ is unchanged. TypeScript checks were not run because this PR changes only Go files.

Refs #621

@ghfind-review ghfind-review Bot added the review: low ghfind author score; see https://ghfind.com label Nov 4, 2026
@Yuncan050115
Yuncan050115 force-pushed the fix/hydrate-evidence-plain-403 branch from 2ff8f86 to 644e40a Compare November 4, 2026 16:38
@Yuncan050115 Yuncan050115 changed the title fix(backend): one README 403 aborted all remaining evidence collection (#621) fix(backend): continue evidence collection after a plain 403 (#621) Nov 4, 2026
… abort

hydrateTopRepoEvidence compared readmeErr/languageErr with `!=` against
ErrGitHubUnavailable, but restGet wraps that sentinel with %w, so the
comparison never matched and one unreadable README aborted the whole
candidate loop. finishCollectedScan discards the returned error, so the
scan still reported complete_public while later repositories silently
lost their README, languages and root listing.

Use errors.Is, which is already this package's idiom for wrapped
sentinels. ErrGitHubRateLimited and the unwrapped 404 path are untouched,
so a drained token pool still aborts and a missing README still means
"no README".

Adds three httptest cases; the first one fails on the pre-fix code.

Fixes FindAny#621
@Yuncan050115
Yuncan050115 force-pushed the fix/hydrate-evidence-plain-403 branch from 644e40a to d69c03a Compare November 4, 2026 16:54

This branch has not been deployed

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

Labels

review: low ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant