Dear all,

In light of draft-claise-semver-01 <https://datatracker.ietf.org/doc/draft-claise-semver/>, and thinking about adding an extra metadata piece of information to a YANG module (for example here <https://www.yangcatalog.org/yang-search/module_details.php?module=ietf-acl>), I'm wondering if any of you investigated how to map semver tags into backwards (in)compatible YANG module revisions?

   The fields in such a structured version have the following semantics
   (cf.  semver.org):

   o  MAJOR is incremented when the new version of the specification is
      incompatible with previous versions.

   o  MINOR is incremented when new functionality is added in a manner
      that is backward-compatible with previous versions.

   o  PATCH is incremented when bug fixes are made in a backward-
      compatible manner.


I played with "pyang --check-update-from". As an example, ietf-interfaces

   $ pyang ietf-interfa...@2017-08-14.yang
   ietf-interfa...@2017-08-14.yang:1: warning: unexpected latest
   revision "2017-08-17" in ietf-interfa...@2017-08-14.yang, should be
   2017-08-14


Let's not pay attention to this warning above.
If I compare with the RFC version, I get the same output. cx

   $ pyang --path=/home/bclaise/yang/modules
   
--check-update-from=/home/bclaise/ietf/YANG-rfc/ietf-interfa...@2014-05-08.yang
   ietf-interfa...@2017-08-14.yang
   ietf-interfa...@2017-08-14.yang:1: warning: unexpected latest
   revision "2017-08-17" in ietf-interfa...@2017-08-14.yang, should be
   2017-08-14
   So the tag should be MINOR or PATCH. Not sure if there is a way to
   automate MINOR versus PATCH?


Now, if I manually modify a leaf in ietf-interfa...@2014-05-08.yang, then I get:

   $ pyang --path=/home/bclaise/yang/modules
   
--check-update-from=/home/bclaise/ietf/YANG-rfc/ietf-interfa...@2014-05-08.yang
   ietf-interfa...@2017-08-14.yang
   ietf-interfa...@2017-08-14.yang:1: warning: unexpected latest
   revision "2017-08-17" in ietf-interfa...@2017-08-14.yang, should be
   2017-08-14
   ietf-interfa...@2017-08-14.yang:224: error: the base type has
   illegally changed from string to boolean

So I should increment the MAJOR tag.

Is my logic right? Is "pyang --check-update-from" reliable for my use case?

And yeah, I know YANG modules are always supposed to be backwards compatible...

Regards, Benoit
_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to