fix: warn-and-skip on duplicate repo keys instead of crashing#81
Conversation
The upstream DTL repo legitimately contains files with the same model name but different part numbers (e.g. HPE 38L7559.yaml and 834167-001.yaml both have model 'HPE Drive LTO-7 Ultrium 7-SCSI'). Previously the loaders raised ValueError which crashed export-diff. Change all three loaders (_load_repo_device_types, _load_repo_module_types, _load_repo_rack_types) to log a verbose warning and keep the first-seen entry, matching the import path's behaviour when encountering same-name records.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
WalkthroughThis PR modifies ChangesDuplicate Key Handling
🎯 2 (Simple) | ⏱️ ~8 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
The upstream DTL repo legitimately contains files with the same model name but different part numbers (e.g. HPE 38L7559.yaml and 834167-001.yaml both have model 'HPE Drive LTO-7 Ultrium 7-SCSI'). Previously the loaders raised ValueError which crashed export-diff.
Change all three loaders (_load_repo_device_types, _load_repo_module_types, _load_repo_rack_types) to log a verbose warning and keep the first-seen entry, matching the import path's behaviour when encountering same-name records.
Summary by CodeRabbit