-
-
Notifications
You must be signed in to change notification settings - Fork 70
New developer option to use local scraper_config.json
without having to use the fallback methods indirectly
#532
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
base: main
Are you sure you want to change the base?
Conversation
…ing and testing locally.
WalkthroughA new configuration option, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Settings
participant RemoteConfigManager
User->>RemoteConfigManager: Request configuration
RemoteConfigManager->>Settings: Check use_config_source
alt use_config_source == "local"
RemoteConfigManager->>Settings: Get local_config_path
RemoteConfigManager->>RemoteConfigManager: Load config from local file
RemoteConfigManager-->>User: Return local config
else use_config_source == "remote"
RemoteConfigManager->>Settings: Get remote_config_source
RemoteConfigManager->>RemoteConfigManager: Fetch config from remote source
RemoteConfigManager-->>User: Return remote config
end
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
db/config.py (1)
121-121
: Consider using Literal type for better type safety.The
use_config_source
field appears to accept only specific values ("remote" and "local"). Using a Literal type would provide better type safety and IDE support.+from typing import Literal -use_config_source: str = "remote" +use_config_source: Literal["remote", "local"] = "remote"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
db/config.py
(1 hunks)docs/configuration.md
(2 hunks)utils/config.py
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/configuration.md
[grammar] ~169-~169: Use correct spacing
Context: ...hedulersetting. ## Local Development Settings - **use_config_source** (default:
remote`)...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~171-~171: Use correct spacing
Context: ...ote scraper configuration file or local source. ### How to Configure You can configure the...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
🔇 Additional comments (2)
utils/config.py (1)
47-48
: LGTM! Clean implementation of the local config option.The conditional check is well-placed and follows the early return pattern. It properly reuses the existing
_load_local_config
method and maintains the existing fallback behavior.docs/configuration.md (1)
169-172
: LGTM! Clear documentation for the new development setting.The new section is well-structured and provides clear information about the
use_config_source
option. The placement in a dedicated "Local Development Settings" section makes it easy for developers to find.
Add developer option to use the local configuration source when building and testing locally.
Summary by CodeRabbit
New Features
Documentation