Skip to content

Conversation

@jeremystretch
Copy link
Contributor

Fixes: #150

NOTE: This must be tested against the 20241-cable-change-records branch of NetBox, as it depends on changes made therein.

  • Call a model's custom serialize_object() and deserialize_object() methods if defined
  • Extend update_object() to support assigning non-field attributes

Copy link
Contributor

@jnovinger jnovinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this as is, as it fixes the issue. However, I did point out what I thought was a potential edge-case worth handling.

@jnovinger
Copy link
Contributor

jnovinger commented Sep 9, 2025

Ah, one thing I just noticed, in testing the reproduction steps from this comment, the diff/change counts don't match in different parts of the branch detail view.
image

@jnovinger
Copy link
Contributor

jnovinger commented Sep 9, 2025

Ah, one thing I just noticed, in testing the reproduction steps from this comment, the diff/change count don't match in different parts of the branch detail view.

Testing other scenarios, including the STR from the original ticket, did not produce the same behavior. For instance, in the case of changing the termination on one end of the existing cable (created in main) in the test branch showed 5 changes/diffs in all spots.

@jeremystretch
Copy link
Contributor Author

The reason we're only seeing five changes after merging the branch is that the ObjectChange record resulting from the sixth and final change application shows the same pre- and post-change values for the A & B terminations; no ObjectChange record is recorded in main (unless CHANGELOG_SKIP_EMPTY_CHANGES is set to True).

I'm not sure there's a reasonable way to work around this, because in this case we can't compare to the instance's original state as we normally would under Cable's save() method.

@jeremystretch jeremystretch changed the base branch from feature to main September 10, 2025 16:48
@jeremystretch jeremystretch merged commit fb4d98a into main Sep 10, 2025
3 checks passed
@jeremystretch jeremystretch deleted the 150-cable-paths branch September 10, 2025 16:57
@jeremystretch jeremystretch modified the milestone: v0.7.1 Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cable paths are not updated when merging a branch with cable changes

3 participants