-
-
Notifications
You must be signed in to change notification settings - Fork 558
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
fix: status page and update #166
Conversation
Reviewer's Guide by SourceryThis pull request focuses on improving the robustness of the application by addressing configuration loading, adding support for environment variables, and fixing a bug in the status page. Additionally, it removes an unused variable and updates the base docker image. Sequence diagram for updated configuration loading processsequenceDiagram
participant App
participant Config
participant Env
App->>Config: Load configuration
alt Config file exists
Config->>Config: Load from config.py
else Config file missing
Config-->>App: Raise Exception
App->>Env: Fallback to environment variables
end
Note over App,Env: New fallback chain for UPSTREAM_REPO and UPSTREAM_BRANCH
App->>Config: Get UPSTREAM_REPO
Config-->>App: Return config value
alt Config value empty
App->>Env: Get UPSTREAM_REPO
Env-->>App: Return env value
alt Env value empty
App->>App: Use default value
end
end
Class diagram showing configuration changesclassDiagram
class ConfigManager {
+load()
+load_dict(config_dict)
}
class Config {
+UPSTREAM_REPO: str
+UPSTREAM_BRANCH: str
-DOWNLOAD_DIR: str
-LEECH_SPLIT_SIZE: int
-RSS_DELAY: int
-DEFAULT_UPLOAD: str
}
note for Config "Removed SEARCH_LIMIT and SEARCH_API_LINK"
ConfigManager --> Config: manages
State diagram for status page button generationstateDiagram-v2
[*] --> CheckStatus
CheckStatus --> EvaluateConditions: status != "All" OR tasks_no > 20
EvaluateConditions --> CreateButtons: Conditions met
CreateButtons --> InitializeButtonMaker: buttons not exists
InitializeButtonMaker --> AddStatusButtons
AddStatusButtons --> BuildMenu
BuildMenu --> [*]: Return button menu
EvaluateConditions --> [*]: Conditions not met
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 @5hojib - I've reviewed your changes - here's some feedback:
Overall Comments:
- The change from
ModuleNotFoundError
to catching allException
s is overly broad and could mask real issues. Consider keeping the specific exception handling. - Switching from
latest
tobeta
Docker image tag may introduce instability. Please provide justification for this change or consider staying with the stable release.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -256,6 +256,8 @@ async def get_readable_message(sid, is_user, page_no=1, status="All", page_step= | |||
if status != "All" or tasks_no > 20: | |||
for label, status_value in list(STATUSES.items()): | |||
if status_value != status: | |||
if not buttons: |
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.
issue (bug_risk): Initialize 'buttons' variable before the loop to prevent potential UnboundLocalError
The buttons variable should be initialized before the loop to ensure it exists when the condition is checked.
Summary by Sourcery
Update the Docker base image to
5hojib/aeon:beta
. Simplify the upstream repository configuration by prioritizing configuration file values over environment variables, and falling back to the defaulthttps://github.com/AeonOrg/Aeon-MLTB
repository andmain
branch if neither is set. Improve error handling in the update script by catching all exceptions when loading the configuration file. Remove the unusedSEARCH_LIMIT
setting and update the status page UI to dynamically generate buttons for filtering by status.Bug Fixes:
Enhancements: