DISCLAIMER: Sorry, this is a long email.  But most of the text are examples of 
the new pyang output.

I stated at the mic at IETF 125 that I would share my work in progress on the 
pyang changes to support YANG module versioning including YANG Semver.  You can 
get my code at https://github.com/xorrkaz/pyang.  It’s based off of pyang HEAD, 
which is at 2.7.1.

The following checks have been implemented:


  *
Validate the syntax of YANG Semvers
  *
Ensure IETF modules have a YANG Semver in the latest revision
  *
Flag “obsolete" as an NBC change
  *
Check that modules with NBC changes have the NBC extension added
  *
Propose a next YANG Semver based on the changes between two modules
  *
Flag that changes to patterns, when, must, and description may be NBC if they 
change the semantics of a node

As Rob has been revising the IANA considerations draft, he’s given me some good 
feedback to make the recommended next YANG Semver a bit better.  Here are some 
examples.

Example 1: The ietf-ipfix-psamp had technical errata applied (there you go, 
Kent.  It does happen).  This changed pattern quoting from double to single to 
properly protect \S.  This didn’t change the content of the pattern, so this is 
what you get from the new pyang:

$ pyang --lax-quote-checks --check-update-semver --check-update-from 
[email protected] [email protected]

ASSUMED-OLD-YANG-SEMVER: 1.0.0 (old revision missing ysv:version)
SUGGESTED-NEXT-YANG-SEMVER: 1.0.1

Example 2: ietf-interfaces had several changes to support NMDA, including some 
description changes, some new leafs, etc.  There were no semantic or NBC 
changes (as state nodes moved to deprecated not obsolete).  Here is the pyang 
output:

$ pyang --lax-quote-checks --check-update-semver --check-update-from 
[email protected] [email protected]

ASSUMED-OLD-YANG-SEMVER: 1.0.0 (old revision missing ysv:version)
SUGGESTED-NEXT-YANG-SEMVER: 1.1.0
POSSIBLE-NBC-CHANGE(S):
Consult document authors and YANG Doctors.
[email protected]:61: warning: the description change may have 
changed the semantics of the node
[email protected]:104: warning: the description change may have 
changed the semantics of the node
[email protected]:124: warning: the description change may have 
changed the semantics of the node
[email protected]:160: warning: the description change may have 
changed the semantics of the node
[email protected]:179: warning: the description change may have 
changed the semantics of the node
[email protected]:220: warning: the description change may have 
changed the semantics of the node
[email protected]:232: warning: the description change may have 
changed the semantics of the node
[email protected]:238: warning: the description change may have 
changed the semantics of the node
[email protected]:685: warning: the description change may have 
changed the semantics of the node
[email protected]:829: warning: the description change may have 
changed the semantics of the node
[email protected]:865: warning: the description change may have 
changed the semantics of the node
[email protected]:899: warning: the description change may have 
changed the semantics of the node
[email protected]:914: warning: the description change may have 
changed the semantics of the node
[email protected]:930: warning: the description change may have 
changed the semantics of the node
[email protected]:948: warning: the description change may have 
changed the semantics of the node
[email protected]:968: warning: the description change may have 
changed the semantics of the node
[email protected]:988: warning: the description change may have 
changed the semantics of the node
[email protected]:1009: warning: the description change may have 
changed the semantics of the node
[email protected]:1024: warning: the description change may have 
changed the semantics of the node
[email protected]:1041: warning: the description change may have 
changed the semantics of the node
[email protected]:1059: warning: the description change may have 
changed the semantics of the node
[email protected]:1079: warning: the description change may have 
changed the semantics of the node
[email protected]:1098: warning: the description change may have 
changed the semantics of the node
[email protected]:1116: warning: the description change may have 
changed the semantics of the node

Example 3: The L3SM module had several NBC changes to it based on operator 
feedback, which essentially stated the initial revision was un-implementable.  
It also had several editorial changes to improve YANG formatting.  Here is what 
pyang says:

$ pyang --lax-quote-checks --check-update-semver --check-update-from 
[email protected] [email protected]

ASSUMED-OLD-YANG-SEMVER: 1.0.0 (old revision missing ysv:version)
SUGGESTED-NEXT-YANG-SEMVER: 2.0.0
NBC-CHANGE(S):
[email protected]:41: error: rev:non-backwards-compatible is 
required for this revision
[email protected]:593: error: the container 'authorized-sites', 
defined at [email protected]:561 is illegally removed or marked 
obsolete
[email protected]:593: error: the container 'denied-sites', 
defined at [email protected]:578 is illegally removed or marked 
obsolete
[email protected]:2667 (at [email protected]:593): 
error: the container 'authorized-sites', defined at 
[email protected]:2255 (at [email protected]:561) is 
illegally removed or marked obsolete
[email protected]:2667 (at [email protected]:593): 
error: the container 'denied-sites', defined at 
[email protected]:2255 (at [email protected]:578) is 
illegally removed or marked obsolete
[email protected]:2756 (at [email protected]:593): 
error: the container 'authorized-sites', defined at 
[email protected]:2350 (at [email protected]:561) is 
illegally removed or marked obsolete
[email protected]:2756 (at [email protected]:593): 
error: the container 'denied-sites', defined at 
[email protected]:2350 (at [email protected]:578) is 
illegally removed or marked obsolete
[email protected]:596: error: the base type has illegally changed 
from string to leafref
[email protected]:672: error: the mandatory 'true' is illegally 
added
[email protected]:764: error: the mandatory 'true' is illegally 
added
[email protected]:1066: error: a new must expression cannot be 
added
[email protected]:1076: error: the if-feature 'target-sites' is 
illegally added in leaf-list target-sites
[email protected]:1108: error: a new must expression cannot be 
added
[email protected]:1161: error: the base type has illegally changed 
from uint32 to uint64
[email protected]:1163: error: the mandatory 'true' is illegally 
added
[email protected]:1170: error: the base type has illegally changed 
from uint32 to uint64
[email protected]:1172: error: the mandatory 'true' is illegally 
added
[email protected]:1181: error: the mandatory 'true' is illegally 
added
[email protected]:1246: error: the base type has illegally changed 
from uint16 to string
[email protected]:1289: error: the base type has illegally changed 
from string to leafref
[email protected]:1321: error: the base type has illegally changed 
from uint8 to decimal64
[email protected]:1385: error: the base type has illegally changed 
from uint8 to decimal64
[email protected]:1390: error: the mandatory 'true' is illegally 
added
[email protected]:1439: error: a new when expression cannot be 
added
[email protected]:1462: error: the base type has illegally changed 
from string to leafref
[email protected]:1476: error: the case 'pki', defined at 
[email protected]:1391 is illegally removed or marked obsolete
[email protected]:2455 (at [email protected]:1476): 
error: the case 'pki', defined at [email protected]:2104 (at 
[email protected]:1391) is illegally removed or marked obsolete
[email protected]:2683 (at [email protected]:1476): 
error: the case 'pki', defined at [email protected]:2273 (at 
[email protected]:1391) is illegally removed or marked obsolete
[email protected]:2738 (at [email protected]:1476): 
error: the case 'pki', defined at [email protected]:2333 (at 
[email protected]:1391) is illegally removed or marked obsolete
[email protected]:2771 (at [email protected]:1476): 
error: the case 'pki', defined at [email protected]:2369 (at 
[email protected]:1391) is illegally removed or marked obsolete
[email protected]:2781 (at [email protected]:1476): 
error: the case 'pki', defined at [email protected]:2381 (at 
[email protected]:1391) is illegally removed or marked obsolete
[email protected]:1562: error: the min-elements '1' is illegally 
added
[email protected]:1571: error: the mandatory 'true' is illegally 
added
[email protected]:1619: error: the mandatory 'true' is illegally 
added
[email protected]:1626: error: the min-elements '1' is illegally 
added
[email protected]:1704: error: the min-elements '1' is illegally 
added
[email protected]:1722: error: the min-elements '1' is illegally 
added
[email protected]:1743: error: the leaf 
'number-of-dynamic-address', defined at [email protected]:1655 is 
illegally removed or marked obsolete
[email protected]:2737 (at [email protected]:1743): 
error: the leaf 'number-of-dynamic-address', defined at 
[email protected]:2332 (at [email protected]:1655) is 
illegally removed or marked obsolete
[email protected]:2781 (at [email protected]:1743): 
error: the leaf 'number-of-dynamic-address', defined at 
[email protected]:2381 (at [email protected]:1655) is 
illegally removed or marked obsolete
[email protected]:1745: error: the default 'static-address', 
defined at [email protected]:1650 is illegally removed or marked 
obsolete
[email protected]:2737 (at [email protected]:1745): 
error: the default 'static-address', defined at 
[email protected]:2332 (at [email protected]:1650) is 
illegally removed or marked obsolete
[email protected]:2781 (at [email protected]:1745): 
error: the default 'static-address', defined at 
[email protected]:2381 (at [email protected]:1650) is 
illegally removed or marked obsolete
[email protected]:1751: error: a new must expression cannot be 
added
[email protected]:1888: error: the leaf 'mask', defined at 
[email protected]:1698 is illegally removed or marked obsolete
[email protected]:2737 (at [email protected]:1888): 
error: the leaf 'mask', defined at [email protected]:2332 (at 
[email protected]:1698) is illegally removed or marked obsolete
[email protected]:2781 (at [email protected]:1888): 
error: the leaf 'mask', defined at [email protected]:2381 (at 
[email protected]:1698) is illegally removed or marked obsolete
[email protected]:1921: error: the leaf 
'number-of-dynamic-address', defined at [email protected]:1723 is 
illegally removed or marked obsolete
[email protected]:2737 (at [email protected]:1921): 
error: the leaf 'number-of-dynamic-address', defined at 
[email protected]:2332 (at [email protected]:1723) is 
illegally removed or marked obsolete
[email protected]:2781 (at [email protected]:1921): 
error: the leaf 'number-of-dynamic-address', defined at 
[email protected]:2381 (at [email protected]:1723) is 
illegally removed or marked obsolete
[email protected]:1923: error: the default 'static-address', 
defined at [email protected]:1719 is illegally removed or marked 
obsolete
[email protected]:2737 (at [email protected]:1923): 
error: the default 'static-address', defined at 
[email protected]:2332 (at [email protected]:1719) is 
illegally removed or marked obsolete
[email protected]:2781 (at [email protected]:1923): 
error: the default 'static-address', defined at 
[email protected]:2381 (at [email protected]:1719) is 
illegally removed or marked obsolete
[email protected]:2071: error: the leaf 'mask', defined at 
[email protected]:1769 is illegally removed or marked obsolete
[email protected]:2737 (at [email protected]:2071): 
error: the leaf 'mask', defined at [email protected]:2332 (at 
[email protected]:1769) is illegally removed or marked obsolete
[email protected]:2781 (at [email protected]:2071): 
error: the leaf 'mask', defined at [email protected]:2381 (at 
[email protected]:1769) is illegally removed or marked obsolete
[email protected]:2129: error: the base type has illegally changed 
from string to leafref
[email protected]:2186: error: the default 'false' is illegally 
changed from 'true'
[email protected]:2237: error: the mandatory 'true' is illegally 
added
[email protected]:2251: error: a new when expression cannot be 
added
[email protected]:2268: error: the mandatory 'true' is illegally 
added
[email protected]:2274: error: a new when expression cannot be 
added
[email protected]:2284: error: a new when expression cannot be 
added
[email protected]:2291: error: the mandatory 'true' is illegally 
added
[email protected]:2333: error: the container 'filter', defined at 
[email protected]:2006 is illegally removed or marked obsolete
[email protected]:2680 (at [email protected]:2333): 
error: the container 'filter', defined at [email protected]:2270 
(at [email protected]:2006) is illegally removed or marked obsolete
[email protected]:2771 (at [email protected]:2333): 
error: the container 'filter', defined at [email protected]:2369 
(at [email protected]:2006) is illegally removed or marked obsolete
[email protected]:2394: error: the container 'vpn' is illegally 
changed to a list
[email protected]:2524: error: the default '100' is illegally 
changed from ‘1'

In all three examples, I feel pyang recommends the right thing.  I’d appreciate 
other feedback.

Joe
_______________________________________________
netmod mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to