Re: [netmod] Backward Compatibility Question

Martin Bjorklund <mbj@tail-f.com> Mon, 02 October 2017 17:19 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 30570120720 for <netmod@ietfa.amsl.com>; Mon, 2 Oct 2017 10:19:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zp8PA6DPrxMN for <netmod@ietfa.amsl.com>; Mon, 2 Oct 2017 10:19:26 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 7602A1321C9 for <netmod@ietf.org>; Mon, 2 Oct 2017 10:19:26 -0700 (PDT)
Received: from localhost (h-40-225.A165.priv.bahnhof.se [94.254.40.225]) by mail.tail-f.com (Postfix) with ESMTPSA id 740BF1AE018C; Mon, 2 Oct 2017 19:19:25 +0200 (CEST)
Date: Mon, 02 Oct 2017 19:19:25 +0200
Message-Id: <20171002.191925.1932918019399415014.mbj@tail-f.com>
To: joey.boyd@adtran.com
Cc: netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <26CE489EF4611643B3EFE43D06E02654015E7548A6@ex-mb1.corp.adtran.com>
References: <26CE489EF4611643B3EFE43D06E02654015E751148@ex-mb1.corp.adtran.com> <26CE489EF4611643B3EFE43D06E02654015E7548A6@ex-mb1.corp.adtran.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/vs20LyKmCqzk1zCYp2IC4ujlXVM>
Subject: Re: [netmod] Backward Compatibility Question
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 02 Oct 2017 17:19:28 -0000

JOEY BOYD <joey.boyd@adtran.com> wrote:
> Hello,
> 
> Does anyone have thoughts on this?
> 
> Regards,
> Joey
> 
> -----Original Message-----
> From: JOEY BOYD 
> Sent: Wednesday, September 27, 2017 9:06 AM
> To: 'netmod@ietf.org'
> Subject: Backward Compatibility Question
> 
> Hi all,
> 
> Suppose I had a published YANG model with the following leaf.
> 
> 
>   leaf thing1 {
>     type uint8;
>     description
>       "Thing 1.";
>   }
> 
> Later, I realize that I wish I had modeled this in a choice as I now have a mutually exclusive option to 'thing1' which I want to add to the model.
> 
>   leaf thing2 {
>     type empty;
>     description
>       "Thing 2.";
>   }
> 
> This is a very simplified example but should be sufficient to demonstrate the problem. 
> 
> If I look at the XML representation of 'thing1', it looks like this.
> 
> <thing1>123</thing1>
> 
> If I were to move 'thing1' into a choice with a single case, it would look like this.
> 
> choice things {
>   case thing1 {
>     leaf thing1 {
>       type uint8;
>       description
>         "Thing 1.";
>     }
>   }
> }
> 
> Looking to the XML representation, it looks the same as before.

But it is not backwards compatible, since the schema tree has
changed.  Suppose that "thing1" was a container; then some other
module might have augmented that container.  If you put the node in a
choice and case, the augment will no longer work.


/martin




> 
> <thing1>123</thing1>
> 
> To me, this means that taking a single node or set of nodes and moving them under a case within a new choice statement is a backward compatible change. This assumes, of course, any mandatory or default behavior is preserved. I now can add 'thing2' to the existing model as an option to 'thing1'.
> 
> choice things {
>   case thing1 {
>     leaf thing1 {
>       type uint8;
>       description
>         "Thing 1.";
>     }
>   }
>   case thing2 {
>     leaf thing2 {
>       type empty;
>       description
>         "Thing 2.";
>     }
>   }
> }
> 
> Do you agree with this analysis or am I missing something?
> 
> Best regards,
> Joey
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>