Skip to content

Purge remnants of extensions v0 from Product#3548

Open
gigincg wants to merge 1 commit intodevelopfrom
cleanup_product_extensions
Open

Purge remnants of extensions v0 from Product#3548
gigincg wants to merge 1 commit intodevelopfrom
cleanup_product_extensions

Conversation

@gigincg
Copy link
Member

@gigincg gigincg commented Feb 26, 2026

Proposed Changes

  • Removed the validate_extensions class method and its @field_validator decorator from BaseProductSpec, which previously validated the extensions field using a JSON schema.

Merge Checklist

  • Tests added/fixed
  • Update docs in /docs
  • Linting Complete
  • Any other necessary step

Only 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
    • Simplified product metadata handling by removing overly restrictive validation rules, enabling better data input flexibility across product inventory management.

@gigincg gigincg requested a review from a team as a code owner February 26, 2026 09:13
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b45422f and 5120547.

📒 Files selected for processing (1)
  • care/emr/resources/inventory/product/spec.py
💤 Files with no reviewable changes (1)
  • care/emr/resources/inventory/product/spec.py

📝 Walkthrough

Walkthrough

The validate_extensions field validator was removed from the BaseProductSpec class in the product specification module. This validator previously enforced schema validation for the extensions field during assignment; the removal eliminates this runtime validation step.

Changes

Cohort / File(s) Summary
Extensions field validator removal
care/emr/resources/inventory/product/spec.py
Removed the validate_extensions field validator decorated with @field_validator("extensions") from BaseProductSpec. This validator previously validated extensions against settings.PRODUCT_EXTENSIONS_JSON_SCHEMA and raised ValueError on validation failure. Extensions field now accepts values without runtime validation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing the validate_extensions method, which was part of the 'extensions v0' implementation being purged from the Product specification.
Description check ✅ Passed The description includes the proposed changes section with specifics about what was removed, but is missing the 'Associated Issue' section and does not mention whether this is cleanup work or addresses a specific issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cleanup_product_extensions

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.24%. Comparing base (b45422f) to head (5120547).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3548      +/-   ##
===========================================
+ Coverage    76.23%   76.24%   +0.01%     
===========================================
  Files          473      473              
  Lines        22117    22109       -8     
  Branches      2309     2309              
===========================================
- Hits         16860    16857       -3     
+ Misses        4740     4735       -5     
  Partials       517      517              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@vigneshhari vigneshhari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would have been overridden and worked correctly, but yeah we can clean it up.

@vigneshhari
Copy link
Member

vigneshhari commented Feb 26, 2026

Linting Changes Required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants