feat: read DTL JSON slug indexes, keep pickle fallback#87
Conversation
Upstream devicetype-library dropped tests/known-*.pickle in favor of tests/known-*.json (GHSA-492p-5wp7-2w7c, PR #4238). The slug fast path looked only for the pickle files, so against current DTL master it always missed and fell back to a full file scan. Prefer known-*.json (same [slug, relpath] / [model, vendor_dir] shape), falling back to the legacy pickle for older pinned checkouts. Loaders are dispatched by extension; JSON carries no code-execution risk so it skips the restricted unpickler. Shape/size validation is shared across both. PRs #4239 and #4240 only harden the DTL test harness (package layout, URL allowlisting) and do not affect this consumer.
|
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 selected for processing (3)
WalkthroughThe PR adds JSON index support to slug resolution. Core infrastructure hardens index loading with size limits, data validation, and unified JSON/pickle dispatch. DTLRepo integrates these helpers for known-slugs, known-modules, and known-racks. Consumer code and tests follow. ChangesJSON Index Support for Slug Resolution
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Upstream devicetype-library dropped tests/known-.pickle in favor of tests/known-.json (GHSA-492p-5wp7-2w7c, PR #4238). The slug fast path looked only for the pickle files, so against current DTL master it always missed and fell back to a full file scan.
Prefer known-*.json (same [slug, relpath] / [model, vendor_dir] shape), falling back to the legacy pickle for older pinned checkouts. Loaders are dispatched by extension; JSON carries no code-execution risk so it skips the restricted unpickler. Shape/size validation is shared across both.
PRs #4239 and #4240 only harden the DTL test harness (package layout, URL allowlisting) and do not affect this consumer.
Summary by CodeRabbit
New Features
Bug Fixes