Spring changes the naming rules of version number: This is very friendly to non English speaking countries

Time:2021-1-25

If you want to change your destiny, change yourself first. This article has been publishedhttps://www.yourbatman.cnIncluded, including spring technology stack, mybatis, JVM, middleware and other small and beautifulspecial columnFor free learning. Pay attention to the official account.Bat’s Utopia】Break them one by one, master them in depth, and refuse to taste them.

Spring changes the naming rules of version number: This is very friendly to non English speaking countries

✍ preface

Hello, I’m your Batman.

I still remember that I saw an email from pivot in May this year. The general content is that spring changed the naming rules of the version number. At that time, it was in the spirit of collecting first, preparing to read it in the evening, and then, there was no then.

Until a few days ago, I suddenly saw an article entitled:Spring Data 2020.0.0The official release of the article, which reminds me of this matter, so I decided to write this article to record and share with you.

If you’ve been struggling with spring cloud’s version number naming, this article brings you the dawn

Spring changes the naming rules of version number: This is very friendly to non English speaking countries

✍ text

Spring cloud has been named for a long time. Before the formal start, brother a of management, health and support intends to explain the related terms in order to facilitate the understanding of this article.

Release Train

Release train: release train / release train. The train is no stranger to everyone. It has a remarkable feature:Scheduled departure. therestartIn the field of software, it is equivalent to the development of softwarePublishing
Spring changes the naming rules of version number: This is very friendly to non English speaking countries

Why release train mode?

When the company was still very small, the whole company might have only one software. The release of the version was very simple, there was nothing to coordinate, and the release was over.howeverOnce the company develops rapidly and becomes larger, there are tens or hundreds of core product functions, and different teams are responsible for each functional module. The cost of communication increases significantly. If you just don’t pay attention to the version, there will be all kinds of problems, which is easy to give people a sense of “chaos”.

These problems can be avoided to a great extent by using release train’s release mode. You can do this: you need to issue a release on the last day of each month (the exact release date) (similar to train departure), so you can take this time point as the deadline,ParticipatoryAll parties, including product manager, RD, QA, etc., communicate the requirements in advance, make plans, and make preparations for unified departure. During this period, if a team in the middle has problems and can’t keep up with the pace, pleaseGet off in time(the premise is to control the influence surface of getting off), do not affect the overall departure time.

Generally speaking: the train starts on time, and all parties should get on the train on time. If you can’t catch the train this time, please let me knowWait for the next train. In this way, the quality of software products can be ensuredContinuous iterationTo ensure the stability of the product, this is the release train release mode.

In the actual software products, it can be considered that the slightly larger software is continuously iterated according to this mode, such as IOS, maxos, MIUI, spring cloud and so on. These software versions have different naming methods, but they all follow certain rules

  • IOS 14、IOS 14.1、IOS14.1.1
  • macOS Mojave、macOS Sierra
  • Spring Cloud Greenwich、Spring Cloud Hoxton

Project Module

If a version issued according to release train mode represents a large product version number, then project module represents its internal module. Generally, a software product consists of N modules, with the latestSpring Data 2020.0.0Version, for example, contains multiple project module modules:

  • Spring Data Commons 2.4
  • Spring Data JDBC 2.1
  • Spring Data JPA 2.4
  • Spring Data MongoDB 3.1
  • Spring Data KeyValue 2.4
  • Spring Data LDAP 2.4
  • Spring Data Elasticsearch 4.1

Semantic Versioning

The semantic version number is called semantic version control specification (semver). It’s a set of version number rulesStandards / specifications, used to improve the confusion of software version number format, and by the way, unify the meaning of version number. The official homepage is:https://semver.org

Version number composition

The semver version number is mainly composed ofThere are three partsEach part is a nonnegative integer, and parts are separated by.separate:Major version number, minor version number and revision number(abbreviated asx.y.z)。 These three parts are explained (agreed) as follows:

  • Major version number: add 1 to the major version number only when making non downward compatible modifications or disruptive updates

    • Voice over: big change, violent change
  • Minor version number: in progressDownward compatibilityAdd 1 to minor version number when modifying or adding new compatibility features

    • Voice over: not much,commonlyIt’s down compatible. It is worth noting that: here refers to the general, some cases also exist incompatibility, the situation is also allowed, of course, can not be the main function incompatibility
  • Patch number: no new functions are added. Generally, fix bugs, optimize code, etc., and add 1 to the patch number

    • Voice over: This version number can be upgraded seamlessly

