Repository navigation
fix(backend): continue evidence collection after a plain 403 (#621) - #640
Open
Yuncan050115 wants to merge 1 commit into
Open
Yuncan050115 wants to merge 1 commit into
Yuncan050115 wants to merge 1 commit into
Conversation
Yuncan050115
requested review from
AsperforMias,
KurosawaGeeker and
hikariming
as code owners
November 4, 2026 13:08
Yuncan050115
force-pushed
the
fix/hydrate-evidence-plain-403
branch
from
November 4, 2026 16:38
2ff8f86 to
644e40a
Compare
… 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
force-pushed
the
fix/hydrate-evidence-plain-403
branch
from
November 4, 2026 16:54
644e40a to
d69c03a
Compare
This branch has not been deployed
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.
hydrateTopRepoEvidenceintended to skip repositories with unavailable evidence, butrestGetwrapsErrGitHubUnavailablewith%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.Isfor 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
httptestcases 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-passCollectmerge 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/andgo 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:boundaryhits the repository'sC:\\C:\\...Windows path issue;scoring/is unchanged. TypeScript checks were not run because this PR changes only Go files.Refs #621