fix: cap contributor graph file path loading#894
Conversation
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #894 +/- ##
==========================================
- Coverage 96.72% 96.69% -0.04%
==========================================
Files 109 109
Lines 14750 14789 +39
Branches 5340 5352 +12
==========================================
+ Hits 14267 14300 +33
Misses 95 95
- Partials 388 394 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
gittensory · advisory review Reviewed 6 changed file(s) — two independent AI reviewers. Changed files: Suggested action: 🛠️ Request changes. (reviewers split: request changes / merge) Address the suggestions below before merging. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 74b4655 | Commit Preview URL Branch Preview URL |
Jun 19 2026, 06:02 AM |
Motivation
pull_request_filesrows (includingpayloadJson) across many repositories, allowing an authenticated contributor to amplify resource usage and cause Worker/D1 OOMs or CPU exhaustion.repoFullName,pullNumber, andpath, so loading full payloads is unnecessary and unsafe at scale.Description
PullRequestFilePathRecordinsrc/types.tsand update evidence graph inputs to accept it instead of the fullPullRequestFileRecord.listRepoPullRequestFilePathsinsrc/db/repositories.tsthat selects onlyrepoFullName,pullNumber, andpathwith optionalpullNumbersfiltering and a per-querylimit, avoidingpayloadJsonparsing.src/services/decision-pack.tsandsrc/queue/processors.ts, introducing total and per-repo caps (DECISION_PACK_MAX_PR_FILE_PATHS/CONTRIBUTOR_EVIDENCE_MAX_PR_FILE_PATHSand per-repo limits) and helperloadContributorPullRequestFilePathsto limit I/O and memory.src/services/contributor-evidence-graph.tsto build path edges from the lightweight path records and preserve existing graph semantics.Testing
npm run typecheckwhich completed successfully.npx vitest run test/unit/contributor-evidence-graph.test.ts test/unit/decision-pack.test.tsand those unit tests passed.test/unit/queue.test.tswas stopped after existing queue tests exhibited unrelated timeouts/failures; the focused tests above validate the changed code paths.Codex Task