Conversation
Reviewer's GuideThis PR restructures the application’s configuration by introducing a new “custom” section in config.yaml backed by a Pydantic CustomConfig model, updates code to reference the nested custom settings (controllers, TES, logging, middlewares, serviceInfo), adjusts app initialization to use the new model, and adds a small documentation link. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @Nidhi091999 - I've reviewed your changes - here's some feedback:
- The Celery config block was left at the root instead of under custom.controllers.celery—move it under the new custom.controllers hierarchy to match your CustomConfig model.
- YAML uses 'serviceInfo' but the Pydantic model defines 'service_info'; either rename the key or add an alias in the model so they align.
- You're indexing Pydantic models like dicts (e.g. custom.storeLogs["execution_trace"]); switch to attribute access (custom.storeLogs.execution_trace) for type safety and clarity.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: 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.
| tes: Tes = Tes() | ||
| storeLogs: StoreLogs = StoreLogs() | ||
| middlewares: Middlewares = Middlewares() | ||
| service_info: TesServiceInfo |
There was a problem hiding this comment.
issue (bug_risk): YAML key 'serviceInfo' does not match Pydantic field 'service_info'
Add Field(..., alias='serviceInfo') to service_info or rename it to serviceInfo so the YAML key aligns and loads correctly.
| mw_handler = MiddlewareHandler() | ||
| mw_handler.set_middlewares( | ||
| paths=current_app.config.foca.middlewares # type: ignore | ||
| paths=current_app.config.foca.custom.middlewares # type: ignore |
There was a problem hiding this comment.
issue (bug_risk): Passing Pydantic model instead of raw list to middleware handler
Pass middlewares.__root__ or update the model to expose the list as a normal field, so set_middlewares receives an actual list.
checks
Summary by Sourcery
Introduce a custom configuration model and namespace existing settings under a dedicated 'custom' key, updating code references and documentation accordingly.
New Features:
custom_config_modelparameter in app initialization.Enhancements:
customsection in config.yaml.foca.config.custominstead of the root config fields.Documentation: