fix: consider object type in fingerprint all deduplication #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces updates to the
netbox_diode_pluginto enhance fingerprinting functionality and improve testing coverage. The most significant changes include modifying the_fingerprint_allfunction to handle object types, updating its usage in thefingerprintsfunction, and adding a new test case to ensure proper deduplication of changes across different object types.Enhancements to fingerprinting functionality:
_fingerprint_allinnetbox_diode_plugin/api/matcher.pyto accept an optionalobject_typeparameter, which is included in the fingerprint calculation. This ensures that fingerprints account for the object type, improving uniqueness. [1] [2]fingerprintsfunction to pass theobject_typeparameter when calling_fingerprint_all, ensuring consistent behavior across the fingerprinting process.Improvements to testing:
test_generate_diff_dedupe_different_object_types, innetbox_diode_plugin/tests/test_api_generate_diff.py. This test verifies that the system correctly deduplicates changes for different object types with the same values, ensuring accurate change tracking.defaultdictin the test file to support the new test case.