Re: [netmod] Backward Compatibility Question

JOEY BOYD <joey.boyd@adtran.com> Mon, 02 October 2017 13:15 UTC

Return-Path: <joey.boyd@adtran.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 D4F3E134628 for <netmod@ietfa.amsl.com>; Mon, 2 Oct 2017 06:15:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.101
X-Spam-Level:
X-Spam-Status: No, score=0.101 tagged_above=-999 required=5 tests=[BAYES_50=0.8, RCVD_IN_DNSWL_LOW=-0.7, 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 fxuRNIA4VyUx for <netmod@ietfa.amsl.com>; Mon, 2 Oct 2017 06:15:45 -0700 (PDT)
Received: from us-smtp-delivery-128.mimecast.com (us-smtp-delivery-128.mimecast.com [63.128.21.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 05722132F8F for <netmod@ietf.org>; Mon, 2 Oct 2017 06:15:44 -0700 (PDT)
Received: from ex-hc3.corp.adtran.com (ex-hc2.adtran.com [76.164.174.82]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-198-azeHjrDQMcO-GY9_Tg_Qeg-1; Mon, 02 Oct 2017 09:15:42 -0400
Received: from ex-mb1.corp.adtran.com ([fe80::51a3:972d:5f16:9952]) by ex-hc3.corp.adtran.com ([fe80::3892:20fa:600f:75c6%15]) with mapi id 14.03.0361.001; Mon, 2 Oct 2017 08:15:40 -0500
From: JOEY BOYD <joey.boyd@adtran.com>
To: "'netmod@ietf.org'" <netmod@ietf.org>
Thread-Topic: Backward Compatibility Question
Thread-Index: AdM3mbcvie9AP8VEQcaGGyl32renDQD5rWMg
Date: Mon, 02 Oct 2017 13:15:40 +0000
Message-ID: <26CE489EF4611643B3EFE43D06E02654015E7548A6@ex-mb1.corp.adtran.com>
References: <26CE489EF4611643B3EFE43D06E02654015E751148@ex-mb1.corp.adtran.com>
In-Reply-To: <26CE489EF4611643B3EFE43D06E02654015E751148@ex-mb1.corp.adtran.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [172.22.112.103]
MIME-Version: 1.0
X-MC-Unique: azeHjrDQMcO-GY9_Tg_Qeg-1
Content-Type: text/plain; charset="WINDOWS-1252"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/GOIqcbpPNB8EHOJnED4DgX3kGFU>
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 13:15:47 -0000

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.

<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