<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc linkmailto="no" ?>
<?rfc editing="no" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc-ext allow-markup-in-artwork="yes" ?>
<?rfc-ext include-index="no" ?>
<!--<?rfc strict="no"?> -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" docName="draft-andersson-netmod-yang-module-filename-00" category="std" consensus="true" updates="6020, 7950, 8407" ipr="trust200902" obsoletes="" submissionType="IETF" xml:lang="en" tocInclude="true" symRefs="true" sortRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.21.0 -->
  <front>
    <title abbrev="YANG module file name convention">
        YANG module file name convention
    </title>
    <seriesInfo name="Internet-Draft" value="draft-andersson-netmod-yang-module-filename-00"/>
    <author fullname="Per Andersson" initials="P." surname="Andersson">
      <organization>Cisco Systems</organization>
      <address>
        <email>per.ietf@ionio.se</email>
      </address>
    </author>
    <date/>
    <area>OPS Area</area>
    <workgroup>NETMOD Working Group</workgroup>
    <abstract>
      <t>This document presents YANG module file name convention. The convention
        extends the current YANG module file name using revision‑date, with
        the YANG semantic version extension. The YANG semantic version extension
        allows for an informative version to be associated with a particular
        YANG module revision.</t>
    </abstract>
    <note>
      <name>Editorial note (To be removed by the RFC Editor)</name>
      <t>In the YANG module versionining work it was previously defined in
        <xref target="I-D.ietf-netmod-yang-semver" format="default"/> that file names
        could use the revision label (YANG Semantic version extension) instead
        of the revision date, which is standardized in <xref target="RFC7950" format="default"/>.
        This work was removed in an attempt to progress the module versioning
        work, but the YANG versioning design team was tasked to address it by
        the NETMOD WG. This draft extends YANG module file names conformity with
        the possibility to use revision label instead of revision date.
      </t>
    </note>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>This document defines the YANG module file convention. It extends the
        current convention defined in <xref target="RFC7950" format="default"/>, which uses
        revision-date, with the YANG semantic version extension defined in
        <xref target="I-D.ietf-netmod-yang-semver" format="default"/>.</t>
      <section anchor="motivation" numbered="true" toc="default">
        <name>Motivation</name>
        <t>
          The motivation for using YANG semantic version instead of revision
          date is that it carries information to the user. A revision date only
          tells the user that it has been updated, while, for instance, a YANG
          Semver version can tell the user about the modules compatibility level
          at a glance. Having this information available as early as possible,
          i.e. in the module file name, makes it possible to quickly identify
          the module revision; compared to searching in the file contents and
          checking the revisions. Having the YANG semantic version visible in
          the file name will make it easier to handle large sets of YANG modules.
        </t>
        <t>
          The YANG module file name schema described in this draft is already
          deployed in the industry. Now is the time to standardize before
          several proprietary solutions emerges.
        </t>
        <t>
          It is relatively easy to update tooling to handle YANG semantic
          version in the YANG module file name according to this draft. However,
          it is recognized that the migration of all tooling within the industry
          will take time.
        </t>
      </section>
    </section>
    <section anchor="module-filenames" numbered="true" toc="default">
      <name>Module file names</name>
      <t>
        This section updates <xref section="5.2" target="RFC7950" format="default"/>,
        <xref section="5.2" target="RFC6020" format="default"/>, and
        <xref section="3.2" target="RFC8407" format="default"/>.
      </t>
      <t>
        If a revision has an associated YANG semantic version (ys:version)
        then it is RECOMMENDED that the YANG semantic version is used instead of
        the revision date in the file name of a YANG file, where it takes the
        form:
      </t>
      <artwork align="left" name="filename-abnf" type="" alt=""><![CDATA[

    module-or-submodule-name [['@' revision-date]['#' ys:version]]
        ( '.yang' / '.yin' )

          ]]></artwork>
      <t>
        E.g., acme-router-module@2024-05-15.yang or
        acme-router-module#2.0.3.yang.
      </t>
      <t>
        YANG module (or submodule) files MAY be identified using either
        revision-date or YANG semantic version (ys:version). Typically, only one
        file name SHOULD exist for the same module (or submodule) revision. Two
        file names, one with the revision date and another with the YANG
        semantic version, MAY exist for the same module (or submodule) revision,
        e.g., when migrating from one scheme to the other.
      </t>
      <section anchor="yang-semver" numbered="true" toc="default">
        <name>Coexistence with YANG Semver</name>
        <t>
          As can be seen above, all valid identifiers for YANG semantic version
          are valid in the filename as well.
          <xref section="4.3" target="I-D.ietf-netmod-yang-semver" format="default"/>
        </t>
        <t>
          The following example is a valid YANG module file name
        </t>
        <artwork align="left" name="" type="" alt=""><![CDATA[

    example-module#2.3.1_non_compatible+build2237refM443ss.yang

          ]]></artwork>
        <t>
          One consequence of this is that there might exist two child modules
          of version 2.0.0 with the same X.Y.Z digits (2.0.1) but different
          version labels:
        </t>
        <artwork align="left" name="" type="" alt=""><![CDATA[

    2.0.1-draft-superman-super-stuff-03

    2.0.1-draft-batman-cool-addition-07   (a competing draft)

            ]]></artwork>
      </section>
    </section>
    <section anchor="security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>There are no security considerations for this draft.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-rfc8407bis.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang-module-versioning.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang-semver.xml"/>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <!-- MUSTs, etc. -->
      <reference anchor="RFC6020" target="https://www.rfc-editor.org/info/rfc6020" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6020.xml">
          <front>
            <title>YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)</title>
            <author fullname="M. Bjorklund" initials="M." role="editor" surname="Bjorklund"/>
            <date month="October" year="2010"/>
            <abstract>
              <t>YANG is a data modeling language used to model configuration and state data manipulated by the Network Configuration Protocol (NETCONF), NETCONF remote procedure calls, and NETCONF notifications. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6020"/>
          <seriesInfo name="DOI" value="10.17487/RFC6020"/>
        </reference>
        <!-- YANG (orig) -->
      <reference anchor="RFC7950" target="https://www.rfc-editor.org/info/rfc7950" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml">
          <front>
            <title>The YANG 1.1 Data Modeling Language</title>
            <author fullname="M. Bjorklund" initials="M." role="editor" surname="Bjorklund"/>
            <date month="August" year="2016"/>
            <abstract>
              <t>YANG is a data modeling language used to model configuration data, state data, Remote Procedure Calls, and notifications for network management protocols. This document describes the syntax and semantics of version 1.1 of the YANG language. YANG version 1.1 is a maintenance release of the YANG language, addressing ambiguities and defects in the original specification. There are a small number of backward incompatibilities from YANG version 1. This document also specifies the YANG mappings to the Network Configuration Protocol (NETCONF).</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7950"/>
          <seriesInfo name="DOI" value="10.17487/RFC7950"/>
        </reference>
        <!-- YANG (curr) -->
      <reference anchor="RFC8407" target="https://www.rfc-editor.org/info/rfc8407" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8407.xml">
          <front>
            <title>Guidelines for Authors and Reviewers of Documents Containing YANG Data Models</title>
            <author fullname="A. Bierman" initials="A." surname="Bierman"/>
            <date month="October" year="2018"/>
            <abstract>
              <t>This memo provides guidelines for authors and reviewers of specifications containing YANG modules. Recommendations and procedures are defined, which are intended to increase interoperability and usability of Network Configuration Protocol (NETCONF) and RESTCONF protocol implementations that utilize YANG modules. This document obsoletes RFC 6087.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="216"/>
          <seriesInfo name="RFC" value="8407"/>
          <seriesInfo name="DOI" value="10.17487/RFC8407"/>
        </reference>
        <!-- YANG guidelines -->
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
        <!-- rfc2119 update -->
    </references>
      <references>
        <name>Informative References</name>
      </references>
    </references>
  </back>
</rfc>
