-
Notifications
You must be signed in to change notification settings - Fork 0
feat: [ add cache, kafka logging, compare and pagination ] #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive logging, caching, and pagination features to enhance the FACEIT CLI application. The implementation adds structured logging with optional Kafka integration, client-side pagination for match browsing, and API response caching for improved performance.
Key Changes
- Added centralized logging system with configurable levels and Kafka integration
- Implemented client-side pagination for match viewing with enhanced navigation
- Introduced API response caching with TTL-based expiration
- Added total K/D ratio calculation and comparison features
Reviewed Changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| main.go | Integration of logger initialization and application startup logging |
| internal/logger/ | Complete logging system with Kafka support and structured JSON output |
| internal/cache/ | In-memory caching system with TTL and repository wrapper |
| internal/ui/ | Pagination implementation and enhanced comparison features |
| internal/config/ | Extended configuration for caching, pagination, and logging settings |
| docker-compose.yml | Kafka infrastructure setup with KRaft mode |
| README.md | Updated documentation for new features and configuration options |
Comments suppressed due to low confidence (1)
internal/ui/helpers.go:1
- All cache key generation functions have identical comments starting with 'GenerateKey creates a cache key for...'. Each function should have a unique comment that specifically describes what type of cache key it generates.
package ui
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| adjustment := 0 | ||
| if strings.Contains(line, "🎯") || strings.Contains(line, "📊") { | ||
| adjustment = -1 | ||
| } |
Copilot
AI
Sep 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The emoji-based adjustment logic uses magic values and hard-coded emoji checks. Consider defining constants for the adjustment values and emoji patterns, or use a more robust method to calculate visual width that accounts for unicode characters properly.
| // Debug logging (can be removed in production) | ||
| // fmt.Printf("DEBUG: Requested limit: %d, Got matches: %d\n", limit, len(history.Items)) |
Copilot
AI
Sep 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out debug code should be removed instead of being left in the codebase. If debugging is needed, use the proper logging system that was implemented.
| // Debug logging (can be removed in production) | |
| // fmt.Printf("DEBUG: Requested limit: %d, Got matches: %d\n", limit, len(history.Items)) |
| if err != nil { | ||
| // Log the error and continue without stats. | ||
| // For CLI we'll just continue without detailed stats | ||
| // fmt.Printf("DEBUG: Failed to get stats for match %s: %v\n", item.MatchId, err) |
Copilot
AI
Sep 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out debug code should be removed instead of being left in the codebase. If debugging is needed, use the proper logging system that was implemented.
| // loadMatchesPage is no longer needed since we paginate client-side | ||
| // This function is kept for compatibility but does nothing | ||
| func (m AppModel) loadMatchesPage(page int) tea.Cmd { | ||
| return func() tea.Msg { | ||
| // Since we now load all matches at once, pagination is handled client-side | ||
| // This function is kept for compatibility but returns immediately | ||
| return nil | ||
| } | ||
| } | ||
|
|
Copilot
AI
Sep 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code that 'does nothing' should be removed entirely rather than being kept for compatibility. If this function is no longer needed, it should be deleted to reduce code clutter and maintenance burden.
| // loadMatchesPage is no longer needed since we paginate client-side | |
| // This function is kept for compatibility but does nothing | |
| func (m AppModel) loadMatchesPage(page int) tea.Cmd { | |
| return func() tea.Msg { | |
| // Since we now load all matches at once, pagination is handled client-side | |
| // This function is kept for compatibility but returns immediately | |
| return nil | |
| } | |
| } |
No description provided.