Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ending iteration of subtrees by new ForEachDataField2 #862

Merged
merged 8 commits into from
Jun 12, 2023

Conversation

wenovus
Copy link
Collaborator

@wenovus wenovus commented Jun 7, 2023

Added ForEachDataField2 and FieldIteratorFunc2 to support returning new enum type indicating iteration behaviour.

@wenovus wenovus requested review from robshakir and bormanp June 7, 2023 02:21
@wenovus wenovus changed the title Add support for ending iteration of subtrees in ForEachDataField Add support for ending iteration of subtrees by new ForEachDataField2 Jun 7, 2023
@coveralls
Copy link

coveralls commented Jun 7, 2023

Coverage Status

coverage: 89.65% (-0.1%) from 89.749% when pulling f42613c on orderedmap-diff into 6fe7ca0 on master.

@wenovus wenovus requested a review from DanG100 June 7, 2023 19:04
util/reflect.go Outdated Show resolved Hide resolved
util/reflect.go Outdated Show resolved Hide resolved
wenovus and others added 3 commits June 12, 2023 12:14
* Add `DiffWithAtomic` to support creating Atomic Notifications.

When comparing two GoStructs where a YANG `ordered-by user` list is
involved, it is not possible using a single Notification to represent
the diff such that the Notification can do the following:
1. update a gNMI cache correctly with the atomic notification.
2. unmarshal the notification to the `orig` to get back the `modified`
   GoStruct.

This function achieves this functionality, sharing the underlying
implementation with Diff, where a disclaimer has been added to the doc
comment.

Other helpers have been created as well to be shared with
`TogNMINotifications`.

Other changes:
- `TogNMINotifications` has been changed to follow the same convention of
  putting the non-atomic Notification as the first message instead of
  the last. The reason is that current code MAY be using `notifs[0]` and
  I don't want to break that, and this also seems slightly better from a
  usability perspective.

* Fix bug when IgnoreAdditions option is turned on
@wenovus wenovus merged commit 5d88f83 into master Jun 12, 2023
@wenovus wenovus deleted the orderedmap-diff branch June 12, 2023 20:52
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.

3 participants