fix(review): delegate merge-train low-signal classification to canonical path-matchers (#8647) - #8696
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…cal path-matchers
src/review/merge-train.ts hand-rolled its own low-signal file/dir detection that had drifted from the
canonical set its sibling files already use:
- LOW_SIGNAL_FILENAME_RE matched only package-lock.json/yarn.lock/pnpm-lock.yaml/Cargo.lock (4 names),
so two PRs sharing only a poetry.lock, go.sum, npm-shrinkwrap.json, etc. were treated as a real
overlap and forced into a spurious merge-train wait.
- LOW_SIGNAL_DIR_RE matched only dist/build/coverage/node_modules, missing 'out' and the vendored-code
family (vendor/vendored/third_party/bower_components/jspm_packages).
Replace the filename regex with the canonical isLockfile() helper from path-matchers.ts (the same
dependency-free leaf utility review-diff.ts and review-grounding.ts already delegate to, covering all
24+ lockfile formats), and extend the directory regex to the canonical generated/vendored set. Two
new tests prove PRs sharing only poetry.lock/go.sum or vendor/third_party paths now decide {wait:false}
where they previously decided {wait:true}.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8696 +/- ##
==========================================
- Coverage 93.76% 90.57% -3.20%
==========================================
Files 797 97 -700
Lines 79454 22516 -56938
Branches 24070 3893 -20177
==========================================
- Hits 74504 20393 -54111
+ Misses 3565 1945 -1620
+ Partials 1385 178 -1207
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-25 23:53:49 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Problem
Closes #8647.
src/review/merge-train.ts:52-53hand-rolled its own low-signal file/directory detection that had drifted from the canonical pattern its sibling files already use:LOW_SIGNAL_FILENAME_REmatched onlypackage-lock.json|yarn.lock|pnpm-lock.yaml|Cargo.lock(4 names), versus the canonicalLOCKFILE_NAMESset (24+ entries incl.npm-shrinkwrap.json,poetry.lock,go.sum,bun.lock,composer.lock, …). Two PRs sharing only, say, apoetry.lockorgo.sumwere treated as a real overlap and forced into a spurious merge-train wait.LOW_SIGNAL_DIR_REmatched onlydist|build|coverage|node_modules, missingoutand the vendored-code family (vendor|vendored|third_party|bower_components|jspm_packages).review-diff.tsandreview-grounding.tsalready delegate lockfile-name matching to the canonicalisLockfile();merge-train.tswas the holdout, out of a mistaken concern that importing it would pull in a whole review-pipeline module —isLockfileis a dependency-free leaf utility.Fix
LOW_SIGNAL_FILENAME_REwith the canonicalisLockfile()frompath-matchers.ts(imported the same way the sibling files do), covering all 24+ lockfile formats and never drifting again.LOW_SIGNAL_DIR_REto the canonical generated/vendored set: addsoutandvendor|vendored|third_party|third-party|bower_components|jspm_packages.All 4 originals remain covered (
cargo.lockis inLOCKFILE_NAMES, matched case-insensitively vianormalizeForMatch), so there is no regression.Tests
Two new tests in
test/unit/merge-train.test.tsmirror the existing lockfile/distcase:poetry.lock+go.sumdecide{wait: false}(previously{wait: true}).vendor/…+third_party/…decide{wait: false}(previously{wait: true}).Reverting either source change makes its test fail. All 27 tests pass;
git diff --checkclean.