Subject: [netmod] import by revision and updated modules

From: Robert Wilton <[email-masked]>
Date: Mon, 2 Oct 2017 16:57:52 +0100

Ideally, I think that it would be good if the ietf-routing module could 
be upgraded in place without a namespace change.

However, one problem with this approach is that it looks like YANG's 
"import by revision" doesn't help in the way that one might hope:

If ietf-routing is published with revision B, then ideally all the 
modules that are augmenting from ietf-routing would be able to indicate 
that they need at least revision B.

The YANG import revision-date keyword doesn't help because that means 
that they have to import exactly revision B.  So we could have 30+ 
augmenting modules that all import with ietf-routing revision B.  E.g. 
if import revision-date was used then what happens when a new revision C 
of ietf-routing needs to be provided, perhaps to add an extra leaf?  
Suddenly all those modules that previously used revision-date to import 
revision B would need to have a new version published to import revision 
C! Naturally, this problem would recurse down to all other augmenting 
modules, anywhere where import by revision is used.  This sounds like it 
would be a maintenance nightmare.

It seems like the "import with revision-date" functionality in YANG may 
not help with this upgrade problem, and perhaps a more useful variant 
would be an "import with at least revision X" that would accept any 
revision X or later.  This might be another feature request for YANG 
2.0.  Or perhaps this could be solved more elegantly with some proper 
semantic versioning of YANG modules.

I guess that for ietf-routing, the pragmatic solution would be for 
dependent modules to use 'import' and not 'import by revision'.  Perhaps 
with a comment indicating which module they are dependent on.

Thinking about it further, I am slightly unsure when using "import with 
revision-date" is a genuinely good idea.

Thanks,
Rob