1

By default, modules generated with features are created with a version string in the *.info file.

I think the convention is to increase this version number when the feature changes.

In a distributed development work flow with a lot of merging, a linear version increment is not a useful model or metaphor.

Is the version number, and incrementing it, useful or necessary for anything?

I work in a project where until now almost none of the features has version number. But recently a colleague reported problems reverting the features on deployment, if they don't have a version. Of this could be pure concidence, and caused by something other than the missing version number.

1

It's metadata for keeping track of a Feature release. In D7, the use of Features has two cross purposes:

  • Bundling Drupal configuration up as a part of a released feature that can be deployed to any site (e.g. a bunch of re-usable content types).
  • Snapshoting config as code which is useful for capturing config that D7 didn't normally have (and has been supplanted by D8's config management system).

In the first case, the use of version tagging is more useful when you're a vendor of some project leveraging Features. A tag gives you an identifiable way to know what will be rolled back if you force a Feature back to its original state.

If you're using Features solely as config as code, versioning is not really important. Especially, if it's part of a large project that is already leveraging some release tagging.

  • Re: rollback, IIRC modules version property is optional. I do remember there are parts of Features (e.g. the export UI) that try to enforce having a non-empty version tag, but it doesn't have a concept of version control history for previous Features releases. – Shawn Conn Apr 15 at 17:11
  • 1
    And of course if you publish on drupal.org, you get the version tag for free from git release tags.. – donquixote Apr 15 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.