-
Notifications
You must be signed in to change notification settings - Fork 536
fix: enabled removal of definitional field on product knowledge update #3348
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: develop
Are you sure you want to change the base?
Conversation
…dkishorr/fix/product_knowledge_spec
📝 WalkthroughWalkthroughRemoved the default value from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3348 +/- ##
===========================================
- Coverage 73.82% 73.81% -0.01%
===========================================
Files 435 435
Lines 19814 19816 +2
Branches 2153 2154 +1
===========================================
+ Hits 14627 14628 +1
Misses 4738 4738
- Partials 449 450 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| name: str | ||
| names: list[ProductName] | None = None | ||
| storage_guidelines: list[StorageGuideline] | None = None | ||
| definitional: ProductDefinitionSpec | None = None |
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.
Just remove the = None here and you should be good to go.
3191456 to
04718e1
Compare
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)
care/emr/tests/test_product_knowledge_api.py (1)
81-94: Update payload now exercisesdefinitional=None; consider a dedicated behavior assertionIncluding
"definitional": Noneincreate_update_product_knowledge_datamatches the intended “clear the field on update” behavior, so this change is fine as-is. It might be worth adding a focused test that:
- creates a product with a non-null
definitional, then- PATCHes with
"definitional": Noneand asserts the field is actually cleared in the response/DB.Not mandatory for this PR, but it would prove the behavior you’re trying to fix rather than relying on it indirectly.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
care/emr/tests/test_product_knowledge_api.py(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (.cursorrules)
**/*.py: Prioritize readability and maintainability; follow Django's coding style guide (PEP 8 compliance).
Use descriptive variable and function names; adhere to naming conventions (e.g., lowercase with underscores for functions and variables).
Files:
care/emr/tests/test_product_knowledge_api.py
**/tests/**/*.py
📄 CodeRabbit inference engine (.cursorrules)
Use Django’s built-in tools for testing (unittest and pytest-django) to ensure code quality and reliability.
Files:
care/emr/tests/test_product_knowledge_api.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test / Test
🔇 Additional comments (1)
care/emr/tests/test_product_knowledge_api.py (1)
28-51: Explicitly includingdefinitionalin create payload looks correctAdding
"definitional": Nonetogenerate_product_knowledge_datakeeps the test payload shape in sync with the spec change and ensures the API path is at least exercised with an explicit null rather than relying on implicit defaults. Nothing blocking here.
Proposed Changes
updated product knowledge updated spec
updated when definitional is None
Merge Checklist
/docsOnly PR's with test cases included and passing lint and test pipelines will be reviewed
@ohcnetwork/care-backend-maintainers @ohcnetwork/care-backend-admins
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.