Repository navigation
Conversation
|
@claude /review Only report on issues of potential concern; we don't need commentary on anything that doesn't require further consideration. |
|
Claude finished @arthanson's task in 7m 59s —— View job Code review
One issue of real concern; the other four snapshot additions look correct. 🔴
|
|
Per Claude review:
|
jeremystretch
left a comment
There was a problem hiding this comment.
The root issue here is that ChangeLoggingMixin can record an update with no pre-change data when snapshot() was not called. Rather than attempting to audit and resolve every potential instance of this (as more will be inevitably be introduced), can we tweak handle_changed_object to generate a pre-change snapshot from the database whenever it sees an existing object being saved without a pre-change snapshot? (It might also be prudent to log a warning.)
|
Added the auto-snapshot with logging, added snapshot to several tests as they were generating the logging and the logging would get drowned out (ignored) if they weren't. |
Closes: #23617
Five code paths updated an existing object without calling
snapshot()first, so the update was recorded with no prechange data. In netbox-branching, merging these changes overwrote edits made in main, and reverting them failed.Cable.save(): snapshot after the initial insert, before the save that records the terminationsDevice.save(): snapshot each child device before copying the parent's site, location and rackupdate_connected_interfaces(): snapshot both interfaces before settingwireless_linkupdate_mac_address_interface(): snapshot the MAC address before assigning itSyncedDataMixin.sync(save=True): snapshot before syncingAdds a regression test for each. Once this merges, the four skip-list entries from #23616 can be removed. netbox-branching's
test_revert_cable_createwill then pass, so its@expectedFailuremarker needs to come out.