There are two points worth noting about these three parts

  1. All version numbers start from 0 (including major version number)

    1. Software with major version number zero (0. Y.z) is inInitial stage of developmentEverything can change at any time. Such a public API should not be considered a stable version
    2. The version number of 1.0.0 is used fordefinitionThe formation of public API. That is to say, from
  2. When the major version number is updated, the minor version number and the patch number should be reset to zero; when the minor version number is updated, the patch number should be reset to zero

Version number comparison

What’s the version number of this three-stageYou can compare the sizeYes. The order of comparison is as follows:Major version number, minor version number and patch number. give an example:4.3.0 < 5.0.0 < 5.0.3 < 5.1.0

Description: use.If separated, normal comparison (when string comparison) will not appear.2. > .10.What’s the problem

It’s worth noting that semantic versioning is only a standard, and it doesn’t provide implementation (such as version number comparison). Although it’s not complicated to implement one according to this rule, I suggest youDon’t do it yourselfAfter all, there are a lot of wheels in the community, in all kinds of languages. Why repeat them.

Calendar Versioning

Calendar version, referred to as Calver. Calver is not based on any number, it’s based on the projectDate of issueVersion control conventions for. Compared with the semantic version number, the calendar version number is more groundedvitalityBetter. Because the date is one-way forward, the version gets better over time.

Scheme category

There are a variety of calendar version schemes, which have been used by projects of various sizes for a long time. For Calver, its specification is very abstract. After all, release date is a very abstract concept.

Calver does not choose a single solution like “semantic version”, but introduces the standard terminology of developers

  • Yyyy: full name of the year. For example: 2020
  • YY: abbreviation of annual fee. For example: 20
  • Mm: abbreviation of month. For example: 1, 2, 3
  • DD: abbreviation of day. For example: 1, 2, 3

Similar to date formatting. Yes, you can increase the date at will, or even in any incremental format, but the standard format is recommended.

Spring changes the naming rules of version number

On April 30, 2020, the spring team announced that it would change the naming rules of the version number in its official website blog, which contains two parts:

  1. Release TrainVersion rule change
  2. Project ModuleVersion rule change

These changes will be in the futurenextIt’s reflected in the release version, such as usalreadyYou can see the version numbers named by the new rules are: Spring data 2020.0.0, spring data 2020.0.1

Release train version rule change

Spring has been following theAlphabetic orderTo sort the versions. For example, I’ll show you two typical projects that we are familiar with according to the release train. I’ll draw the icons as follows:

Spring Data

Release Train Date of issue
Spring Data Arora 2013-02
Spring Data Babbage 2013-09
Spring Data Codd 2014-02
Spring Data Dijkstra 2014-05
Spring Data Neumann 2020-05
Spring Data 2020.0.0 2020-10

Spring Cloud

Release Train Date of issue
Spring Cloud Angel 2015-06
Spring Cloud Brixton 2016-05
Spring Cloud Camden 2016-09
Spring Cloud Dalston 2017-04
Spring Cloud Hoxton 2019-11
Spring Cloud 2020.0.0-M4 2020-10

Spring changes the naming rules of version number: This is very friendly to non English speaking countries

Note: so far, the official version of spring cloud 2020 has not been officially released. It is expected to be officially launched before the end of November to support spring boot 2.4.0

Existing problems

As shown in the table above, there are the following problems in using alphabetic order as the version number:

  1. In alphabetical order, forNon EnglishCountries have certain thresholds that are hard to remember (for example, programmers in China)
  2. If the sort letter arrivesZIf you do, there will be naming problems
  3. The downward compatibility can not be reflected from the version number, which makes it difficult for users (who are going to upgrade) to make judgments and make risk estimates
  4. It’s very difficult to spell words (version numbers have to be copied, now it’s inefficient)
Problem solving (after change)

