Re: [yang-doctors] guideline for enum and value?

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Thu, 25 January 2018 09:11 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4584112DA01 for <yang-doctors@ietfa.amsl.com>; Thu, 25 Jan 2018 01:11:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01, 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 KaLURX9zcruF for <yang-doctors@ietfa.amsl.com>; Thu, 25 Jan 2018 01:11:20 -0800 (PST)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 959C112D868 for <yang-doctors@ietf.org>; Thu, 25 Jan 2018 01:11:20 -0800 (PST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id 5EC356BA; Thu, 25 Jan 2018 10:11:19 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.217]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id vfb9t6O0s7Ca; Thu, 25 Jan 2018 10:11:18 +0100 (CET)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Thu, 25 Jan 2018 10:11:19 +0100 (CET)
Received: from localhost (demetrius2.jacobs-university.de [212.201.44.47]) by hermes.jacobs-university.de (Postfix) with ESMTP id 3C50720147; Thu, 25 Jan 2018 10:11:19 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius2.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id S5-XKIATe10Q; Thu, 25 Jan 2018 10:11:18 +0100 (CET)
Received: from elstar.local (unknown [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id BECFE2014D; Thu, 25 Jan 2018 10:11:18 +0100 (CET)
Received: by elstar.local (Postfix, from userid 501) id 80A9F4229138; Thu, 25 Jan 2018 10:11:18 +0100 (CET)
Date: Thu, 25 Jan 2018 10:11:18 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: bclaise@cisco.com, yang-doctors@ietf.org
Message-ID: <20180125091118.tjn5eiv2hzmc7k23@elstar.local>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Martin Bjorklund <mbj@tail-f.com>, bclaise@cisco.com, yang-doctors@ietf.org
References: <c3d21c6e-8cc0-e109-4b81-278242d70071@cisco.com> <20180125083753.kngg2f3zysxq4qbm@elstar.local> <20180125.095921.224499312159563778.mbj@tail-f.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20180125.095921.224499312159563778.mbj@tail-f.com>
User-Agent: NeoMutt/20171215
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/t-81hS4BhsRZXU8uDtRmRCQfVag>
Subject: Re: [yang-doctors] guideline for enum and value?
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 25 Jan 2018 09:11:27 -0000

On Thu, Jan 25, 2018 at 09:59:21AM +0100, Martin Bjorklund wrote:
> Hi,
> 
> Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> > On Thu, Jan 25, 2018 at 09:18:27AM +0100, Benoit Claise wrote:
> > > Dear all,
> > > 
> > > Still busy with the RFC6087bis AD review, reviewing the enum sections now.
> > > 
> > > Do I recall correctly a guideline about not using "value" in enum?
> 
> I think this was a discussion on YANG 1.1, not 6087bis (but I might be
> wrong).
> 
> > > Something to be inserted in RFC6087bis? At least a pros and cons discussion?
> > >
> > 
> > I would rather say the opposite:
> > 
> >   YANG automatically assigns numeric values to enums if no values are
> >   specified. This automatic assignment requires that (a) the order of
> >   enums never changes and (b) additional enums are only appended but
> >   never prepended or inserted. This is subtle and using explicit value
> >   assignments, though more verbose, tends to be more robust when
> >   modules are revised.
> 
> Is this a recommendation to always use the "value" statement?  I don't
> think now is the right time to add such an recommendation, and I don't
> think it should be recommended.  Maybe we could say something about
> taking care when adding an enum, but RFC 7950, section 11, bullet 1
> already says that value must not change, so we would essentially just
> say that you must follow the rules of 7950.
>

The text I wrote explains the issue. It does not say you have to use
explicit value assignments (but if you want to be robust, then its
probably a good idea to use explicit assignments).

The fact that Benoit did not recall this correctly is likely an
indication that people not deeply involved in YANG do not necessarily
memorize this subtlety. Not everybody knows RFC 7950 by heart. (But
yes, not everybody will read RFC6087bis either and there are likely
quite a few things in RFC6087bis that are not strictly needed.)
Anyway, I do not plan to spend more time on guessing whether this is
helpful or not.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>