[netmod] Re: Defining groupings after the fact? draft-jouqui-netmod-yang-full-include and the reuse of definitions

Alexander L Clemm <ludwig@clemm.org> Thu, 01 August 2024 19:10 UTC

Return-Path: <ludwig@clemm.org>
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 8CA13C14F5FE for <netmod@ietfa.amsl.com>; Thu, 1 Aug 2024 12:10:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.105
X-Spam-Level:
X-Spam-Status: No, score=-7.105 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=clemm.org
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rp-DRIr4SGVn for <netmod@ietfa.amsl.com>; Thu, 1 Aug 2024 12:10:02 -0700 (PDT)
Received: from mout.perfora.net (mout.perfora.net [74.208.4.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A9257C15152B for <netmod@ietf.org>; Thu, 1 Aug 2024 12:10:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clemm.org; s=s1-ionos; t=1722539401; x=1723144201; i=ludwig@clemm.org; bh=jNsGeX0yuY/s7iCiw/vxak9GnIvfY3lSYTUOmvmQiNw=; h=X-UI-Sender-Class:Content-Type:Message-ID:Date:MIME-Version: Subject:To:References:From:In-Reply-To:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=GFouwBaKrmpXSr+oVHy5Gy/eNCjcZ52Fiv497WJoWCdEOnN9HEghRPNFON6Bs4O9 aDPrZdNHuqq/VhPjUihLRyrpK63DM1mtTmVEGrl4D2Ks2ToF89twQIfg49eY8goju GkFXi8tiA3fA57EZAz8G3QKeRmsE9aMsvRkt2WiWw9r1kBIRtn777+7liphQVU5KD D9ii9avKfiG7is7H8BGVPUeWl/NAzWeL55lILDxkTvNT+/UEWmMZqrzuAuoPZVn+y arpkG92bQMo/K7mGAJi2JhIDH/paLxT4Hr06fWjpcjJDWKK90g2nZoSf69vkatw7T VanKRD0XUU5AkYkNFw==
X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6
Received: from [172.16.0.44] ([172.56.46.195]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPSA (Nemesis) id 0LzuPF-1sCaT41Vtj-010xOs for <netmod@ietf.org>; Thu, 01 Aug 2024 21:10:01 +0200
Content-Type: multipart/alternative; boundary="------------yypgRn3tMZaDwZQk30n0oh43"
Message-ID: <b76ba835-c655-4ac8-b891-b1dca114f71e@clemm.org>
Date: Thu, 01 Aug 2024 12:10:00 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: netmod@ietf.org
References: <e111be29-e825-4357-88e3-19c9b3f87930@clemm.org> <b0780aa0c8504c93b7d5ff6c837ea697@huawei.com> <2abcd109-455b-42f3-8529-fb9f3d68321e@clemm.org> <CAEe_xxim4xBkvq2dvh1mi1n3xkE+7Yt1btguwvj97mdXV1vkow@mail.gmail.com>
Content-Language: en-US
From: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PZgWQ4AKkcraKv1mcuV/64sMrlDpiGO0X9mf0o5CTM+0eQB2eeC7hjI qxD+Pcc0wX4xeiS11g7jzTEK2ygNxVhKw==
Message-ID-Hash: IB2RGLBBOIZHY5L6QOYUEPEMMQDRM3CT
X-Message-ID-Hash: IB2RGLBBOIZHY5L6QOYUEPEMMQDRM3CT
X-MailFrom: ludwig@clemm.org
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-netmod.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [netmod] Re: Defining groupings after the fact? draft-jouqui-netmod-yang-full-include and the reuse of definitions
List-Id: NETMOD WG list <netmod.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/EUuKOMRR0OvEE-vwIa6xLQcQkjw>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Owner: <mailto:netmod-owner@ietf.org>
List-Post: <mailto:netmod@ietf.org>
List-Subscribe: <mailto:netmod-join@ietf.org>
List-Unsubscribe: <mailto:netmod-leave@ietf.org>

Hello William,

oh, thank you for pointing that out.  I wasn't aware that it is allowed
to replace existing data definition nodes with a grouping and put a
"uses" statement instead in an update of the module.

In that case, if you wanted to reuse a definition, you would however
still not be able to simply reuse what is there.  You would need to
update the module (whose definitions you wanted to use/embed) first,
only then be able to reuse it.  Still, it would provide the option to
refactor existing module definitions with groupings/uses, then use those
groupings in the new definitions (that would otherwise need to embed).  
This could be done with the existing means (hidden as they may be -
perhaps needing to be called out as a "best practice" or "design
pattern" or such).

Would we in that case even still need a new embed substatement? (IMHO in
the longer term it would be desirable to be able to reuse without
needing to update existing module definitions with equivalent ones. 
Although as you point out that is possible, it seems a bit awkward.  I
guess the question is if or when YANG-next is going to happen and if a
new construct is needed in the interim.)

--- Alex

On 8/1/2024 1:21 AM, William Lupton wrote:
> Alex,
>
> On Wed, 31 Jul 2024 at 23:37, Alexander L Clemm
> <ludwig=40clemm.org@dmarc.ietf.org> wrote:
>
>     ...
>     >> As a thought, it might be useful to introduce a construct that
>     will allow to define
>     >> a _grouping_ after-the-fact, for later reuse. I.e., allow
>     groupings to be defined
>     >> in a way that the new grouping embeds an existing definition,
>     then simply make
>     >> use of that grouping.  That would seem perhaps cleanest, able
>     to address many
>     >> of the use cases and have the additional advantage that the
>     semantics here will
>     >> be very clear since part of the exising YANG framework.
>     > There is still the augment issue from above, we have it in
>     draft-ietf-opsawg-collected-data-manifest when reusing
>     ietf-yang-push which augments ietf-subscribed-notifications. All
>     these augments have to be rewritten with paths corresponding to
>     the new location of the uses.
>     <AC> I don't think that would be an issue, actually. Just declare
>     modular, fine grained groupings and use those.  Of course, this is
>     somewhat a speculative discussion as YANG is what it is and does not
>     support this today.
>
>
> <WL>
> What does "this" refer to here? YANG _does_ "allow groupings to be
> defined in a way that the new grouping embeds an existing definition",
> doesn't it?
>
> https://datatracker.ietf.org/doc/html/rfc7950#section-11 : Any set of
> data definition nodes may be replaced with another set of
> syntactically and semantically equivalent nodes. For example, a set of
> leafs may be replaced by a "uses" statement of a grouping with the
> same leafs.
> </WL>
>
> Cheeers,
> William
>
> _______________________________________________
> netmod mailing list --netmod@ietf.org
> To unsubscribe send an email tonetmod-leave@ietf.org