freeconf / yang

Standards-based management for Golang microservices
Apache License 2.0
38 stars 14 forks source link

call OnEndEdit always(!) if OnBeginEdit called successfully #104

Closed sibuk-harabudjasim closed 5 months ago

sibuk-harabudjasim commented 9 months ago

Rearranged branches a little. Original description:

This one is tricky. I need to hold mutex during changes and it is not possible if OnEndEdit is not called in case of some error. This PR ensures that OnEndEdit is being called each time OnBeginEdit is called and succeeds.

First, please do a detailed review of test, I'm not sure that this is the best way to test this functionality (test fails on unchanged edit.go but generously, it looks ugly). Second, please advice if there's another way of propagating changes back and forth from yang expected to be used instead of passing pointer to state?

dhubler commented 9 months ago

looks great. I feel like EndEdit should be somehow know there was an error. We can add field to NodeRequest

re: best way to test Test assertion is good. You don't really need the "c" container, but doesn't hurt

re: back and forth from yang expected to be used instead of passing pointer to state? not sure what you mean by this

sibuk-harabudjasim commented 5 months ago

Sorry for delays :) Rebased branch to newest master, added verification in test.