diff --git a/yang-semver/draft-ietf-netmod-yang-semver.txt b/yang-semver/draft-ietf-netmod-yang-semver.txt index fc46b69..368214a 100644 --- a/yang-semver/draft-ietf-netmod-yang-semver.txt +++ b/yang-semver/draft-ietf-netmod-yang-semver.txt @@ -6,7 +6,7 @@ Network Working Group B. Claise Internet-Draft Huawei Updates: 8407 (if approved) J. Clarke, Ed. Intended status: Standards Track R. Rahman -Expires: 25 August 2021 R. Wilton, Ed. +Expires: 4 September 2021 R. Wilton, Ed. Cisco Systems, Inc. B. Lengyel Ericsson @@ -14,7 +14,7 @@ Expires: 25 August 2021 R. Wilton, Ed. Nokia K. D'Souza AT&T - 21 February 2021 + 3 March 2021 YANG Semantic Versioning @@ -42,7 +42,7 @@ Status of This Memo time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on 25 August 2021. + This Internet-Draft will expire on 4 September 2021. Copyright Notice @@ -53,9 +53,9 @@ Copyright Notice -Claise, et al. Expires 25 August 2021 [Page 1] +Claise, et al. Expires 4 September 2021 [Page 1] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 This document is subject to BCP 78 and the IETF Trust's Legal @@ -109,9 +109,9 @@ Table of Contents -Claise, et al. Expires 25 August 2021 [Page 2] +Claise, et al. Expires 4 September 2021 [Page 2] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 provide additional context or an additional way to refer to a @@ -165,9 +165,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 3] +Claise, et al. Expires 4 September 2021 [Page 3] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 * COMPAT, if it is specified, MUST be either the literal string @@ -221,9 +221,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 4] +Claise, et al. Expires 4 September 2021 [Page 4] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 * If updates are always restricted to the latest revision of the @@ -277,9 +277,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 5] +Claise, et al. Expires 4 September 2021 [Page 5] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 significant whitespace changes (e.g. realigning description @@ -333,9 +333,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 6] +Claise, et al. Expires 4 September 2021 [Page 6] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 0.1.0 @@ -389,9 +389,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 7] +Claise, et al. Expires 4 September 2021 [Page 7] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 1.2.1_non_compatible - backport NBC fix, changing "baz" to "bar" @@ -445,9 +445,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 8] +Claise, et al. Expires 4 September 2021 [Page 8] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 3. An artifact author MAY choose to skip version numbers. That is, @@ -501,9 +501,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 9] +Claise, et al. Expires 4 September 2021 [Page 9] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 module example-versioned-module { @@ -557,9 +557,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 10] +Claise, et al. Expires 4 September 2021 [Page 10] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 revision 2017-04-03 { @@ -613,9 +613,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 11] +Claise, et al. Expires 4 September 2021 [Page 11] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 import example-module { @@ -669,9 +669,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 12] +Claise, et al. Expires 4 September 2021 [Page 12] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 3.0.0-202007.rc.1 @@ -725,9 +725,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 13] +Claise, et al. Expires 4 September 2021 [Page 13] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 Net new module development within the IETF SHOULD begin with the 0 @@ -781,9 +781,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 14] +Claise, et al. Expires 4 September 2021 [Page 14] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 "IETF NETMOD (Network Modeling) Working Group"; @@ -837,9 +837,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 15] +Claise, et al. Expires 4 September 2021 [Page 15] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 reference @@ -893,9 +893,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 16] +Claise, et al. Expires 4 September 2021 [Page 16] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 * Rob Wilton @@ -949,9 +949,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 17] +Claise, et al. Expires 4 September 2021 [Page 17] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 Note: For IANA maintained YANG modules that have already been @@ -1005,9 +1005,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 18] +Claise, et al. Expires 4 September 2021 [Page 18] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 [I-D.clacla-netmod-yang-model-update] @@ -1061,9 +1061,9 @@ Appendix A. Example IETF Module Development -Claise, et al. Expires 25 August 2021 [Page 19] +Claise, et al. Expires 4 September 2021 [Page 19] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 0.0.1-draft-jdoe-netmod-example-module-00 @@ -1117,9 +1117,9 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 20] +Claise, et al. Expires 4 September 2021 [Page 20] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 The draft is ratified, and the new module version becomes 1.1.0. @@ -1173,9 +1173,9 @@ Authors' Addresses -Claise, et al. Expires 25 August 2021 [Page 21] +Claise, et al. Expires 4 September 2021 [Page 21] -Internet-Draft YANG Semver February 2021 +Internet-Draft YANG Semver March 2021 Kevin D'Souza @@ -1229,4 +1229,4 @@ Internet-Draft YANG Semver February 2021 -Claise, et al. Expires 25 August 2021 [Page 22] +Claise, et al. Expires 4 September 2021 [Page 22] diff --git a/yang-semver/draft-ietf-netmod-yang-semver.xml b/yang-semver/draft-ietf-netmod-yang-semver.xml old mode 100755 new mode 100644 index b34522a..bffab83 --- a/yang-semver/draft-ietf-netmod-yang-semver.xml +++ b/yang-semver/draft-ietf-netmod-yang-semver.xml @@ -1,10 +1,9 @@ - - - + + + YANG Semantic Versioning - + Huawei @@ -13,7 +12,6 @@ benoit.claise@huawei.com - Cisco Systems, Inc.
@@ -27,7 +25,6 @@ jclarke@cisco.com
- Cisco Systems, Inc. @@ -36,7 +33,6 @@ rrahman@cisco.com - Cisco Systems, Inc. @@ -45,7 +41,6 @@ rwilton@cisco.com - Ericsson
@@ -58,7 +53,6 @@ balazs.lengyel@ericsson.com
- Nokia @@ -67,7 +61,6 @@ jason.sterne@nokia.com - AT&T
@@ -77,13 +70,10 @@ NJ United States of America - + kd6913@att.com
- - - This document specifies a scheme and guidelines for applying a modified set of @@ -92,147 +82,138 @@
-
+
+ Introduction - + puts forth a number of concepts relating to modified rules for updating modules, a means to signal when a new revision of a module has non-backwards-compatible (NBC) changes compared to its previous revision, and a versioning scheme that uses the revision history as a lineage for determining from where a specific revision of a YANG - module is derived. Additionally, section 3.3 of + module is derived. Additionally, section 3.3 of defines a revision label which can be used as an overlay or alias to provide additional context or an additional way to refer to a specific revision. - - This document defines a revision-label scheme that uses modified + This document defines a revision-label scheme that uses modified rules for YANG artifacts - (i.e., YANG modules and YANG packages + (i.e., YANG modules and YANG packages ) as well as the revision label definition for using this scheme. The goal of this is to add a human readable version label that provides compatibility information for the YANG artifact without one needing to compare or parse its body. The label and rules defined herein represent the RECOMMENDED revision label scheme for IETF YANG artifacts. -
- -
- 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 - +
+
+ Terminology and Conventions + 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 + when, and only when, they appear in all capitals, as shown here. - Additionally, this document uses the following terminology: - - YANG artifact: YANG modules, YANG packages - + Additionally, this document uses the following terminology: + +
    +
  • YANG artifact: YANG modules, YANG packages + , and YANG schema elements are examples of YANG artifacts - for the purposes of this document. - - -
- -
- This section defines YANG Semantic Versioning, explains how it is + for the purposes of this document. + +
+
+ YANG Semantic Versioning + This section defines YANG Semantic Versioning, explains how it is used with YANG artifacts, and the rules associated with changing an artifact's semantic version number when its contents are updated. - -
- YANG artifacts that employ semantic versioning as defined in this document MUST use a version string (e.g., in revision-label +
+ YANG Semantic Versioning Pattern + YANG artifacts that employ semantic versioning as defined in this document MUST use a version string (e.g., in revision-label or as a package version) that corresponds to the following pattern: X.Y.Z_COMPAT. Where: - - X, Y and Z are mandatory non-negative integers that are each less than 2147483647 (i.e., the maximum signed 32-bit integer value) and MUST NOT contain leading zeroes - The '.' is a literal period (ASCII character 0x2e) - The '_' is an optional single literal underscore (ASCII character 0x5f) and MUST only present if the following COMPAT element is included - COMPAT, if it is specified, MUST be either the literal string "compatible" or the literal string "non_compatible" - - - - Additionally, + +
    +
  • X, Y and Z are mandatory non-negative integers that are each less than 2147483647 (i.e., the maximum signed 32-bit integer value) and MUST NOT contain leading zeroes
  • +
  • The '.' is a literal period (ASCII character 0x2e)
  • +
  • The '_' is an optional single literal underscore (ASCII character 0x5f) and MUST only present if the following COMPAT element is included
  • +
  • COMPAT, if it is specified, MUST be either the literal string "compatible" or the literal string "non_compatible"
  • +
+ Additionally, defines two specific types of metadata that may be appended to a semantic version string. Pre-release metadata MAY be appended to a semver string after a trailing '-' character. Build metadata MAY be appended after a trailing '+' character. If both pre-release and build metadata are present, then build metadata MUST follow pre-release metadata. While build metadata MUST be ignored by YANG semver parsers, pre-release metadata MUST be used - during module development and MUST be considered base on + during module development and MUST be considered base on . Both pre-release and build metadata are allowed in order - to support all of the - rules. Thus, a version lineage that follows strict + to support all of the + rules. Thus, a version lineage that follows strict rules is allowed for a YANG artifact. - -To signal the use of this versioning scheme, modules MUST set the revision-label-scheme extension as defined in - + To signal the use of this versioning scheme, modules MUST set the revision-label-scheme extension as defined in + to the identity "yang-semver". That identity value is defined in the ietf-yang-semver module below. - -Additionally, this ietf-yang-semver module defines a typedef that formally specifies the syntax of the YANG semver version string. -
- -
-This document defines the YANG semantic versioning scheme that is used for YANG + Additionally, this ietf-yang-semver module defines a typedef that formally specifies the syntax of the YANG semver version string. +
+
+ Semantic Versioning Scheme for YANG Artifacts + This document defines the YANG semantic versioning scheme that is used for YANG artifacts that employ the YANG semver label. The versioning scheme has the following properties: - - The YANG semantic versioning scheme is extended from version - 2.0.0 of the semantic versioning scheme defined at semver.org + +
    +
  • The YANG semantic versioning scheme is extended from version + 2.0.0 of the semantic versioning scheme defined at semver.org to cover the additional requirements for the management of YANG artifact lifecyles that cannot be addressed using - the semver.org 2.0.0 versioning scheme alone. - - Unlike the + the semver.org 2.0.0 versioning scheme alone.
  • +
  • Unlike the versioning scheme, the YANG semantic versioning scheme supports updates to older versions of YANG artifacts, to allow for bug fixes and enhancements to artifact versions that are not the latest. However, it does not provide for the unlimited branching and updating of older revisions which are documented by the general rules in - -. - -YANG artifacts that follow the + +.
  • +
  • YANG artifacts that follow the versioning scheme are fully compatible with implementations that understand - the YANG semantic versioning scheme defined in this document. - -If updates are always restricted to the latest revision + the YANG semantic versioning scheme defined in this document.
  • +
  • If updates are always restricted to the latest revision of the artifact only, then the version numbers used by the YANG semantic versioning scheme are exactly the same as those defined - by the - versioning scheme. - - - -Every YANG module versioned using the YANG semantic versioning + by the + versioning scheme.
  • +
+ Every YANG module versioned using the YANG semantic versioning scheme specifies the module's semantic version number as the argument to the 'rev:revision-label' statement. - -Because the rules put forth in + Because the rules put forth in are designed to work well with existing versions of YANG and allow for artifact authors to migrate to this scheme, it is not expected that all revisions of a given YANG artifact will have a semantic version label. For example, the first revision of a module may have been produced before this scheme was available. - -YANG packages that make use of this semantic versioning scheme will have their semantic version + YANG packages that make use of this semantic versioning scheme will have their semantic version as the value of the "revision_label" property. - - + As stated above, the YANG semver version number is expressed as a string of the form: 'X.Y.Z_COMPAT'; where X, Y, and Z each represent non-negative integers smaller than 2147483647 without leading zeroes, and _COMPAT represents an optional suffix of either "_compatible" or "_non_compatible". - -'X' is the MAJOR version. Changes in the MAJOR version number + +
    +
  • 'X' is the MAJOR version. Changes in the MAJOR version number indicate changes that are non-backwards-compatible to versions - with a lower MAJOR version number. - -'Y' is the MINOR version. Changes in the MINOR version number + with a lower MAJOR version number.
  • +
  • 'Y' is the MINOR version. Changes in the MINOR version number indicate changes that are backwards-compatible to versions with the same MAJOR version number, but a lower MINOR version number - and no PATCH "_compatible" or "_non_compatible" modifier. - -'Z_COMPAT' is the PATCH version and modifier. Changes in the PATCH + and no PATCH "_compatible" or "_non_compatible" modifier.
  • +
  • + 'Z_COMPAT' is the PATCH version and modifier. Changes in the PATCH version number can indicate editorial, backwards-compatible, or non-backwards-compatible changes relative to versions with the same MAJOR and MINOR version numbers, but lower PATCH version number, depending on what form modifier "_COMPAT" takes: - - If the modifier string is absent, the change represents an + +
      +
    • If the modifier string is absent, the change represents an editorial change. An editorial change is defined to be a change in the YANG artifact's content that does not affect the semantic meaning or functionality provided by the artifact in any way. Some examples include correcting a spelling mistake in the @@ -240,28 +221,27 @@ realigning description statements, or changing indendation), or changes to YANG comments. Note: restructuring how a module uses, or does not use, submodules is treated as an editorial level change on the condition that there is no change in the - module's semantic behavior due to the restructuring. - If, however, the modifier string is present, the meaning is described below: - "_compatible" - the change represents a backwards-compatible change - "_non_compatible" - the change represents a non-backwards-compatible change - - - - -The YANG artifact name and YANG semantic version number uniquely + module's semantic behavior due to the restructuring.
    • +
    • If, however, the modifier string is present, the meaning is described below:
    • +
    • "_compatible" - the change represents a backwards-compatible change
    • +
    • "_non_compatible" - the change represents a non-backwards-compatible change
    • +
    +
  • +
+ The YANG artifact name and YANG semantic version number uniquely identify a revision of said artifact. There MUST NOT be multiple instances of a YANG artifact definition with the same name and YANG semantic version number but different content (and in the case of modules, different revision dates). -There MUST NOT be multiple versions of a YANG artifact that have + There MUST NOT be multiple versions of a YANG artifact that have the same MAJOR, MINOR and PATCH version numbers, but different patch modifier strings. E.g., artifact version "1.2.3_non_compatible" MUST NOT be defined if artifact version "1.2.3" has already been defined. -
-The following diagram and explanation illustrates how YANG semantic version numbers work. -
-Example YANG semantic version numbers for an example artifact: - +
+ Examples for YANG semantic version numbers + The following diagram and explanation illustrates how YANG semantic version numbers work. + Example YANG semantic version numbers for an example artifact: + -
-Assume the tree diagram above illustrates how an example YANG module's version +]]> + Assume the tree diagram above illustrates how an example YANG module's version history might evolve. For example, the tree might represent the following changes, listed in chronological order from oldest revision to newest: - - 0.1.0 - first beta module version - 0.2.0 - second beta module version (with NBC changes) - 1.0.0 - first release (may have NBC changes from 0.2.0) - 1.1.0 - added new functionality, leaf "foo" (BC) - 1.2.0 - added new functionality, leaf "baz" (BC) - 1.3.0 - improve existing functionality, added leaf "foo-64" (BC) - 1.3.1 - improve description wording for "foo-64" (Editorial) - 1.1.1_compatible - backport "foo-64" leaf to 1.1.x to avoid implementing "baz" from 1.2.0 (BC) - 2.0.0 - change existing model for performance reasons, e.g. re-key list (NBC) - 1.1.2_non_compatible - NBC point bug fix, not required in 2.0.0 due to model changes (NBC) - 3.0.0 - NBC bugfix, rename "baz" to "bar"; also add new BC leaf "wibble"; (NBC) - 1.2.1_non_compatible - backport NBC fix, changing "baz" to "bar" - 1.2.2_non_compatible - backport "wibble". This is a BC change but "non_compatible" modifier is sticky. - 3.1.0 - introduce new leaf "wobble" (BC) - -The partial ordering relationships based on the semantic versioning numbers can be defined as follows: - - 1.0.0 < 1.1.0 < 1.2.0 < 1.3.0 < 2.0.0 < 3.0.0 < 3.1.0 - 1.0.0 < 1.1.0 < 1.1.1_compatible < 1.1.2_non_compatible - 1.0.0 < 1.1.0 < 1.2.0 < 1.2.1_non_compatible < 1.2.2_non_compatible - +
    +
  • 0.1.0 - first beta module version
  • +
  • 0.2.0 - second beta module version (with NBC changes)
  • +
  • 1.0.0 - first release (may have NBC changes from 0.2.0)
  • +
  • 1.1.0 - added new functionality, leaf "foo" (BC)
  • +
  • 1.2.0 - added new functionality, leaf "baz" (BC)
  • +
  • 1.3.0 - improve existing functionality, added leaf "foo-64" (BC)
  • +
  • 1.3.1 - improve description wording for "foo-64" (Editorial)
  • +
  • 1.1.1_compatible - backport "foo-64" leaf to 1.1.x to avoid implementing "baz" from 1.2.0 (BC)
  • +
  • 2.0.0 - change existing model for performance reasons, e.g. re-key list (NBC)
  • +
  • 1.1.2_non_compatible - NBC point bug fix, not required in 2.0.0 due to model changes (NBC)
  • +
  • 3.0.0 - NBC bugfix, rename "baz" to "bar"; also add new BC leaf "wibble"; (NBC)
  • +
  • 1.2.1_non_compatible - backport NBC fix, changing "baz" to "bar"
  • +
  • 1.2.2_non_compatible - backport "wibble". This is a BC change but "non_compatible" modifier is sticky.
  • +
  • 3.1.0 - introduce new leaf "wobble" (BC)
  • +
+ The partial ordering relationships based on the semantic versioning numbers can be defined as follows: -There is no ordering relationship between 1.1.1_non_compatible and either 1.2.0 or +
    +
  • 1.0.0 < 1.1.0 < 1.2.0 < 1.3.0 < 2.0.0 < 3.0.0 < 3.1.0
  • +
  • 1.0.0 < 1.1.0 < 1.1.1_compatible < 1.1.2_non_compatible
  • +
  • 1.0.0 < 1.1.0 < 1.2.0 < 1.2.1_non_compatible < 1.2.2_non_compatible
  • +
+ There is no ordering relationship between 1.1.1_non_compatible and either 1.2.0 or 1.2.1_non_compatible, except that they share the common ancestor of 1.1.0. -Looking at the version number alone, the module definition in + Looking at the version number alone, the module definition in 2.0.0 does not necessarily contain the contents of 1.3.0. However, the module revision history in 2.0.0 may well indicate that it was edited from module version 1.3.0. -
-
- -
-When a new revision of an artifact is produced, then the following +
+
+
+ YANG Semantic Version Update Rules + When a new revision of an artifact is produced, then the following rules define how the YANG semantic version number for the new artifact revision is calculated, based on the changes between the two artifact revisions, and the YANG semantic version number of the base artifact revision from which the changes are derived: - - - -If an artifact is being updated in a non-backwards-compatible +
  1. If an artifact is being updated in a non-backwards-compatible way, then the artifact version "X.Y.Z[_compatible|_non_compatible]" MUST be updated to "X+1.0.0" unless that artifact version has already been defined with different content, in which case the artifact version "X.Y.Z+1_non_compatible" MUST - be used instead. - -Under some circumstances (e.g., to avoid adding a "_compatible" modifier) an + be used instead.
  2. +
  3. Under some circumstances (e.g., to avoid adding a "_compatible" modifier) an artifact author MAY also update the MAJOR version when the only changes are backwards-compatible. This is where tooling is important to highlight all changes. Because, while avoiding the "_compatible" and "_non_compatible" modifiers have a clear advantage, bumping a MAJOR version when changes are entirely backwards-compatible may confuse end - users. - -An artifact author MAY choose to skip version numbers. That is, an artifact's revision history + users.
  4. +
  5. An artifact author MAY choose to skip version numbers. That is, an artifact's revision history can include 1.0.0, 1.1.0, and 1.3.0 where 1.2.0 is skipped. Note that doing so has an impact - when importing modules by revision-or-derived. See + when importing modules by revision-or-derived. See for more details - on importing modules with revision-label version gaps. - -If an artifact is being updated in a backwards-compatible way, + on importing modules with revision-label version gaps.
  6. +
  7. + If an artifact is being updated in a backwards-compatible way, then the next version number depends on the format of the current version number: - - "X.Y.Z" - the artifact version MUST be updated to "X.Y+1.0", + +
    1. "X.Y.Z" - the artifact version MUST be updated to "X.Y+1.0", unless that artifact version has already been defined with different content, when the artifact version MUST be updated to - "X.Y.Z+1_compatible"" instead. - "X.Y.Z_compatible" - the artifact version MUST be updated to - "X.Y.Z+1_compatible". - "X.Y.Z_non_compatible" - the artifact version MUST be updated to - "X.Y.Z+1_non_compatible". - - - -If an artifact is being updated in an editorial way, then the next + "X.Y.Z+1_compatible"" instead.
    2. +
    3. "X.Y.Z_compatible" - the artifact version MUST be updated to + "X.Y.Z+1_compatible".
    4. +
    5. "X.Y.Z_non_compatible" - the artifact version MUST be updated to + "X.Y.Z+1_non_compatible".
    6. +
    +
  8. +
  9. + If an artifact is being updated in an editorial way, then the next version number depends on the format of the current version number: - - "X.Y.Z" - the artifact version MUST be updated to "X.Y.Z+1" - "X.Y.Z_compatible" - the artifact version MUST be updated to - "X.Y.Z+1_compatible". - "X.Y.Z_non_compatible" - the artifact version MUST be updated to - "X.Y.Z+1_non_compatible". - - - -YANG artifact semantic version numbers beginning with 0, i.e + +
    1. "X.Y.Z" - the artifact version MUST be updated to "X.Y.Z+1"
    2. +
    3. "X.Y.Z_compatible" - the artifact version MUST be updated to + "X.Y.Z+1_compatible".
    4. +
    5. "X.Y.Z_non_compatible" - the artifact version MUST be updated to + "X.Y.Z+1_non_compatible".
    6. +
    +
  10. +
  11. YANG artifact semantic version numbers beginning with 0, i.e "0.X.Y" are regarded as beta definitions and need not follow the rules above. Either the MINOR or PATCH version numbers may be updated, regardless of whether the changes are - non-backwards-compatible, backwards-compatible, or editorial. See + non-backwards-compatible, backwards-compatible, or editorial. See for - more details on using this notation during module development. - - -
-
-
-Below is a sample YANG module that uses the YANG semver revision label + more details on using this notation during module development. + +
+
+ Examples of the YANG Semver Label +
+ Example Module Using YANG Semver + Below is a sample YANG module that uses the YANG semver revision label based on the rules defined in this document. - -
- + -
-
-
-Below is an example YANG package that uses the semver revision label based on +]]> +
+
+ Example of Package Using YANG Semver + Below is an example YANG package that uses the semver revision label based on the rules defined in this document. - -
- + -
-
-
-
- -
- - +]]> +
+
+
+
+ Import Module by Semantic Version + + allows for imports to be done based on a module or a derived revision of a module. The rev:revision-or-derived statement can specify either a revision date or a revision label. When importing by @@ -497,32 +466,26 @@ rev:revision-or-derived. In so, any module which has that semver label as its latest revision label or has that label in its revision history can be used to satisfy the import requirement. For example: - -
- + -
- -Note: the import lookup does not stop +]]> + Note: the import lookup does not stop when a non-backward-compatible change is encountered. That is, if module B imports a module A at or derived from version 2.0.0, resolving that import will pass through a revision of module A with version 2.1.0_non_compatible in order to determine if the present instance of module A derives from 2.0.0. - -If an import by revision-or-derived cannot locate the specified revision-label in a given module's revision history, that import will fail. This is + If an import by revision-or-derived cannot locate the specified revision-label in a given module's revision history, that import will fail. This is noted in the case of version gaps. That is, if a module's history includes 1.0.0, 1.1.0, and 1.3.0, an import from revision-or-derived at 1.2.0 will be unable to locate the specified revision entry and thus the import cannot be satisfied. -
- -
-This section and the IETF-specific sub-section below provides YANG semver-specific +
+
+ Guidelines for Using Semver During Module Development + This section and the IETF-specific sub-section below provides YANG semver-specific guidelines to consider when developing new YANG modules. As such this section - updates + updates . - -Development of a brand new YANG module outside of the IETF that uses YANG semver as its + Development of a brand new YANG module outside of the IETF that uses YANG semver as its revision-label scheme SHOULD begin with a 0 for the MAJOR version component. This allows the module to disregard strict semver rules with respect to non-backwards-compatible changes @@ -534,21 +497,19 @@ MAJOR version component of 1 when the module is nearing initial release (e.g., a module's revision label may transition from 0.3.0 to 1.0.0-beta.1 to indicate it is more mature and ready for testing). - -When using pre-release notation, the format MUST include at least one alphabetic + When using pre-release notation, the format MUST include at least one alphabetic component and MUST end with a '.' and then one or more digits. These alphanumeric components will be used when deciding pre-release precedence. The following are examples of valid pre-release versions - -1.0.0-alpha.1 -1.0.0-alpha.3 -2.1.0-beta.42 -3.0.0-202007.rc.1 - - -When developing a new revision of an existing module using the YANG +
    +
  • 1.0.0-alpha.1
  • +
  • 1.0.0-alpha.3
  • +
  • 2.1.0-beta.42
  • +
  • 3.0.0-202007.rc.1
  • +
+ When developing a new revision of an existing module using the YANG semver revision-label scheme, the intended target semver version MUST be used along with pre-release notation. For example, if a released module which has a current revision-label of 1.0.0 is being modified @@ -573,9 +534,9 @@ be unique throughout its entire lifecycle (e.g., the first pre-release version might be 2.0.0-202005-alpha.1 if keeping the same year and month notation mentioned above). - -
- [TODO: Describe precedence considering there could be changes during development and parallel development tracks.] -
- -
-All publish IETF modules MUST use YANG semantic versions for their revision-labels. For IETF YANG modules that have already been +
+
+ YANG Semver in IETF Modules + All publish IETF modules MUST use YANG semantic versions for their revision-labels. For IETF YANG modules that have already been published, revision labels MUST be retrospectively applied to all existing revisions when the next new revision is created, starting at version "1.0.0" for the initial published revision, and then incrementing according to the YANG Semver version rules specified in - + . - -Net new module development within the IETF SHOULD begin with the 0 MAJOR number scheme as described above. + Net new module development within the IETF SHOULD begin with the 0 MAJOR number scheme as described above. When revising an existing IETF module, the revision-label MUST use the target (i.e., intended) MAJOR and MINOR version components with a 0 PATCH version component. If the intended ratified release will be non-backward-compatible with the current ratified release, the MINOR version component MUST be 0. - -All IETF modules in development MUST use the whole document name as a pre-release version string, + All IETF modules in development MUST use the whole document name as a pre-release version string, including the current document revision. For example, if a module which is currently released at version 1.0.0 is being revised to include non-backwards-compatible changes in draft-user-netmod-foo, its @@ -615,30 +574,24 @@ version for initial module development (where MINOR and PATCH can change), appending the draft name as a pre-release component helps to ensure uniqueness when there are perhaps multiple, parallel efforts creating the same module. - -If a module is being revised and the original module never had a + If a module is being revised and the original module never had a revision-label (i.e., you wish to start using YANG semver in future module revisions), choose a semver value that makes the most sense based on the module's history. For example, if a module started - out in the pre-NMDA ( + out in the pre-NMDA ( ) world, and then had NMDA support added without removing any legacy "state" branches -- and you are looking to add additional new features -- a sensible choice for the target YANG semver would be 1.2.0 (since 1.0.0 would have been the initial, pre-NMDA release, and 1.1.0 would have been the NMDA revision). - -See + See for a detailed example of IETF pre-release versions. -
-
- -
-This YANG module contains the typedef for the YANG semantic version. - -
- - file "ietf-yang-semver@2020-06-30.yang" +
+ +
+ YANG Module + This YANG module contains the typedef for the YANG semantic version. + - ]]> - - -
- -
-This document grew out of the YANG module versioning design team + ]]> +
+
+ Contributors + This document grew out of the YANG module versioning design team that started after IETF 101. The design team consists of the following members whom have worked on the YANG versioning project: - - -Balazs Lengyel -Benoit Claise -Ebben Aries -Jason Sterne -Joe Clarke -Juergen Schoenwaelder -Mahesh Jethanandani -Michael (Wangzitao) -Qin Wu -Reshad Rahman -Rob Wilton - - - -The initial revision of this document was refactored and built - upon +
    +
  • Balazs Lengyel
  • +
  • Benoit Claise
  • +
  • Ebben Aries
  • +
  • Jason Sterne
  • +
  • Joe Clarke
  • +
  • Juergen Schoenwaelder
  • +
  • Mahesh Jethanandani
  • +
  • Michael (Wangzitao)
  • +
  • Qin Wu
  • +
  • Reshad Rahman
  • +
  • Rob Wilton
  • +
