-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: OverFast API v3 #208
Conversation
Reviewer's Guide by SourceryThis pull request implements version 3 of the OverFast API, featuring a major architectural overhaul. The changes include a reorganization of the codebase into domain-driven modules, improvements to the caching system, and refinements to the API response handling. The update focuses on better code organization, improved performance, and enhanced maintainability. Sequence diagram for default API request handlingsequenceDiagram
autonumber
actor User
participant Nginx
participant Redis
participant App
participant Blizzard
User->>+Nginx: Make an API request
Nginx->>+Redis: Make an API Cache request
alt API Cache is available
Redis-->>Nginx: Return API Cache data
Nginx-->>User: Return API Cache data
else
Redis-->>-Nginx: Return no result
Nginx->>+App: Transmit the request to App server
App->>+Blizzard: Retrieve data
Blizzard-->>-App: Return data
App->>App: Parse HTML page
App->>Redis: Store data into API Cache
App-->>-Nginx: Return API data
Nginx-->>-User: Return API data
end
Sequence diagram for player profile request handlingsequenceDiagram
autonumber
actor User
participant Nginx
participant Redis
participant App
participant Blizzard
User->>+Nginx: Make an API request
Nginx->>+Redis: Make an API Cache request
alt API Cache is available
Redis-->>Nginx: Return API Cache data
Nginx-->>User: Return API Cache data
else
Redis-->>-Nginx: Return no result
Nginx->>+App: Transmit the request to App server
App->>+Blizzard: Make a Player Search request
Blizzard-->>-App: Return Player Search data
App->>+Redis: Make Player Cache request
alt Player Cache is available and up-to-date
Redis-->>App: Return Player Cache
App->>App: Parse HTML page
else
Redis-->>-App: Return no result
App->>+Blizzard: Retrieve Player data (HTML)
Blizzard-->>-App: Return Player data
App->>App: Parse HTML page
App->>Redis: Store data into Player Cache
end
App->>Redis: Store data into API Cache
App-->>-Nginx: Return API data
Nginx-->>-User: Return API data
end
Updated class diagram for CacheManagerclassDiagram
class CacheManager {
+redis_server
+log_warning(err: RedisError) void
+get_cache_key_from_request(request: Request) str
+__compress_json_value(value: dict|list) str
+__decompress_json_value(value: str) dict|list
+redis_connection_handler(func: Callable)
+get_api_cache(cache_key: str) str|None
+get_player_cache(player_id: str) dict|list|None
+update_api_cache(cache_key: str, value: dict|list, expire: int) void
+update_player_cache(player_id: str, value: dict) void
+get_search_data_cache(data_type: SearchDataType, cache_key: str) str|None
+update_search_data_cache(data_type: SearchDataType, cache_key: str, value: str) void
+is_being_rate_limited() bool
}
Updated class diagram for PlayerCareerParserclassDiagram
class PlayerCareerParser {
+root_path
+valid_http_codes
+filter_request_using_query(kwargs: dict) dict
+__get_summary() dict
+__get_namecard_url() str|None
+__get_last_updated_at_value() int|None
+__get_title(profile_div: Tag) str|None
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @TeKrop - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider splitting such large refactoring PRs into smaller, focused changes in the future to make review easier - while this one is well structured, smaller PRs reduce risk and cognitive load
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟡 Documentation: 1 issue found
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Quality Gate passedIssues Measures |
Summary by Sourcery
Implement OverFast API v3 with a new Player Cache system to optimize data retrieval and reduce external calls. Refactor existing parsers and cache management to improve performance and maintainability. Update documentation and tests to align with the new architecture.
New Features:
Enhancements:
Documentation:
Tests: