Re: [netmod] Backward Compatibility Question

Andy Bierman <andy@yumaworks.com> Mon, 02 October 2017 16:27 UTC

Return-Path: <andy@yumaworks.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 ACECE1344D0 for <netmod@ietfa.amsl.com>; Mon, 2 Oct 2017 09:27:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.com
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 4fOTMS-aD_Wj for <netmod@ietfa.amsl.com>; Mon, 2 Oct 2017 09:27:43 -0700 (PDT)
Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 68C87133059 for <netmod@ietf.org>; Mon, 2 Oct 2017 09:27:42 -0700 (PDT)
Received: by mail-lf0-x22a.google.com with SMTP id n140so4385928lfn.4 for <netmod@ietf.org>; Mon, 02 Oct 2017 09:27:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AT7uTFYZFNXUTexjmGDrHCRcfzt0wDbWFKEUMqvu1Ok=; b=mX2WKsTRnNanVUfQl1eGD4E8vxL179KSqvSeNf+/BUdYAAUSEDLQujKHgjz51I8/Y+ kFlt3rjRXL1I1UR1t8SSgAaA5kYW6N/yKZnz1SpAIblfELHjmkb9X/GL49/wZ1f5bFPJ uWuDMQ/HUeTNbS2ExiPBD1b4YUrMK13aQHIIKe6/Q7k9POdrwYcc7cHzpQY0wBrfhbKZ Adcn9yWmw3GsK61ag2DdwHeO1Co6/smoT4NEkZMYJnqcQEVVL3aSNEUfluTaEPT55qqO jRL5uU5y9i2pDdThBpXBoOL+ZT6livUASv6Z3VrY3Dhd20AyyVs32J7Nh1HXFm0HrERf Z2vA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AT7uTFYZFNXUTexjmGDrHCRcfzt0wDbWFKEUMqvu1Ok=; b=B/GW/u17SMhthKp0Nfn9gmRFyQRvTmBZjeZf8r6Cv8QUgRvzs0KiDJ59+pOYjp9WAs t0q4NGTepR205TGCIzNjc3S8SD3eXHYvBdlIXPch80FiGhJU3pUhy2+odM8Np2cUrtlk 106H9fExScASe65kO0uKPNcLHv9pa739Rltn5Qk1XYucihu7nrC9Y7ImKwXWFIBFhKNK dIQlul+qtELZMX5l0snadSpT0qyh/NaV9PfT8NVzdPITl8f+HJ/9fnjArZBuCZZWhPt/ wW1uiVmmjFM9nZwWhwJ7oSgo88mVJucnzBeuEPQEfwVj/MbLrHFSS8EoIMIZC1QZoCuy PBSg==
X-Gm-Message-State: AHPjjUhvvLOB1pyrHymw5qSsNs1e3hG+Klq/3fModz+m3R3y1XEzq+eA YkwLqPw9VEz7h5+uitBpVAj2/a+/tEVqRxSWCTOSyQ==
X-Google-Smtp-Source: AOwi7QBi6gBFbXCGV7bRj7Hwjj5iFLbgYG9TUCQpgYD8+w55a581uceUucUZzggQfqRpxmeXyNHhQr1nh8rNow26xRs=
X-Received: by 10.46.83.17 with SMTP id h17mr7370128ljb.158.1506961660681; Mon, 02 Oct 2017 09:27:40 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.25.143.139 with HTTP; Mon, 2 Oct 2017 09:27:39 -0700 (PDT)
In-Reply-To: <26CE489EF4611643B3EFE43D06E02654015E7548A6@ex-mb1.corp.adtran.com>
References: <26CE489EF4611643B3EFE43D06E02654015E751148@ex-mb1.corp.adtran.com> <26CE489EF4611643B3EFE43D06E02654015E7548A6@ex-mb1.corp.adtran.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Mon, 02 Oct 2017 09:27:39 -0700
Message-ID: <CABCOCHTtW5xgw4yfzqJ-ottDC2FdJdxE=y80VR83OTYWGMxM7w@mail.gmail.com>
To: JOEY BOYD <joey.boyd@adtran.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="94eb2c1ced7079e013055a92da48"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/FPBhN0xZBg9WTc9iPqZIzQWAyRU>
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 16:27:53 -0000

On Mon, Oct 2, 2017 at 6:15 AM, JOEY BOYD <joey.boyd@adtran.com> wrote:

> Hello,
>
> Does anyone have thoughts on this?
>

The choice and case nodes are schema nodes so they are never an issue
for data tree XPath such as must/when.

The change works in your example because a leaf cannot be augmented.
If it was container and some other module augmented it, that module
will break if the container is changed to a choice.



>
> Regards,
> Joey
>

Andy


>
> -----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.
>
> <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
>