A good strategy for implementing a versioning system

元气小坏坏 提交于 2019-12-04 07:16:32

Microsoft uses <major>.<minor>.<patch>-<build number> (or a variation).

I like using <major>.<minor>.<buildnumber>

Where I'm working we use the Maven system: artifact[-major-minor-revision][-SNAPSHOT] which allows us to develop "in progress" versions that change at a moments notice (SNAPSHOT) and those which have been formally released. Some examples are:

email-services-1.0.0-SNAPSHOT.jar

  • email-web-2.3.11.war
  • crm-2.5.0.ear
  • If it has SNAPSHOT in it then it hasn't passed the full suite of tests or is just a developer experiment. If it doesn't have SNAPSHOT then it is a release candidate. We maintain a repository of release candidates and the most recent is sent for deployment once the testers are happy with it.

    All of this can be managed with a few simple entries in a build file under Maven. See Maven2 tutorial

    This is probably a dead post now, but I'll add my two cents anyways. I'm of the opinion that build numbers should mean something to everyone who sees it. So I personally think that this is a good way to name versions:

    major.minor.patch.revision - e.g. 1.1.4.2342

    Major/minor numbers are pretty self-explanatory. But from the perspective of the 3rd number, it still needs to mean something to the customer. I've released this new version to you, Mr. Customer, but it wasn't worth a new minor number since we just fixed some bugs. So we've incremented the patch number.

    The 4th number usually means absolutely NOTHING to the customer, so you might as well make it useful to you and anyone else in your company that sees it. So for us, that number is the SVN revision number. It tells us exactly which revision was responsible for that version so that we can pull it out any any time to recreate it. Branching code obviously achieves this too, but not to 100% certainty.

    Also, another advantage with an all-numeric version number is that it easily integrates into nearly every continuous build system.

    Anyways, that's my two cents.

    +1 on the Jira/Bamboo solution. The only additional information about the build I would include (for my purposes) is the Subversion Release, although the Tagging operation is 80% of what I want.

    Manually maintaining the release/version information is a royal pain. Letting JIRA drive it is a great idea.

    On the final question, about where bugs/defects get logged and releasing a version:

    • Defect/Issue is logged against the release where it appears. A defect in 1.0.0-rc1 gets logged against 1.0.0-rc1
    • JIRA has (or maybe we added) a 'Fix-For' field that would have the planned release, in this case 1.0.0
    • If the defect/issue is severe enough, it may be necessary to add another 'rc' release.
    • The release is made when there are no outstanding critical defects/issues and the customer (or management) agrees that any remaining issues can be deferred

    The beauty of managing this through JIRA is that adding releases, generating change-logs, etc. is automated fairly well.

    We also use <major>.<minor>.<buildnumber> and we manage this with CruiseControl/(.Net) on our build server. And use Wix and CruiseControl Config to manage the Major minor numbers - still increment those by hand - but the build number happens automatically when on the build server. You could set up a rule an increment the major/minor automatically too I believe - we just have like to do that manually so that it takes concious thinking by a dev when it is time to name a particular release level.

    Major.Minor.BuildDateNumber.DailyBuildNumber

    Major and Minor are set by us, manually incrementing them as we see fit.

    BuildDateNumber is the number of months since the project start multiplied by 100, plus the day number of the current month.

    DailyBuildNumber is incremented for every build after midnight each day, starting at zero.

    E.g. 4th build of release 5.2 on 10 July, where the project started 1 Jan that year, would have version number

    5.2.710.3

    This is all calculated for us by the Version task in Nant.

    This keeps the version numbers unique and also allows us to quickly calculate when an installation was built.

    易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
    该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!