1

I have read a little bit about using semver for contrib modules in the updated documentation Transitioning from 8.x-* to semantic versioning and Drupal.org release version numbers allow semantic versioning. While I do understand that we need to tag these branches & releases incrementally based on your current 8.x version, how is this taken into practise?

My module for example is considered compatible for both Drupal 8 and 9, tagged with a release 8.x-2.1 on branch 8.x-2.x. So would I switch to a new branch 3.x and tag 3.0.0, or can this tag be on the same 8.x-2.x branch as they are essentially running the same codebase? Otherwise I have to apply all bug fixes and changes onto 2 branches.

How would this work in conjunction with the core_version_requirement key, as I believe semver is only supported starting from Drupal 8.7.7 core version?

And finally if I am able to use the same codebase for either semver or without, how would this work with update hooks or are they maintaining the same format?

1 Answer 1

2

I wouldn't use semantic versioning just for the sake of using it, especially since using it on drupal.org forces you to increase the major version number. Changing major version number means the new version is not compatible with the previous one, which also means the code base diverges significantly (or it will diverge significantly).

If the module uses semantic versioning, it should require Drupal 8.8.3 or any later version, since previous versions don't handle correctly semantic versioning.
For a module that is also compatible with Drupal 9, I would use core_version_requirement: ^8.9 || ^9.

As a side note, core_version_requirement is handled starting from Drupal 8.7.7. For those versions, using core isn't anymore necessary. It is also completely ignored in Drupal 10.x, as described in The 'core' key is completely ignored in .info.yml files.

3
  • Support for contributed module semantic versioning wasn't added into Drupal core until Drupal 8.8.3.
    – anonymous
    Commented May 10, 2020 at 21:25
  • Yes, that is clearly stated in Release naming conventions the OP linked. I don't know how I got confused.
    – avpaderno
    Commented May 10, 2020 at 22:51
  • Thanks @kiamlaluno for the great summary!
    – baikho
    Commented May 20, 2020 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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