Repository navigation
fix(vcs): stop recording expected GitHub and scan outcomes as errors - #2710
Conversation
- vendor-http: a 3xx answer ends its attempt span Ok. GitHub's job log endpoint always answers 302 to the signed download, which made ~29k error spans in two days. - GithubAppClient.getCommit: a blocked repository (451, or 403 with a block) fails as VcsRepositoryBlockedError, like the listing calls. - DependencyScanner: a blocked, gone or uninstalled repository is a RepositoryUnreachable outcome, and a tree too large to list records its failed scan row and returns TreeTooLarge, both without failing the span. The plan cache holds null for a truncated tree instead of failing inside the cache span. - VcsSource*NotFoundError move to the domain with a 404, so a wrong guess by the agent's code tools is an anticipated outcome. - lockfiles: strip a byte order mark before parsing, read bun.lock comments as Bun does, and name the yarn.lock entry a parse failure is about.
This comment has been minimized.
This comment has been minimized.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
| if (truncated) { | ||
| const failed = yield* store | ||
| .failScan({ orgId, scanId: started.id, error: TREE_TOO_LARGE }) | ||
| .pipe(Effect.mapError(scanError("Could not record the scan"))) |
There was a problem hiding this comment.
🟡 Interrupted oversized-tree scans remain running
Cancellation during failScan now leaves an oversized-tree scan running instead of failed. This branch bypasses run and its Effect.onError cleanup. Recovery requires another scan after the abandoned-scan threshold.
Learn more
The truncated-tree result now updates its persisted scan outside the error cleanup surrounding run. Cancelling the fiber while that update waits for database I/O can leave the row created by startScan in running. Previously, truncation failed inside run, so Effect.onError performed the failure update as interruption-protected cleanup. failAbandonedScans repairs the row only when another scan starts after the abandonment threshold.
Example: A manual scan finds a truncated tree and creates its scan row. Cancel its fiber while failScan waits for the database. The row remains running rather than recording the oversized-tree result.
Recommended fix: Protect the truncated-tree settlement against interruption, or move it into a shared lifecycle boundary that guarantees settlement for every row created by startScan. Add a cancellation test that stalls the truncated-tree failure update and verifies the row ends as failed.
Was this helpful? React with 👍 or 👎 to provide feedback.
Maple review🟢 Confidence 10/10 · safe to merge. Every new outcome is pinned by a test and each caller path checked out; the oversized-tree branch that writes its own failed row is the one path to watch. Turns expected VCS and scan outcomes (blocked repos, oversized trees, missing source files, BOM/commented lockfiles) from failures into answers, with a test per behaviour. It addresses all five open
Production impactOpen errors in the changed files (3)
After this merges, Maple checks whether they stop.
|
Error triage for the VCS area. Every change stops an expected outcome from being recorded as a server error, or fixes a parser gap behind one.
What changes
/repos/{o}/{r}/actions/jobs/{id}/logs) always answers 302 with the signed download URL, whichstreamJobLogfollows by hand. Each of those attempts was an Error span: about 29kVendorHttpError: github answered 302in two days, still firing. The call still fails to its caller with thelocation, so nothing downstream changes. 4xx and 5xx spans still fail.VcsRepositoryBlockedError, the same way the listing calls already do. Callers map it throughtoVcsCommitErroralready.RepositoryUnreachableoutcome when the ref lookup fails. The span stays Ok. Before, every scheduled scan of such a repo raised aDependencyScanError, and it never wrote a scan row anyway.TreeTooLargeand no longer fails the scan span.nullfor a truncated tree instead of failing insideEdgeCacheService.getOrCompute. That failure was theTreeTruncatederror issue.PLAN_VERSIONis bumped for the new cache shape.@maple/domain/httpwith a 404, keeping their tags. When the agent's code tools guess a path, ref or repo that does not exist, the span is now an anticipated outcome, not an error issue. Regeneratedanticipated-error-identifiers.ts.JSON.parserejects it.bun.lockcomments the way Bun does.PARSER_VERSIONis bumped so lockfiles cached as unreadable get parsed again.Verification
bunx vitest runonvendor-http.test.ts,integrations/vcs,dependency-scan: 365 passed. New tests:ends a 3xx attempt's span Ok and still fails the call, while a 4xx span failsfails a commit lookup in a blocked repository as the repository being blockedanswers a repository the provider blocks or lost as unreachable, recording no scanlib/lockfiles: 120 passed, including the BOM, bun comment and yarn message tests.apps/aisource-code.test.tsandsandbox.test.tspass. The domain anticipated-errors drift test passes.tsrs --noEmitfor backend, domain and lockfiles.oxlint -c .oxlintrc.effect.jsonon the changed files.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.