feat(oss): rank content lists by spam score (last-N-days triage)#4856
Merged
Conversation
OSS comment/moment lists could only be ordered by id desc and the article list had no spam-score sort, so admins had no way to surface the most likely spam across articles/moments/comments. - ArticlesSort.mostSpam: order scored articles by spam_score desc. - OSSCommentsInput / OSSMomentsInput: add sort (OSSContentSpamSort) and a datetimeRange filter (for the 'last 7 days' window). - comments/moments resolvers: build sortable/filterable queries via connectionFromQuery; commentService.findComments() query builder added. - mostSpam excludes rows without a spam_score so unscored items don't pollute the ranking (and avoids NULLS-first ordering). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The oss.moments field input changed from ConnectionArgs to OSSMomentsInput; update the system test query variable accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #4856 +/- ##
===========================================
+ Coverage 72.57% 72.93% +0.36%
===========================================
Files 1067 1068 +1
Lines 21164 21541 +377
Branches 4619 4802 +183
===========================================
+ Hits 15360 15712 +352
- Misses 5327 5347 +20
- Partials 477 482 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Exercise the mostSpam ranking and datetimeRange filter paths in the OSS comment/moment list resolvers (and commentService.findComments) to raise patch coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
OSS 後台要能「一週內垃圾機率由高到低」檢視文章/動態/留言。但 comment/moment 清單原本只支援
id desc、article 清單沒有依 spam 分數排序。變更
ArticlesSort.mostSpam:依spam_score由高到低排序(只含已評分文章)。OSSCommentsInput/OSSMomentsInput:sort(OSSContentSpamSort:newest / mostSpam)+filter.datetimeRange(近 7 天窗)。connectionFromQuery可排序/篩選;新增commentService.findComments()查詢建構子。mostSpam以whereNotNull(spam_score)排除未評分項,避免 NULLS-first 排序污染排行。備註
feat/oss-spam-ranking。🤖 Generated with Claude Code