fix(review): scan patch-less PR files for leaked secrets - #3473
fix(review): scan patch-less PR files for leaked secrets#3473RealDiligent wants to merge 3 commits into
Conversation
) Extract patch-less secret-scan enrichment into patchless-secret-scan.ts with full unit coverage. When GitHub omits inline diff for binary/large files, fetch head/base content via Contents API and synthesize scannable + lines before the unconditional secret_leak hard blocker runs. Co-authored-by: Cursor <cursoragent@cursor.com>
…SONbored#3464) Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-05 08:45:49 UTC
🛑 Suggested Action - Reject/Close
Review summary Blockers
Nits — 6 non-blocking
Why this is blocked
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (No linked issue detected; Maintainer requires a linked issue; AI reviewers agree on a likely critical defect: src/queue/patchless-secret-scan.ts:121 passes exactly SECRET_SCAN_PATCH_FALLBACK_MAX_CHARS to getFileContent, but the existing fetchFullFileContents pattern requests max+1 before checking length; if the fetcher truncates to the requested cap, a >512KB patch-less file is scanned as a complete 512KB prefix instead of producing the fail-closed incomplete finding, so change the head/base fetches to request SECRET_SCAN_PATCH_FALLBACK_MAX_CHARS + 1 and keep the existing > cap check.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3473 +/- ##
==========================================
+ Coverage 93.01% 93.03% +0.01%
==========================================
Files 297 298 +1
Lines 31013 31091 +78
Branches 11310 11338 +28
==========================================
+ Hits 28846 28924 +78
Misses 1512 1512
Partials 655 655
🚀 New features to boost your workflow:
|
Problem
The unconditional
secret_leakhard blocker scans only+lines frombuildSecretScanDiff. GitHub omits inlinepatchfor binary/large changed files (>~1 MB), so those files produced header-only entries with no scannable body.Fix
src/queue/patchless-secret-scan.tswith dedicated unit tests.Pre-PR validation (local)
npm run typechecktest/unit/patchless-secret-scan.test.ts— 41 tests passpatchless-secret-scan.ts— 100% statements/branches/lines locallyCI