<?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-ietf-netmod-yang-module-filename-06" category="std" consensus="true" updates="6020, 7950, I-D.ietf-netmod-rfc8407bis" ipr="trust200902" obsoletes="" submissionType="IETF" xml:lang="en" tocInclude="true" symRefs="true" sortRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.30.2 -->
  <front>
    <title abbrev="YANG module file name convention">
        YANG module file name convention
    </title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-netmod-yang-module-filename-06"/>
    <author fullname="Per Andersson" initials="P." surname="Andersson">
      <organization>Ionio 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>
      <t>
        This documents updates RFCs 6020, 7950, and
        draft-ietf-netmod-rfc8407bis.
      </t>
    </abstract>
  </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="RFC6020" format="default"/>,
        <xref target="RFC7950" format="default"/>, and
        <xref target="I-D.ietf-netmod-rfc8407bis" 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 numbered="true" toc="default">
        <name>Terminology</name>
        <t>
          The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
          NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
          "MAY", and "OPTIONAL" in this document are to be interpreted as
          described in BCP 14 <xref target="RFC2119" format="default"/> <xref target="RFC8174" format="default"/>
          when, and only when, they appear in all capitals, as shown here.
        </t>
      </section>
      <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 conveys additional 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 module's
          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>
      </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="I-D.ietf-netmod-rfc8407bis" format="default"/>.
      </t>
      <t>
        If a revision has an associated YANG semantic version (ysv:version)
        then it MAY use the YANG semantic version 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]['#' ysv:version]]
        ( '.yang' / '.yin' )

          ]]></artwork>
      <t>
        E.g., acme-router-module@2024-05-15.yang or
        acme‑router‑module#2.0.3.yang.
      </t>
      <t>
        In short, the YANG semantic version file name scheme is recommended in
        order to simplify for module consumers, i.e. to convey compatibility
        status at a glance without needing to read the module.
      </t>
      <t>
        YANG module (or submodule) files MAY be identified using either
        revision-date or YANG semantic version (ysv:version).
      </t>
      <t>
        If the YANG module (or submodule) has an associated YANG semantic
        version (ysv:version), then a file name that use the YANG semantic
        version MUST be used. In addition, a file with the revision date in
        the file name MAY be created as well.
      </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 numbered="true" toc="default">
        <name>Known incompatibilities</name>
        <t>
          There are currently no known publicly available tools that support
          the YANG semantic version file name schema. There are known
          proprietary tooling that already uses the file name schema presented
          in this document.
        </t>
        <t>
          At the IETF 119 Hackathon, there was a project that investigated
          the feasibility to modify popular YANG tooling to support the proposed
          schema. There was a successful attempt to modify pyang to support the
          file name schema and also "recommended-min" previously included in
          <xref target="I-D.ietf-netmod-yang-module-versioning" format="default"/>. Furthermore,
          there were efforts in researching yanger and libyang to support the
          schema, but the hackathon ended before these projects could be
          concluded.
        </t>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
        The "YANG Module Names" Registry need to support YANG modules
        with both the existing file name convention and the file name
        convention defined in this document.
      </t>
      <t>
        The registry MUST create a file with a YANG semantic version if the
        YANG module (or submodule) has an associated YANG semantic version
        (ysv:version). The registry MUST also create a file with the YANG
        module using a file name with the revision date. It MUST be ensured
        that the files' contents are identical.
      </t>
    </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-yang-module-versioning.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang-semver.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-rfc8407bis.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="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>
    <section numbered="false" toc="default">
      <name>Acknowledgements</name>
      <t>
        The author would like to thank Joe Clarke, Reshad Rahman, and
        Mahesh Jethanandani for their excellent technical reviews, support,
        and guidance.
      </t>
    </section>
  </back>
</rfc>
