[OSDEV-2292] Added stricter ISIC-4 taxonomy validation to v1 production locations endpoints#832
Conversation
React App | Jest test suite - Code coverage reportTotal: 39.1%Your code coverage diff: 0.00% ▴ ✅ All code changes are covered |
Dedupe Hub App | Unittest test suite - Code coverage reportTotal: 55.73%Your code coverage diff: 0.00% ▴ ✅ All code changes are covered |
Countries App | Unittest test suite - Code coverage reportTotal: 100%Your code coverage diff: 0.00% ▴ ✅ All code changes are covered |
…lows-empty-objects-invalid-fields-and-numeric-values
|
Django App | Unittest test suite - Code coverage reportTotal: 81.57%Your code coverage diff: 0.06% ▴ ✅ All code changes are covered |
📝 WalkthroughWalkthroughEnhanced ISIC-4 validation for production location endpoints with new constraints: rejecting empty objects, enforcing string types for all fields, preventing unrecognized fields, and detecting duplicates. Includes serializer updates, validators, and comprehensive test coverage. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
🧰 Additional context used🧠 Learnings (8)📓 Common learnings📚 Learning: 2024-11-13T07:21:28.686ZApplied to files:
📚 Learning: 2024-11-12T11:15:04.794ZApplied to files:
📚 Learning: 2024-11-26T04:59:12.296ZApplied to files:
📚 Learning: 2025-06-02T13:24:57.659ZApplied to files:
📚 Learning: 2025-09-09T09:02:07.291ZApplied to files:
📚 Learning: 2025-04-22T20:16:21.889ZApplied to files:
📚 Learning: 2024-12-12T14:59:19.694ZApplied to files:
🧬 Code graph analysis (2)src/django/api/tests/test_contribution_production_location_schema_serializer.py (2)
src/django/api/tests/test_isic4_entry_serializer.py (1)
🪛 Ruff (0.14.7)src/django/api/serializers/v1/production_location_schema_serializer.py107-110: Avoid specifying long messages outside the exception class (TRY003) src/django/api/serializers/v1/isic4_entry_serializer.py47-49: Avoid specifying long messages outside the exception class (TRY003) 83-87: Avoid specifying long messages outside the exception class (TRY003) 🔇 Additional comments (10)
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 |



OSDEV-2292
Enhanced ISIC-4 validation in
ISIC4EntrySerializerandProductionLocationSchemaSerializerforPOST /v1/production-locations/andPATCH /v1/production-locations/{os_id}requests to reject empty ISIC-4 objects (at least one field from section, division, group, or class must be provided), enforce strict type checking to ensure all ISIC-4 field values are strings, reject unrecognized fields that are not one of the four valid ISIC-4 field names, and reject duplicate ISIC-4 objects within the same array (duplicates are detected regardless of field order).