Skip to content

feat: support for diffing presence containers - #990

Open
JonasKs wants to merge 5 commits into
openconfig:masterfrom
JonasKs:support-presence-containers
Open

feat: support for diffing presence containers#990
JonasKs wants to merge 5 commits into
openconfig:masterfrom
JonasKs:support-presence-containers

Conversation

@JonasKs

@JonasKs JonasKs commented Oct 2, 2024

Copy link
Copy Markdown

Closes #936.

The implementation ended up being somewhat as described in #936, where we indicate that presence container has a nil value in the findSetLeaves function.
In addition to this, we added a presence container interface, which is used in the marshalStructOrOrderedList to isolate the presence container which might have values, to act like an empty struct.

The result is that we do not break any current tests (even without the diff option), but we decided to add a diff option, with the reasoning described in #936:

Adding this as a non-optional, paired with ygot.BuildEmptyTree would also probably be breaking, as it would set all these presence containers?

We've confirmed this works in our setup. We're able to successfully configure all presence containers, even nested ones.

Co-authored-by: Terje Lafton terje@lafton.io

@google-cla

google-cla Bot commented Oct 2, 2024

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@JonasKs
JonasKs force-pushed the support-presence-containers branch from 4970f67 to 519ff68 Compare October 2, 2024 12:21
@JonasKs

JonasKs commented Oct 2, 2024

Copy link
Copy Markdown
Author

Hello @wenovus and @robshakir - it took some time, but we finally managed to crack the code. Please review. 😊

@JonasKs
JonasKs force-pushed the support-presence-containers branch from 519ff68 to 58943fa Compare October 2, 2024 13:22
@coveralls

coveralls commented Oct 2, 2024

Copy link
Copy Markdown

Coverage Status

coverage: 88.766% (-0.04%) from 88.807%
when pulling bcaa4dc on JonasKs:support-presence-containers
into 100bd44 on openconfig:master.

@JonasKs
JonasKs force-pushed the support-presence-containers branch from 58943fa to 8c252eb Compare October 2, 2024 13:42
@JonasKs

JonasKs commented Oct 2, 2024

Copy link
Copy Markdown
Author

Also tagging #645 author, @hansthienpondt.

@JonasKs

JonasKs commented Oct 24, 2024

Copy link
Copy Markdown
Author

Hi @robshakir , friendly bump in case you missed this 😊

@robshakir

Copy link
Copy Markdown
Member

I did miss it -- apologies, let me review ASAP.

@JonasKs

JonasKs commented Nov 15, 2024

Copy link
Copy Markdown
Author

I did miss it -- apologies, let me review ASAP.

No worries, @robshakir! We’ve been using the fork in production and it’s worked like a charm.

Comment thread ygot/diff.go
@JonasKs

JonasKs commented Mar 30, 2025

Copy link
Copy Markdown
Author

@robshakir, would love to get this looked at. 😊

@robshakir

Copy link
Copy Markdown
Member

@JonasKs holy-moly! apologies! this one passed me by. reviewing now. 🔎

Comment thread ygen/directory.go
Comment thread ygen/directory.go Outdated
Comment thread ygot/diff.go
Comment thread ygot/diff.go Outdated
@JonasKs

JonasKs commented Apr 16, 2025

Copy link
Copy Markdown
Author

Thanks so much, @robshakir! I’m out of office for ~2 weeks, but I’ll address all comments when I’m back!

JonasKs and others added 4 commits September 3, 2026 08:39
Co-authored-by: Terje Lafton <terje@lafton.io>
Co-authored-by: Terje Lafton <terje@lafton.io>
Co-authored-by: Terje Lafton <terje@lafton.io>
@JonasKs
JonasKs force-pushed the support-presence-containers branch from 32d9ebd to ea3585f Compare September 3, 2026 06:39
@JonasKs

JonasKs commented Sep 3, 2026

Copy link
Copy Markdown
Author

Hey @robshakir, sorry for never following up here. I no longer work at Intility, but I got a call from a good old colleague @luancvt, who still needs this merged upstream. I've addressed the comments here, and would appreciate if you could do another review?

I've given @luancvt write access to my fork, so he can follow up any feedback you might have.

Seems like pipelines fail in master nightly checks too, so I'll leave those.

@JonasKs
JonasKs requested a review from robshakir September 3, 2026 07:00
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.

ygot.Diff don't respect presence containers

3 participants