+ The initial revision of this document was refactored and built + upon . -Discussons on the use of Semver for YANG versioning has been held - with authors of the OpenConfig YANG models based on their own + Discussons on the use of Semver for YANG versioning has been held + with authors of the OpenConfig YANG models based on their own . We would like thank both Anees Shaikh and Rob Shakir for their input into this problem space. -
- -
-The document does not define any new protocol or data model. There +
+
+ Security Considerations + The document does not define any new protocol or data model. There are no security impacts. -
-
-
-The following YANG module is requested to be registred in the +
+
+ IANA Considerations +
+ YANG Module Registrations + The following YANG module is requested to be registred in the "IANA Module Names" registry: - - - -Name: ietf-yang-semver -XML Namespace: urn:ietf:params:xml:ns:yang:ietf-yang-semver -Prefix: yangver -Reference: [RFCXXXX] - - -
-
-Note for IANA (to be removed by the RFC editor): Please check that the +
    +
  • Name: ietf-yang-semver
  • +
  • XML Namespace: urn:ietf:params:xml:ns:yang:ietf-yang-semver
  • +
  • Prefix: yangver
  • +
  • Reference: [RFCXXXX]
  • +
+
+
+ Guidance for YANG Semver in IANA maintained YANG modules + Note for IANA (to be removed by the RFC editor): Please check that the registries and IANA YANG modules are referenced in the appropriate way. - -IANA is responsible for maintaining and versioning some YANG - modules, e.g., iana-if-types.yang + IANA is responsible for maintaining and versioning some YANG + modules, e.g., iana-if-types.yang and - iana-routing-types.yang + iana-routing-types.yang . - -In addition to following the rules specified in the IANA - Considerations section of + In addition to following the rules specified in the IANA + Considerations section of , IANA maintained YANG modules MUST also include a YANG Semver revision label for all - new revisions, as defined in + new revisions, as defined in . - -The YANG Semver version associated with the new revision MUST - follow the rules defined in + The YANG Semver version associated with the new revision MUST + follow the rules defined in . - -Note: For IANA maintained YANG modules that have already been + Note: For IANA maintained YANG modules that have already been published, revision labels MUST be retrospectively applied to all existing revisions when the next new revision is created, starting at version "1.0.0" for the initial published revision, and then incrementing according to the YANG Semver version rules specified in - + . - -Most changes to IANA maintained YANG modules are expected to be + Most changes to IANA maintained YANG modules are expected to be backwards-compatible changes and classified as MINOR version changes. The PATCH version may be incremented instead when only editorial changes are made, and the MAJOR version would be incremented if non-backwards-compatible major changes are made. - -Given that IANA maintained YANG modules are versioned with a + Given that IANA maintained YANG modules are versioned with a linear history, it is anticipated that it should not be necessary to use the "_compatible" or "_non_compatible" modifiers to the "Z_COMPAT" version element. -
-
- - - - - - - - - - - - - - - -Semantic Versioning for Openconfig Models - - - - - - -Semantic Versioning 2.0.0 - - - - - - -iana-if-type YANG Module - - - - - - -iana-routing-types YANG Module - - - - - - -
-Assume a new YANG module is being developed in the netmod working group in the IETF. +
+
+
+ + + References + + Normative References + + + + + + + Informative References + + + + + + Semantic Versioning for Openconfig Models + + + + + + + Semantic Versioning 2.0.0 + + + + + + + iana-if-type YANG Module + + + + + + + iana-routing-types YANG Module + + + + + + +
+ Example IETF Module Development + Assume a new YANG module is being developed in the netmod working group in the IETF. Initially, this module is being developed in an individual internet draft, draft-jdoe-netmod-example-module. The following represents the initial version tree (i.e., value of revision-label) of the module as it's being initially developed. -
-Version lineage for initial module development: - + Version lineage for initial module development: + -
- -At this point, development stabilizes, and the workgroup adopts the draft. Thus now the draft becomes +]]> + At this point, development stabilizes, and the workgroup adopts the draft. Thus now the draft becomes draft-ietf-netmod-example-module. The initial pre-release lineage continues as follows. - -
-Continued version lineage after adoption: - - + Continued version lineage after adoption: + -
- -At this point, the draft is ratified and becomes RFC12345 and the YANG module version number becomes 1.0.0. - -A time later, the module needs to be revised to add additional capabilities. Development will be done in a +]]> + At this point, the draft is ratified and becomes RFC12345 and the YANG module version number becomes 1.0.0. + A time later, the module needs to be revised to add additional capabilities. Development will be done in a backwards-compatible way. Two new individual drafts are proposed to go about adding the capabilities in different ways: draft-jdoe-netmod-exmod-enhancements and draft-jadoe-netmod-exmod-changes. These are initially developed in parallel with the following versions. - -
-Parallel development for next module revision: - - + Parallel development for next module revision: + -
- -At this point, the WG decides to merge some aspects of both and adopt the work in jadoe's draft +]]> + At this point, the WG decides to merge some aspects of both and adopt the work in jadoe's draft as draft-ietf-netmod-exmod-changes. A single version lineage continues. - -
- + -
- -The draft is ratified, and the new module version becomes 1.1.0. - -
-
+]]> + The draft is ratified, and the new module version becomes 1.1.0. + +