Repository navigation
Go: refactor system stats - #17089
Conversation
Signed-off-by: Jin Hai <[email protected]>
📝 WalkthroughWalkthroughThe stats endpoint now uses dedicated ChangesStats service separation
Enterprise router hook
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/service/stats.go`:
- Around line 31-41: Remove the unused systemSettingsDAO field from StatsService
and stop initializing it in NewStatsService; leave the service constructor
returning an otherwise empty StatsService while preserving existing stats
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 557e6a25-ea36-4645-944c-732c2ba94ba9
📒 Files selected for processing (4)
cmd/ragflow_server.gointernal/handler/stats.gointernal/router/router.gointernal/service/stats.go
Signed-off-by: Jin Hai <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/admin/router_ee.go (1)
26-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winVerify the empty EE hook before merging.
RegisterEERouteris called, but its empty implementation registers no routes or side effects. If this stub is required for a separate enterprise implementation, verify that build/overlay contract; otherwise remove this compatibility-only exported API and its caller. As per coding guidelines, prefer deletion over compatibility shims and reduce public surface area unless an external contract requires compatibility.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/admin/router_ee.go` around lines 26 - 27, Verify whether RegisterEERouter is required by an enterprise build or overlay contract; if not, remove the empty exported RegisterEERouter function and its caller, reducing the public API instead of retaining a compatibility stub. If the contract requires it, preserve the hook and document or enforce the build integration that supplies its implementation.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@internal/admin/router_ee.go`:
- Around line 26-27: Verify whether RegisterEERouter is required by an
enterprise build or overlay contract; if not, remove the empty exported
RegisterEERouter function and its caller, reducing the public API instead of
retaining a compatibility stub. If the contract requires it, preserve the hook
and document or enforce the build integration that supplies its implementation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c8305bd1-bc88-44ab-8f1d-7a231197c168
📒 Files selected for processing (3)
internal/admin/router.gointernal/admin/router_ee.gointernal/service/stats.go
Summary
Move stats to a specific service from system