Re: [netmod] example modules in 6087bis

Andy Bierman <andy@yumaworks.com> Tue, 17 January 2017 18:12 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 31D181293D8 for <netmod@ietfa.amsl.com>; Tue, 17 Jan 2017 10:12:02 -0800 (PST)
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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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 LjyLMkDsJ7wc for <netmod@ietfa.amsl.com>; Tue, 17 Jan 2017 10:12:00 -0800 (PST)
Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::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 C4AD4128DF6 for <netmod@ietf.org>; Tue, 17 Jan 2017 10:11:59 -0800 (PST)
Received: by mail-qt0-x22a.google.com with SMTP id x49so170486990qtc.2 for <netmod@ietf.org>; Tue, 17 Jan 2017 10:11:59 -0800 (PST)
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=mkp+4txRtV3h7H8gQcEXdyOny4yazAqYt8yfHbpf9c8=; b=rptyMGcVFB/MF1evMlp4NQlzzX1skVszVPK9OuXqEljErjRrZewfoWY0j/K43j5yDz e/fYG4swlSnrU95/ogjJCP6N1SjDIvlzdfV8eFZUPCOhs6foYyCL5nCaW6BIrEArdxDr smFEr7fsS1M+Mf0Fvi6sT2+85jT8hcVsfIhC2SSlAew9pia3EccKmh4k4gY1BE1eScvG ao5wG8ALSzmhvkL78oed0Nor6hTxU5OdxAMHjG/hm0kIocHtVHYC7PyztxWHhy9Jv3Oz R/Maiv86DkGttm7fE0kjcvVZX5bui7RjcJ46mrp5Mv6OXvU5V1GK34ghggwz+LMzEQRf VjAg==
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=mkp+4txRtV3h7H8gQcEXdyOny4yazAqYt8yfHbpf9c8=; b=deGyPjrbU4YkYF2UsTCOMRecH1TFkKD8esKZd8vcL8h5n1923mCfNojsz1FpzUA9Oz GWmkCBcfGpUJrH7UW4ydK/xz6lAnF9vXLZLJaV4I97ZNFJMS8TsOLh9i46iUSB275QA7 Ewd2AfLRDvgTtzF22DI9zEHzf5TbZ8Pt1EcRrIOT6SjSReZl+WU5nh2ce9EW15X2vi5v imQnKaJf1dIHDuSUmGw32823iHqQ/t+aY2rQ6gzAoxdVAcYrK2G0fGqFfOe/IY1uSWNu HymiLTxPl7pBXrahx+RNPQOJ+NEzO8Zr72IN/9twivhbes6UkwxgweJ5SdKHHs/LdUTG 5jww==
X-Gm-Message-State: AIkVDXJJuonGYxXPJZm+pkn+2/1P9/KJY7ACcHE/PdbJYXVGJdXjQn0bWhc49CglOPykEP9z92EJsc2chiJs1g==
X-Received: by 10.237.34.239 with SMTP id q44mr34050215qtc.18.1484676718408; Tue, 17 Jan 2017 10:11:58 -0800 (PST)
MIME-Version: 1.0
Received: by 10.12.145.66 with HTTP; Tue, 17 Jan 2017 10:11:58 -0800 (PST)
In-Reply-To: <20170116.164803.729427888661667991.mbj@tail-f.com>
References: <20170116.164803.729427888661667991.mbj@tail-f.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Tue, 17 Jan 2017 10:11:58 -0800
Message-ID: <CABCOCHQnLbZsR1W7UWgAmJACZ8uSLaAR4s9KWPtayCBkJdJ78w@mail.gmail.com>
To: Martin Bjorklund <mbj@tail-f.com>
Content-Type: multipart/alternative; boundary="001a113e7aee68584505464e3c27"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/0muuoJG02g-VLZIx8-CH9Z74lVo>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [netmod] example modules in 6087bis
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
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: Tue, 17 Jan 2017 18:12:02 -0000

On Mon, Jan 16, 2017 at 7:48 AM, Martin Bjorklund <mbj@tail-f.com> wrote:

> Hi,
>
> It turns out that the recommendations on example modules are a bit
> unclear.  Different drafts do very different things.  Some examples:
>
> https://tools.ietf.org/html/draft-ietf-i2rs-yang-l3-topology
> -08#section-6.1.2
>
> This example module really looks like a real module.  It uses an
> IANA-controlled namespace, and the meta-statements indicate that this
> is a normative modules.  But the module does not use the <CODE> tags.
>
>

This example needs to be redone.

There are 2 conflicting goals that need to be addressed.

1) Clearly identify a module as an example; not meant to be implemented;
    only present to demonstrate protocol interactions with an example module

2) Teach people good YANG authoring habits
     Way too much cut-and-paste out there so maybe if the examples
     follow "pyang --ietf" people will learn the right way to construct a
module





>
> https://tools.ietf.org/html/draft-ietf-netconf-restconf-18#appendix-C.1
>
> This module is better, but it is written to follow RFC 6087 rules
> (pass pyang --ietf), with the result that it contains a bit of "noise"
> with some meaningless descriptions and meta-statements.  It also does
> not use <CODE> tags.
>
>
> A good example (IMO) is found in
> https://tools.ietf.org/html/rfc8022#appendix-C
>
> It uses descriptions when necessary (high s/n), no fake
> meta-statements etc.
>
>


It does not have a revision-stmt, which is really important
for real YANG modules.

IMO the random set of description-stmts is no better or worse
than the examples in the RESTCONF draft.



> However, it might be a good idea to require example modules to have a
> "description" statement that explains what the module examplifies.
> For example, the example-rip could have:
>
>   description
>     "This example module demonstrates how the core routing data model
>      can be extended to support a new control-plane protocol.  It is
>      intended as an illustration rather than a real definition of a
>      data model for the Routing Information Protocol (RIP).";
>
>
>
OK


>
> I think that 6087bis is clear when it says:
>
>   The guidelines in this document refer mainly to a normative complete
>   module or submodule, but may be applicable to example modules and
>   YANG fragments as well.
>
> I think this states that example modules do not have to pass pyang
> --ietf.
>
>

I agree that examples do not need to pass with the --ietf flag.
But is the guideline a SHOULD pass or MAY pass?
(agree it is not MUST pass)



>
> In order to make this more clear, I suggest the following changes to
> draft-ietf-netmod-rfc6087bis-09
>
> In the Terminology section 2.4:
>
> NEW:
>
>   o  Example module:  A complete YANG module or submodule that is
>      intended to illustrate some specific aspect, but not intended for
>      actual use.
>
>
> In section 4:
>
> NEW:
>
>    All normative modules or submodules, example modules or submodules,
>    and example YANG fragments MUST be valid according to RFC 7950,
>    except when they are used to illustrate some illegal constructs.
>
>
> In Section 4.2.1 "Example Modules":
>
> NEW:
>
>   An example module SHOULD have a namespace on the form
>
>     o  http://example.com/<module-name> OR
>     o  urn:example:<module-name>
>
>   An example module SHOULD have a description statement that describes
>   that it is an example module, and what it examplifies.
>
>   An example module SHOULD NOT have any additional meta-statements
>   (i.e., "organization", "contact", or "reference").
>
>   An example module SHOULD use the "description" statement in any
>   definition where it is required to understand the example.
>
>
>

new text is OK with me.
I would make it clear that module description and revision
SHOULD be present. All other optional clauses MAY be present.



>
>
> /martin
>
>
Andy


> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>