Repository navigation
refactor: extract candidateCollector from queueManipulation (phase 3.5) - #669
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 40 minutes and 47 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
- Extract collectRecommendationCandidates orchestration to candidateCollector.ts - Move shouldIncludeCandidate and upsertScoredCandidate helpers - Re-export from queueManipulation for backward compatibility - Add 7-test suite with 100% coverage of collector functions - queueManipulation.ts: 1852 → 1757 LOC (-95) - All 131 existing queueManipulation tests pass - Ready for phase 3.6 (replenisher extraction) Ref: Phase 3.5 of lucky-refactor-map.md
- Add 14 comprehensive tests covering all code paths - Test collectRecommendationCandidates with multiple scenarios - Test edge cases: disliked tracks, duplicates, -Infinity scores - Test merging from multiple seed sources - All tests passing, targeting >80% coverage for SonarCloud gate
b010e49 to
ff13f1f
Compare
|
…5) (#669) * refactor: extract candidateCollector from queueManipulation (phase 3.5) - Extract collectRecommendationCandidates orchestration to candidateCollector.ts - Move shouldIncludeCandidate and upsertScoredCandidate helpers - Re-export from queueManipulation for backward compatibility - Add 7-test suite with 100% coverage of collector functions - queueManipulation.ts: 1852 → 1757 LOC (-95) - All 131 existing queueManipulation tests pass - Ready for phase 3.6 (replenisher extraction) Ref: Phase 3.5 of lucky-refactor-map.md * test: expand candidateCollector tests for coverage gate - Add 14 comprehensive tests covering all code paths - Test collectRecommendationCandidates with multiple scenarios - Test edge cases: disliked tracks, duplicates, -Infinity scores - Test merging from multiple seed sources - All tests passing, targeting >80% coverage for SonarCloud gate



Summary
Extracts the recommendation candidate collection logic from the god-object
queueManipulation.tsinto a dedicatedcandidateCollector.tsmodule.Changes
New file:
packages/bot/src/utils/music/autoplay/candidateCollector.ts(157 LOC)collectRecommendationCandidates— orchestrates Spotify + LastFm + YouTube sourcingshouldIncludeCandidate— duplicate/exclusion filteringupsertScoredCandidate— scored candidate pool managementScoredTracktype exportedUpdated:
queueManipulation.tsreduced from 1852 → 1757 LOC (-95 lines)candidateCollector_replenishQueueorchestration remains intactTesting
candidateCollector.spec.tswith 7 tests, 100% coveragequeueManipulation.spec.tstests passImpact
queueManipulationby isolating candidate poolingRef: Phase 3.5 of
lucky-refactor-map.md