Re: [netmod] uses and augment

Andy Bierman <andy@yumaworks.com> Fri, 24 March 2017 00:59 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 3FD0C1293FC for <netmod@ietfa.amsl.com>; Thu, 23 Mar 2017 17:59:25 -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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-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 EyMFnZwHbaYB for <netmod@ietfa.amsl.com>; Thu, 23 Mar 2017 17:59:22 -0700 (PDT)
Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com [IPv6:2a00:1450:400c:c0c::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 05BA8124B0A for <netmod@ietf.org>; Thu, 23 Mar 2017 17:59:22 -0700 (PDT)
Received: by mail-wr0-x22a.google.com with SMTP id y90so183037wrb.0 for <netmod@ietf.org>; Thu, 23 Mar 2017 17:59:21 -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=W4HjAh8k7kV9w0RbOe/4OAc4b4oQNManwJ/+BXfWkPY=; b=ymPv81vrae/hA/suiqzgDcthT7aEsZN5Zf+BbizxgB6yn3C8ghXUnf4wKSzVpwd5I5 h3aBqBanysCN2fEkGhEf3DzVOkXyKGYT61vgD1ufkVYd8gbZkxhFtlrNPZJTRozJa5Ya zCKQAgiuy1VTKBLjiQNEAySKNfdjF6cPCxyH7vqrB27fPVESOS4Ww49ZGhSBQ/dOwEtp mnH69o8mzhoQ7rSZg4LSJHetHgWlaKlbgLSF4WhwZRKANxRTcBaQusSfk34y2nGkrNiN k63V23F22r656YHXrdiGIKnXdEa79WGvINWdwEAMsryCR9xHPyujkgqxXHa2eKJdMnTB ob3w==
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=W4HjAh8k7kV9w0RbOe/4OAc4b4oQNManwJ/+BXfWkPY=; b=d43/TuT7lT/NEy1AtQTT1uj2Y/Qx50o2RPSznQL1GvZbiahCL/Dm0VPZPLhHmOsodD 2jJ/BLIKZX+5slame9nsQ4ZUnRsRloYp7ZVdEQZqxBCFZNS9lMTocAHzcqvhYWwLml3r py5/XPREw1fhCahVREJfVio6E80p4XWR9//2vNSGzRE5i5JQDgKI25f2He26/oKvO0bs 436X6Ptp2kSWlyrM+DeUkLUFT+xFPtPsvrgH8kT+zjETGlcNkLS4sUshNy5C3Cf5yHaT FXQDBpeVx07XreziYMCW+mQvhHn9IrCCM1A/BqaWr/xqTYzCjhC4VEsZsUYdkG74Vo7U lvhw==
X-Gm-Message-State: AFeK/H1nmpnB+h5zWjsW6aoJWcbm5FW+rXFaqF4ulomTuT9LaaOEui7MKaKmEpFD6nC7/mOasB4dFwX8w6IrAw==
X-Received: by 10.223.177.151 with SMTP id q23mr4824588wra.65.1490317160553; Thu, 23 Mar 2017 17:59:20 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.166.37 with HTTP; Thu, 23 Mar 2017 17:59:19 -0700 (PDT)
In-Reply-To: <87y3vvpkev.fsf@hobgoblin.ariadne.com>
References: <20170322.212411.1191940569571241434.mbj@tail-f.com> <87y3vvpkev.fsf@hobgoblin.ariadne.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Thu, 23 Mar 2017 17:59:19 -0700
Message-ID: <CABCOCHSQ2NsEMpdVqcZd4EoHX+HRoP=hTWYMBM-WsaPMgWpKsQ@mail.gmail.com>
To: "Dale R. Worley" <worley@ariadne.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="f403045e7cd4f52f92054b6f80f6"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/_-JhT8B53tEvaLnLDxzXlbkinGg>
Subject: Re: [netmod] uses and augment
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: Fri, 24 Mar 2017 00:59:25 -0000

Hi,

I think the reason this was rejected is because you cannot control
which "uses" of the grouping should get the augmenting nodes.
They all get the nodes.  There is no way for the uses-stmt to "opt-in"
to the new changes, except manually:

   grouping foo { ... }

   grouping new-foo {
       uses foo;
       // add new nodes via augment or data-def-stmt;
   }

By forcing the "uses foo" to change to "uses new-foo",
the data model designer is explicitly accepting the new changes.

Note that import-without-revision can also cause the uses-stmt
to expand differently as the imported module changes over time.
This is a separate problem.


Andy


On Thu, Mar 23, 2017 at 5:50 PM, Dale R. Worley <worley@ariadne.com> wrote:

> Martin Bjorklund <mbj@tail-f.com> writes:
> >> I notice that "augment" is not allowed to target a "grouping", despite
> >> that naively seems to be an operation that a module designer might like
> >> to do.  I expect that there is a reason why this is not allowed.
> >
> > There were lots of debate over this one when we first designed YANG.
> > The main reason for not allowing this is that it can easily have
> > unintended consequences.  Module A uses a grouping G b/c it fits the
> > purpose.  Later someone augments G with some nodes; at this point it
> > is not at all clear that the additional nodes are suitable for module
> > A.
>
> True...  But assuming that the grouping G has clean semantics, it
> corresponds to some facility in the device, which in some way or another
> appears in multiple places in the device's data model.  And a module
> that augments G adds semantics about that facility, and would only be
> implemented by a device for which the facility uniformly has that
> additional semantics.  So it would be suitable for every place where the
> grouping is used.
>
> It seems like this consideration applies to the "Yang mount" facility
> also -- if a module A augments another module B, and module B is mounted
> in several places in the full data model, then all the instances of
> module B will be augmented.
>
> > Ok.  Well, if you want to add a sibling node to the nodes in the
> > grouping it is trivial:
> >
> >   grouping foo {
> >     leaf a { ... }
> >   }
> >
> >   uses foo;
> >   leaf b { ... }
> >
> > gives you:
> >
> >    leaf a { ... }
> >    leaf b { ... }
>
> Of course, that works.  But what I'm considering is a modification of
> the grouping which implicitly applies to all "uses" of that grouping --
> because you don't want to have duplicate declarations of the added nodes
> in every place the grouping is used.
>
> > Well, the syntax of descendant-schema-nodeid looks like an XPath path
> > expression in abbreviated form, but it is not defined in terms of
> > XPath, hence there is no text about any XPath context.  See also
> > section 6.5
>
> OK, "context node" isn't the right term, but the idea still applies --
> if the schema node identifier is descendant, the starting point for
> reckoning the descending path has to be specified.
>
> Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> writes:
> > On Wed, Mar 22, 2017 at 02:26:53PM -0400, Dale R. Worley wrote:
> > This is not at all clear. You only import 'foo' - so why would the
> > augment of /foo:target (which is not exactly defined either) done in
> > 'bar' apply to uses foo:target in baz?
>
> I'd say because that's what one would expect "augmenting" of a grouping
> to mean.  Again, it looks like there will be similar behavior in "Yang
> mount".
>
> > Augments are restricted to things that have a well defined name in the
> > data tree because this makes it clear what is being augmented. One
> > would have to create additional language constructs to make
> > augmentations of groupings work.
>
> It's clear that *groupings* have well-defined names, because "uses"
> statements can refer to them.  RFC 7950 section 7.13 isn't particularly
> clear about how the argument string of the statement is to be
> interpreted, but going back over 7950, I'm getting the idea that the
> names of groupings are not descendant-schema-nodeid's, that is, named
> based on where the grouping statement sits in the syntactic hierarchy,
> but are in a separate namespace which is flat regarding equality and
> inequality comparisons, but has elaborate scoping rules regarding which
> groupings are visible in which locations.
>
> OK, that clarifies why you can't apply "augment" to a grouping --
> groupings (and thus the things defined within them) don't have names
> that can be expressed by descendant-schema-nodeid's.
>
> Dale
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>