Repository navigation
Go CLI: add admin stats commands - #17090
Conversation
Signed-off-by: Jin Hai <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds three authenticated admin token-statistics endpoints, corresponding CLI ChangesToken statistics administration
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant AdminRouter
participant Handler
participant Service
CLI->>AdminRouter: GET /admin/stats/token*
AdminRouter->>Handler: route token statistics request
Handler->>Service: invoke statistics method
Service-->>Handler: return payload or error
Handler-->>CLI: return success or error response
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/cli/admin_command.go`:
- Around line 1742-1765: Direct query-string concatenation in the admin stats
CLI commands must be replaced with URL encoding. In
internal/cli/admin_command.go lines 1742-1765, use url.Values or equivalent
encoding for user_name, from, to, and granularity; apply the same change to top,
from, and to at lines 1781-1798, and from and to at lines 1814-1825. Preserve
the existing command behavior while generating correctly encoded query
parameters.
🪄 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: 5db15ee8-87da-4c04-9f96-ba8e20e98b18
📒 Files selected for processing (9)
internal/admin/handler_ee.gointernal/admin/router.gointernal/admin/service_ee.gointernal/cli/admin_command.gointernal/cli/admin_parser.gointernal/cli/cli_http.gointernal/cli/lexer.gointernal/cli/parser.gointernal/cli/types.go
Signed-off-by: Jin Hai <[email protected]>
Summary