Latest Blog Posts

Versioning in Drupal

Submitted by Anonymous (not verified) on Tue, 25/08/2015 - 16:59

<p>Currently Drupal has <a href="https://www.drupal.org/node/1015226&quot; target="_blank">naming conventions</a> for branches and tags in git for contrib module. These are based on the core version then the module version, for example 7.x-1.x would create a dev version 1 for Drupal 7, 7.x-2.3 would create a stable release version 2.3 for Drupal 7.<br/></p><!-- more --><p>As we head towards Drupal 8 there has been a lot of talk about versioning for contrib. Core has already moved to using <a href="http://semver.org/&quot; target="_blank">semantic versioning</a> (semver), which is widely adopted by a lot of software now. Contrib is still on the old version numbering format. There is a <a href="https://www.drupal.org/node/1612910&quot; target="_blank">lot of discussion</a> about switching to something like semantic versioning for contrib. It’d be ideal to keep the core version somewhere in the number, there have been many suggestions, some of which are:</p><ul><li>2.3.0-d8<br/></li><li>2.3.0#d8</li><li>2.3.0@d8</li><li>d8.2.3.0</li><li>8.2.3.0</li></ul><p>My preferred, and it seems the favourite so far is 8.2.3.0, this is much like semver but the major version has been bumped down to make way for the core version, therefore core.major.minor.patch. The only possible issue here is if using composer for contib modules, composer will think the core version number is the major version number, and it will think the major version number is the minor version number. I feel that this is an ok compromise and we as developers can take this into account when using the syntax in composer.json.</p><p>Another versioning related issue is that we currently add the version number into the contrib info file as part of the packager that creates the module zip or tarball files. If more people pull modules straight from git (via composer) they won’t have this version number, causing the core update module not to work.</p><p>I say we should start asking module maintainers to add the version number to the info file. They already have to add the version number to the tag or branch, surely it’s no extra effort to add it to the info file, and saves so much effort trying to find a fancy programatic solution.</p><p><b>Update:</b><br/>As part of this I have opened <a href="https://www.drupal.org/node/2559313&quot; target="_blank">another issue on d.o</a> to discuss how we can make update module work for modules installed via git (including via composer).</p>