[netmod] Backward Compatibility Question

JOEY BOYD <joey.boyd@adtran.com> Wed, 27 September 2017 14:05 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 E52C4132D8A for <netmod@ietfa.amsl.com>; Wed, 27 Sep 2017 07:05:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7] 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 xymXnqsfbZrk for <netmod@ietfa.amsl.com>; Wed, 27 Sep 2017 07:05:50 -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 6C37C13239C for <netmod@ietf.org>; Wed, 27 Sep 2017 07:05:50 -0700 (PDT)
Received: from ex-hc2.corp.adtran.com (ex-hc3.adtran.com [76.164.174.83]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-86-3L8H47suNkCPUq_X-mgotw-1; Wed, 27 Sep 2017 10:05:48 -0400
Received: from ex-mb1.corp.adtran.com ([fe80::51a3:972d:5f16:9952]) by ex-hc2.corp.adtran.com ([fe80::a019:449b:3f62:28e5%10]) with mapi id 14.03.0361.001; Wed, 27 Sep 2017 09:05:47 -0500
From: JOEY BOYD <joey.boyd@adtran.com>
To: "'netmod@ietf.org'" <netmod@ietf.org>
Thread-Topic: Backward Compatibility Question
Thread-Index: AdM3mbcvie9AP8VEQcaGGyl32renDQ==
Date: Wed, 27 Sep 2017 14:05:46 +0000
Message-ID: <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: 3L8H47suNkCPUq_X-mgotw-1
Content-Type: text/plain; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/YPucoh6T-Y4M7spIpGtAuTYUphU>
Subject: [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: Wed, 27 Sep 2017 14:05:52 -0000

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