To solve these problems, spring uses theCalendar versionAnd the rules / formulas used areYYYY.MINOR.MICRO[-MODIFIER]The explanation of each part is as follows:

  • Yyyy: full name of the year. eg:2020
  • Minor: auxiliary version number (generally upgrade some non mainline functions), increasing from 0 in the current year
  • Micro: patch version number (usually fix some bugs), increasing from 0 in the current year
  • MODIFIER:Not required. Suffix, which is used to modify some key nodes, represented by these letters

    • M number: Milestone version, such as 2020.0.0-m1, 2020.0.0-m2
    • RC number: release candidate versions, such as 2020.0.0-rc1 and 2020.0.0-rc2
    • Snapshot: snapshot Version (no number after), such as 2020.0.0-snapshot
    • Everything: Official Version (can be used safely, equivalent to the previous XXX release), such as2020.0.0

Through the new version naming method, the problem caused by backward compatibility is solved (we can clearly know how backward compatibility is when we look at the version number), and there is no upper bound anxiety, and this sort is rightNon English speaking countriesVery friendly. Like it.
Spring changes the naming rules of version number: This is very friendly to non English speaking countries
Since then, for spring cloud, version h is the last version number named with English words, and the next version will beSpring Cloud 2020.0.0, which is expected to be officially released this month.

Project module version rule change

As for the version number of the project module, spring is earlier than its version number3.0.0.M1Version (2008) uses the “semantic version” rule for release management. You don’t need to make any changes, but spring officials think that since the release train has been modified this time, it’s better to adjust it together.

The version rule of project module Spirng adopts semantic versioning semantic version number specification. In addition, spring also hopes that developers can easily get familiar with this version number, so it has developed this template:MAJOR.MINOR.PATCH[-MODIFIER]. The first three parts will not be explained any more. Please see the above for detailsSemantic VersioningA description of. MODIFIER as like as two peas, the latter part of the Release keeps the same semantics as that of Train.

  • MODIFIER:Not required. Suffix, which is used to modify some key nodes, represented by these letters

    • M number: Milestone version, such as 2.4.0-m1 and 2.4.0-m2
    • RC number: release candidate versions, such as 2.4.0-rc1 and 2.4.0-rc2
    • Snapshot: snapshot Version (no number after), such as 2.4.0-snapshot
    • Everything: Official Version (can be used safely, equivalent to the previous XXX release), such as2.4.0

Generally speaking, this part of the rules has not changed much

Before the change After the change
3.0.0.M1 3.0.0-M1

Taking the latest released version of the spirit framework as an example, it applies the latest release rules:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>5.3.0</version>
    <!-- 5.2.0.RELEASE -->
</dependency>

Compared with the old and new version numbers, the biggest difference between the new rules is thatIt’s done .RELEASESo please pay attention when you write.

✍ summary

This time, spring makes the adjustment of version number rules to show more vitality. What I like to hear is that this name is good for us in the Chinese dynasty. After all, how many English words can you remember about SC? Now it’s time to write the version numberBlind writingAnd through the version numberIt’s very intuitiveIt is very convenient to know the current version of the old and new, so as to make relevant judgments / estimates.

In addition, before the deadline, spring boot 2.4.0 and spring framework 5.3.0 have been heavily released. In order to pave the way for the upcoming spring cloud 2020.0.0, the next few articles will elaborate on them, and you are welcome to continue to pay attention to them.

✔ Recommended reading:

♥ Follow your Batman ♥

Author Your Batman
Personal site www.yourbatman.cn
E-mail [email protected]
WeChat fsx1056342982
Active platform Spring changes the naming rules of version number: This is very friendly to non English speaking countries Spring changes the naming rules of version number: This is very friendly to non English speaking countriesSpring changes the naming rules of version number: This is very friendly to non English speaking countriesSpring changes the naming rules of version number: This is very friendly to non English speaking countriesSpring changes the naming rules of version number: This is very friendly to non English speaking countriesSpring changes the naming rules of version number: This is very friendly to non English speaking countriesSpring changes the naming rules of version number: This is very friendly to non English speaking countriesSpring changes the naming rules of version number: This is very friendly to non English speaking countries
official account Utopia of bat (ID: bat Utopia)
Knowledge planet Bat’s Utopia
Daily article recommendation Daily article recommendation

Spring changes the naming rules of version number: This is very friendly to non English speaking countries