[netmod] semver.org comparison of two YANG modules

Benoit Claise <bclaise@cisco.com> Thu, 21 September 2017 01:00 UTC

Return-Path: <bclaise@cisco.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 BE73E132944; Wed, 20 Sep 2017 18:00:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.519
X-Spam-Level:
X-Spam-Status: No, score=-14.519 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 1BnpZiPzd6c1; Wed, 20 Sep 2017 18:00:10 -0700 (PDT)
Received: from alln-iport-8.cisco.com (alln-iport-8.cisco.com [173.37.142.95]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CA606132CE7; Wed, 20 Sep 2017 18:00:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=6723; q=dns/txt; s=iport; t=1505955609; x=1507165209; h=to:cc:from:subject:message-id:date:mime-version; bh=1LLmztzNuhsvr3whFV/099LoM7UtRWMn0aQJKPwWuC8=; b=iZU8zXqokclcYTTD8Qh0u1x0wNdYguLmKmFow4CiD+UhSUs1AEXKbMCL bEeUEZKIQtc143l75+JTBcDiHlK7GDPxzDZ8Ni07/mcrajM+p2WhHhOzd unhPsLedWxAeLhIgkM/53GHmjTcyEhnxv9a4u5gJ7eoolDYaEs3bkhV1w U=;
X-IronPort-AV: E=Sophos;i="5.42,422,1500940800"; d="scan'208,217";a="5939108"
Received: from rcdn-core-6.cisco.com ([173.37.93.157]) by alln-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2017 01:00:09 +0000
Received: from [10.155.68.132] (dhcp-10-155-68-132.cisco.com [10.155.68.132]) by rcdn-core-6.cisco.com (8.14.5/8.14.5) with ESMTP id v8L108QE017591; Thu, 21 Sep 2017 01:00:08 GMT
To: NETMOD Working Group <netmod@ietf.org>
Cc: draft-claise-semver@ietf.org, "Miroslav Kovac -X (mirkovac - PANTHEON TECHNOLOGIES at Cisco)" <mirkovac@cisco.com>
From: Benoit Claise <bclaise@cisco.com>
Message-ID: <a1dbbba2-cbd8-a88f-1520-c6fead33b7d3@cisco.com>
Date: Wed, 20 Sep 2017 18:00:08 -0700
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="------------CCAADBD5FDCCED4D2E9A3950"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/3mDmmIL2wicQvUee0h-Mcj4Kv8c>
Subject: [netmod] semver.org comparison of two YANG modules
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: Thu, 21 Sep 2017 01:00:12 -0000

Dear all,

In light of draft-claise-semver-01 
<https://datatracker.ietf.org/doc/draft-claise-semver/>, and thinking 
about adding an extra metadata piece of information to a YANG module 
(for example here 
<https://www.yangcatalog.org/yang-search/module_details.php?module=ietf-acl>), 
I'm wondering if any of you investigated how to map semver tags into 
backwards (in)compatible YANG module revisions?

    The fields in such a structured version have the following semantics
    (cf.  semver.org):

    o  MAJOR is incremented when the new version of the specification is
       incompatible with previous versions.

    o  MINOR is incremented when new functionality is added in a manner
       that is backward-compatible with previous versions.

    o  PATCH is incremented when bug fixes are made in a backward-
       compatible manner.


I played with "pyang --check-update-from". As an example, ietf-interfaces

    $ pyang ietf-interfaces@2017-08-14.yang
    ietf-interfaces@2017-08-14.yang:1: warning: unexpected latest
    revision "2017-08-17" in ietf-interfaces@2017-08-14.yang, should be
    2017-08-14


Let's not pay attention to this warning above.
If I compare with the RFC version, I get the same output. cx

    $ pyang --path=/home/bclaise/yang/modules
    --check-update-from=/home/bclaise/ietf/YANG-rfc/ietf-interfaces@2014-05-08.yang
    ietf-interfaces@2017-08-14.yang
    ietf-interfaces@2017-08-14.yang:1: warning: unexpected latest
    revision "2017-08-17" in ietf-interfaces@2017-08-14.yang, should be
    2017-08-14
    So the tag should be MINOR or PATCH. Not sure if there is a way to
    automate MINOR versus PATCH?


Now, if I manually modify a leaf in ietf-interfaces@2014-05-08.yang, 
then I get:

    $ pyang --path=/home/bclaise/yang/modules
    --check-update-from=/home/bclaise/ietf/YANG-rfc/ietf-interfaces@2014-05-08.yang
    ietf-interfaces@2017-08-14.yang
    ietf-interfaces@2017-08-14.yang:1: warning: unexpected latest
    revision "2017-08-17" in ietf-interfaces@2017-08-14.yang, should be
    2017-08-14
    ietf-interfaces@2017-08-14.yang:224: error: the base type has
    illegally changed from string to boolean

So I should increment the MAJOR tag.

Is my logic right? Is "pyang --check-update-from" reliable for my use case?

And yeah, I know YANG modules are always supposed to be backwards 
compatible...

Regards, Benoit