#1676
feat: suggest only people who committed 5 times in the past 30 days (Or an average of 1.25 posts a week)
The current "Who to follow" might suggest someone with a single visible commit, so people who posted once long ago might appear next to active ones.
- Suggestions on the web, in onboarding, and through the API now only include people with at least 5 visible top-level commits in the past 30 days. Replies don't count, as before.
- Which people are picked and in what order is unchanged.
- A new activeCommitter() user factory state makes someone suggestable in tests.
The change is pretty simple. Most of the changed files were tests that needed updating. All test seem to pass.
Summary by CodeRabbit
- Updates
- Suggested users are now limited to people with at least five visible, top-level commits from the past 30 days. Replies and older commits don’t count toward eligibility.
No actionable comments were generated in the recent review.
Walkthrough
Suggested-user candidates now need at least five visible, top-level commits from the past 30 days. A new factory state creates five related commits, and unit and feature test fixtures use that state.
Changes: Active Committer Suggestions
app/Queries/SuggestedUsersQuery.php,database/factories/UserFactory.php,tests/Unit/Queries/SuggestedUsersQueryTest.phpactiveCommitter()state, and unit tests cover recent commits, older commits, and replies.tests/Feature/ContextualSuggestedUsersTest.php,tests/Feature/Controllers/Api/SuggestedUserControllerTest.php,tests/Feature/Controllers/LogControllerTest.php,tests/Feature/Controllers/OnboardingControllerTest.php,tests/Feature/LiveStreamDeadlinesTest.phpactiveCommitter()state for suggested-user fixtures. Their request flows and assertions remain unchanged.Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Suggested reviewers:
xheaven,mnapoliMerge Risk: Minimal · up to
d77baSuggested users are now limited to people with at least five recent top-level commits. No merge-blocking risk was found in the supplied changes, and the change is easy to revert.
Pre-merge checks: 4
Full details: Title check
Explanation
The title states the main change: suggestions are limited to users with five commits in the past 30 days. The raw summary confirms SuggestedUsersQuery now applies a 5-commit and 30-day threshold, and the tests and factory support this. The parenthetical average of 1.25 posts a week is a derived figure (5 commits over about 4 weeks) and is accurate but adds detail beyond the core change. The title is specific and clearly related to the changeset.
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.
Share
a518f4ba-2b23-4135-a929-aa310667ea6bReviewing files that changed from the base of the PR and between b6838917df9f07eaf06e74d712d246e7af3de237 and d77ba56e52cfa6f47add538b1589d7e80e1de46c.
app/Queries/SuggestedUsersQuery.phpdatabase/factories/UserFactory.phptests/Feature/ContextualSuggestedUsersTest.phptests/Feature/Controllers/Api/SuggestedUserControllerTest.phptests/Feature/Controllers/LogControllerTest.phptests/Feature/Controllers/OnboardingControllerTest.phptests/Feature/LiveStreamDeadlinesTest.phptests/Unit/Queries/SuggestedUsersQueryTest.phpIncluded review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.