Versions with automatic build system

We recently switched to an automatic build system (something internal, not Hudson or Teamcity, for now).
Our version is stored in the header file and is included in some cpp and resource files. It is also used by the installer.

Its format is ABCD where:

  • A has not changed in years.
  • B rarely changes (main version).
  • C changes with lower versions.
  • D changes when a new minor version (bug fix) is delivered to QA.

Until now, one refueling of a new version increased C/D manually ( D was more common) before starting the assembly, was noted as a result of the change, and then the assembly began. The version remained the same until this person built the application successfully.

Naturally, moving to an automatic build system, I would like to get rid of the manual step of changing the version number.

How to approach this?

  • Do I D whenever a new assembly is created, be it a QA assembly or an assembly of internal tests (i.e. I am working on some function and I would like to verify that I did not break anything)?
  • Is incrementing a task in an automatic build system?
  • After the increment, should I commit the version file?
  • How to avoid a lot of noise in my version control? I do not want tons of "incremental versions" to be committed.
  • What should I do if the assembly fails? Still increment version and lock?
+4
source share
5 answers

Do I increment D whenever a new assembly is created, whether it be a QA assembly or an internal test assembly (i.e. I'm working on some function and I would like to verify that I did not break anything)?

The Eclipse Foundation adds an E element, date and time of assembly. I think it's a good idea to build internal tests. It is up to you if you want to use E to build QA.

Is incrementing a task in an automatic build system?

It seems logical, but you should have some way to tell this task what design you are doing.

How to avoid a lot of noise in my version control? I do not want tons of "versions to increase."

Commit the source control version file.

Basically, the development process of your development should be carried out in the following order.

  • Create a product from development source code.
  • If the build succeeds, increase the version number.
  • Commit the source code and version control file.
  • Re-create the product from your version control system.
  • If the build failed, return the source code and version control file.

This checks your build and build process. The second build should never fail, but if that happens, there is a problem in the process.

The process of creating your products will begin with the second step, skipping the third step.

What if the build failed? Still increment version and lock?

My E automatically increments. :-) I would say no to the other elements A, B, C or D.

+1
source

Do I increment D whenever a new assembly is created, whether it be a QA assembly or an internal test assembly (i.e. I'm working on some function and I would like to verify that I did not break anything)?

Yes, change your process so that D grows with each row (successful or not), and not with every delivery in QA.

This can be quite difficult if you have several assemblies, some of which work differently and cannot tell them apart, because a failed assembly is the same identifier as a good one, well, in the end. Then you do not even need to consider whether he was on the same day or at the same hour.

Is incrementing a task in an automatic build system?

I would like the build system to automatically increment the build number (D).

After the increment, should I commit the version file? How to avoid a lot of noise in my version control? I do not want tons of "versions to increase."

Version control repository is all about recording detailed noise.

I would have the version update checked, this can make a reasonable shortcut, visible in SVN, from the fact that it creates previous changes where they are included, the build system ignores checks by the build system or those that are defined as a version update commit.

Then, to view the version history, you must have an appropriate tool that allows you to filter the history to show you the desired view, in some cases excluding version commit tags.

If you decide not to fix the version number for each assembly, it might be a good idea to keep the version number in a separate file to avoid accidental updates.

What if the build failed? Still increment version and lock?

Continue to increase the version number, I would not use the version number if it was not successful. You can have many failures outside of the source change in version control that you don’t need to write - server assembly from disk, server crash, the compiler got everything shaky on its knees, building 32 and 64 bits, debugging and freeing aix, linux and windows are being built at the same time ...

+1
source

You can use the convention for .NET collectors, as described in the documentation for class System.Version . Quote:

  • Assembly [your C]: the difference in the number of lines is a recompilation of the same source. When changing a processor, platform, or compiler, different build numbers can be used.
  • Revision [your D]: assemblies with the same name, major and minor version numbers, but different versions must be completely interchangeable. A higher version number can be used in an assembly that fixes a security hole in a previously released assembly.
0
source

How are you going to automate this? I mean, which system will know that "this assembly is a release assembly!" It seems to me that all your numbers in the version are relevant. If the next release (D + 1) requires two assemblies, will there be a next version of ABCD + 2? Sounds suspicious to me. Instead, I would rather add the build number on top of the version if it is really necessary to get this information about your DLLs and EXEs.

I don’t think that the build number is the corresponding piece of information attached to the binary unless you distribute the ABCD version files from different collections (which you should not do anyway!)

I would install a build server to store artifacts (DLL, EXE, MSI, PDB, etc.) in a directory whose name includes the build number and version, and then burns DVD / something there. If you ever need a response from version to a specific assembly, you can use this information provided that you keep an archive of your releases (recommended!).

0
source

I would recommend using autorevision .

You can still save the ABCD format for your tags and use the script to create header files that are generated during the build, which contain the necessary information.

0
source

Source: https://habr.com/ru/post/1339866/


All Articles