fix(db): escape review-burst repo prefix matching - #3973
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-07 08:24:38 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 4 non-blocking
Concerns raised — review before merging
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3973 +/- ##
=======================================
Coverage 93.68% 93.68%
=======================================
Files 373 373
Lines 34895 34897 +2
Branches 12768 12768
=======================================
+ Hits 32692 32694 +2
Misses 1584 1584
Partials 619 619
🚀 New features to boost your workflow:
|
Motivation
LIKEpattern built fromrepoFullName, so_/%in repo names could act as wildcards and cause cross-repo matching and misattributed ops alerts.targetKeyunder the wrong repository.Description
LIKEmetacharacters before building the prefix pattern by addingescapeSqlLikePattern()and usingtargetPrefixPattern =${escapeSqlLikePattern(repoFullName)}#%``.like(...)predicate with a rawSQLfragment usingLIKE ... ESCAPE '\'to ensure metacharacters are literal.likeimport fromsrc/db/repositories.ts.test/unit/db-parsers.test.tsthat provesowner/foo_bardoes not matchowner/fooXbar#...(covers the underscore-case regression).Testing
npm run typecheckand it succeeded.npx vitest run test/unit/db-parsers.test.tsand the file's suite passed (the new regression test included).npm run test:coverage) but the repository's full test suite did not finish in this environment before the run was stopped; the added focused unit test and typecheck were used to validate the fix.Codex Task