Repository navigation
feat: models for custom config validation - #186
Conversation
Reviewer's Guide by SourceryThis pull request introduces custom configuration validation using Pydantic models. A new file No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Assessment against linked issues
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 and found some issues that need to be addressed.
Blocking issues:
- Hardcoded boolean value for execution trace logs. (link)
Overall Comments:
- The Pydantic models in
config_models.pyappear to contain YAML snippets instead of valid field definitions and nested models. - Consider using snake_case (e.g.,
store_logs) for attribute names within theCustomConfigmodel for consistency with Python conventions.
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🔴 Security: 1 blocking issue
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 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.
0cd8875 to
0e2b663
Compare
uniqueg
left a comment
There was a problem hiding this comment.
Thanks a lot, @Nidhi091999 - as far as I can tell, the models look fine now. However, there are 3 issues remaining:
- The app configuration now needs to be updated to include a
customsection, which is required to activate the validation. The sections defining the values for custom config params, likecontrollers,serviceInfoand so on (see https://github.com/elixir-cloud-aai/proTES/blob/f83c3e3cd10eef83829c9f1359830a0d99f4299a/pro_tes/config.yaml#L109C1-L149C84 for all of them) need to children of sectioncustom. - Given that the new
customsection changes the paths under which these params can be found when used in the app, all code referencing any params in thecustomsection need to be updated accordingly, e.g., fromcurrent_app.config.foca.tes["service_list"]tocurrent_app.config.foca.custom.tes["service_list"] - The integration tests are currently failing. I am not sure why that is, but possibly it is because currently there is no custom section in
pro_tes/config.yaml; so possibly, if you fix point 1 above (which in turns requires addressing point 2), this problem might resolve itself. If not, please try to add some debug statements to see why the tests are failing with the new models.
uniqueg
left a comment
There was a problem hiding this comment.
This looks great - thanks a lot, @Nidhi091999 :)
However, as long as the tests are not fixed, I am a bit hesitant to approve/merge this.
Are you interested in looking at fixing the integration tests? 🙃
Co-authored-by: Alex Kanitz <[email protected]>
Resolves #164
Summary by Sourcery
Implement custom configuration validation using Pydantic models.
New Features:
Controllers,Tes,StoreLogs,Middlewares,ServiceInfo).