Problem/Motivation

At #1612910: [policy, no patch] Switch to Semantic Versioning for Drupal contrib extensions (modules, themes, etc) we finally decided to allow Drupal contrib extensions to use pure Semantic Versioning (SemVer). At over 400 comments, that issue is no longer useful to get anything done. ;)

This issue is the meta plan for tracking progress implementing the fixes to allow both semver and legacy versions within Drupal core. Drupal.org and packaging issues are tracked here: #2681459: Support contrib semver releases

Proposed resolution

Documentation Updates

Everywhere we've documented "PatchLevel" we need to relabel as "Minor", for example What do version numbers mean on contributed modules and themes?. PatchLevel and Minor are semantically equivalent, so we should eliminate confusion by having two semantically different things named "Patch" and "PatchLevel". There are a ton of other related docs that need to be updated to discuss this plan, explain / link to SemVer, etc.

Drupal 7

Drupal 7 contributed modules will continue to follow the existing pattern. 7.x-MAJOR.MINOR. For those user using composer to manage a drupal 7 site, the composer facade is able to translate this into a fake semver that composer can understand. For the users downloading files manually, or with tools like drush, they will still know that they are getting the drupal 7 version as it will be clearly marked.

Drupal.org

Drupal 8 contributed modules will allow for releases in the pattern of MAJOR.MINOR.PATCH. The composer facade and drupal.org will understand and allow for repository tags that include 8.x-MAJOR.MINOR (legacy), or MAJOR.MINOR.PATCH (fully compliant). Drupal core will need to be modified to expect and interpret these possibilities as well.

We have to fix Drupal.org to allow legacy (8.x-MAJOR.MINOR) and semver (MAJOR.MINOR.PATCH) versions on projects going forward. We'll probably have to retain the legacy support for a while, perhaps indefinitely.

see more #2681459: Support contrib semver releases

5) Drupal 9 (maybe) we can deprecate the (9.x) part of the versioning scheme, as it may not even be accurate, and from that point forward, MAJOR.MINOR.PATCH will be the version numbers for drupal contrib projects, and dependency compatibility *must* be specified in the info.yml files (or composer.json if that's where we end up).

Remaining tasks

Core

Core needs to support semver dependencies, and the core Update module needs to support semantic version releases and development branches.

Must-have

Should-have

Drupal.org

See #2681459: Support contrib semver releases.

Documentation

As this moves forward, we'll need to update a lot of documentation.
(This list needs to be fleshed out):

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Comments

dww created an issue. See original summary.

Mixologic’s picture

Mixologic’s picture

Issue summary: View changes
Mixologic’s picture

Issue summary: View changes
dww’s picture

Issue summary: View changes

Split up the remaining tasks section into sub-sections for Core, Drupal.org and Documentation.

dww’s picture

Issue summary: View changes
dww’s picture

Issue summary: View changes

For completeness, harvest more details from the proposed resolution from #1612910: [policy, no patch] Switch to Semantic Versioning for Drupal contrib extensions (modules, themes, etc).

dww’s picture

Issue summary: View changes

Sorry for the noise: fixing typos and grammar bugs from pasted text.

catch’s picture

One question on the issue summary, why add support for (8.x-MAJOR.MINOR.PATCH) (transitionary)? I feel like I'm missing something on how this helps either the implementation end or contrib authors - i.e. why not support legacy and fully compliant, and nothing in-between?

Mixologic’s picture

Re: #9 I cant think of any technical reason that we'd need (8.x-MAJOR.MINOR.PATCH). Seems like it'd be less confusing to drop the CORE_COMPATIBILITY part for the semver version strings. At one point people were really attached to that string, but I think that was years back when 6.x/7.x/8.x were all being used. With our current 7.x vs 8.x-and-onward, Im in agreement that we dont need (CORE_API-MAJOR.MINOR.PATCH) and should only add support MAJOR.MINOR.PATCH .

mile23’s picture

+1 on #9, #11.

Just re-reading my comment on #1612910-396: [policy, no patch] Switch to Semantic Versioning for Drupal contrib extensions (modules, themes, etc) to see if I disagree with myself and I don't think I do. :-)

catch’s picture

At one point people were really attached to that string, but I think that was years back when 6.x/7.x/8.x were all being used

I may even have been one of those people, but from 8.x onwards (once we implement it) CORE_COMPATIBILITY can't be expressed in a single string any more, so it just won't work any more. Also we're not going to backport support for x.x.x to 7.x, so there's no confusion between 100% incompatible major versions.

mile23’s picture

As @mixologic pointed out one place or another... In the future it'll be possible to have a contrib release that's compatible with both Drupal 8 and Drupal 9. That's given that 9.0.0 is just 8.last without the deprecated code.

So your info file will need to be able to say something like core: ~8.6 || ~9.0. It would probably say this in your composer.json file, too. (The actual d8 version constraint would be where the API changes occurred that you're using.)

There's no way to specify that using CORE_COMPATIBILITY, other than to have two different releases.

dww’s picture

I don't see much benefit to the "transitionary" versions, either. I was just copying stuff from the old summary. We could probably simplify this plan even more by removing those parts. +1 to that.

Meanwhile, re #14: the core issue for core: ~8.6 || ~9.0 is at #2807145: [policy, no patch] Allow contrib projects to specify multiple major core branches

Since that's not strictly related to contrib semver support in core, I didn't add it to the official plan, but I'm marking it as a related issue. If we think that belongs in the "fix core to support this stuff" list, feel free to move it.

Cheers,
-Derek

mile23’s picture

RE: #15

Since that's not strictly related to contrib semver support in core...

Well, ~8.6 || ~9.0 is valid semver. It says you can support 8.6.x and 9.0.x, but nothing else.

So if we use semver to determine such things then we'll more-or-less automatically allow multiple majors in the core key.

dww’s picture

Well, ~8.6 || ~9.0 is valid semver

No it's not. It's valid composer-speak to specify a version constraint involving 2 different major versions. "semver" just means you have 3 digits in your version strings, and you promise to increment them in specific ways based on what changed in your code. Whether contrib versions are a single digit, 10 digits, or semver is irrelevant to the question of if core's idea of "what extensions in my filesystem are compatible with me?" can handle an extension that says it's compatible with more than one version of core or not.

Anyway, we all agree It'd Be Good(tm) if a given release of a contrib extension could say "I'm compatible with both core 8.7.x and 9.0.x". That's what #2807145: [policy, no patch] Allow contrib projects to specify multiple major core branches aims to achieve. If you want to add it to the official roadmap here, go ahead. But let's all please be careful and specific with our language, and the scope of what we're doing here (as opposed to the composer-ify-drupal initiatives), or this, too, is going to spin out into another useless 400+ comment thread with nothing actually accomplished. Please don't say "semver" when you mean "composer syntax", or you're just going to confuse things for everyone. In fact, please don't say "semver" at all unless you're only referring to a version numbering scheme with 3 digits and a set of agreements on what the parts mean.

Thanks,
-Derek

Mixologic’s picture

'semver' doesnt "only refer to a numbering scheme", it *also* refers to the implementation library that we would use (https://github.com/composer/semver) to not only specify a maj/min/patch version, but also to express acceptable dependency constraints.

~8.6 || ~9.0 is valid semver could be more thoroughly expressed as

~8.6 || ~9.0 is valid constraint using the composer/semver library

For the purposes of discussions involving version constraints, semver, and versioning, its practical and expected to assume 'semver == the composer specific implementation of how semver is handled'.

So, for core, three of the issues listed in the issue summary are addressed by using composer semver library to parse and "handle" our constraints, and extend that library where necessary to interpret legacy version numbers. (which is what the fourth issue, #3004459: [PP-1] Fold in dependency parsing wisdom from project_composer, addresses).

dww’s picture

Okay, thanks for clarifying. Ambiguous terminology--, but whatever. ;)

So, we already need updates here:

1) Remove the talk of "transitionary versions" for 8.x. I think we're all in agreement that doesn't help anything, and would only create more work, more BC layers to deal with, and more potential confusion for end users.

2) Explain that "semver" is an overloaded term that can refer to either semver or a specific implementation of a composer-related library that handles semver version strings and constraints using them. *sigh*

My request: would people be willing to call that second thing "the composer/semver library" instead of just "semver" to avoid confusion?

While we're at it, we should probably also explain that the goal is to use the composer/semver library in core to handle a bunch of things, and create the appropriate sub-issues that will make that happen.

Finally, we need a lot more sub-issues on the d.o side of this plan.

FWIW, project* natively supports semver (for the most part). There are a few places where the "API compatibility" thing triggers various kinds of functionality that we're going to want to reconsider. For example, the "8.x issues" option in the issue queue depends on that stuff. There are a bunch of project_solr places where folks try to filter modules that are compatible with "8.x". All that crap needs to be thought through and we need to consider how we're going to expose the project dependency/requirement data from info.yml or composer.json files into the d.o DB in a way that project* can put that info in the Solr index so people (and robots) can still find what they need. @mixologic probably has a stronger grasp on those implementation details than anyone at this point, so I'd invite them to start opening the appropriate issues and linking them here.

I'm also so out of the loop on the gitlab migration, I don't know if the plan is to keep using project* at all or what. So, I don't feel either well-qualified nor particularly motivated to open a bunch of issues against project* if that's all going to be abandoned in the medium term, anyway.

Cheers,
-Derek

catch’s picture

The '8.x issues' filter for core issues works absolutely fine and core is already using semver, however I can see contrib projects conflicting.

For example Views already has a '5.x issues' option for Drupal 5, but if View 5.0.x gets released, that's... not going to work.

dww’s picture

Re: #20: The reason it works for core and its semver 3 digit version strings is that project_release (or more specifically drupalorg_project_versioncontrol_git or whatever) is smart enough to set the "API Compatibility" on core release nodes, even though there's no "8.x-" part of the tag or version string. Witness the "API version" selector at the https://www.drupal.org/project/drupal/releases page. So, for example, the 8.6.2 release is Major = 8, minor = 6, patch =2, with API version = 8.x (even though that's not included in the generated version string). The last part is the reason the '8.x issues' thing works in the core issue queue.

Probably this isn't the best place to discuss such implementation details. This is why we need sub issues for the d.o parts so we can roll up our sleeves and deal with all these sorts of gory details in a more focused way for the various parts of d.o functionality that this is going to impact.

Cheers,
-Derek

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

gábor hojtsy’s picture

Title: [META] Prepare core and Drupal.org to handle semantic versioning for contrib extensions (modules, themes, etc) » [META] Support semantic versioning for extensions (modules, themes, etc) in Drupal core
Issue summary: View changes

Opened a dedicated issue for drupal.org.

tedbow’s picture

#2313917: Core version key in module's .info.yml doesn't respect core semantic versioning was committed which will allow modules to specify composer/semver constraints for the core dependency. It also allows specifying compatibility with multiple major core versions, for example via ^8 || ^9

It has been detailed in #3069795: [meta] Improve dependency management for extensions that we solve being able to specify patch releases and semantic versioning constraints for other modules via #3005229: Provide optional support for using composer.json for dependency metadata

so #2641658: Module version dependency in .info.yml is ineffective for patch releases and #3004459: [PP-1] Fold in dependency parsing wisdom from project_composer mentioned in the summary here have already be closed.

I also just closed #3001344: ModuleHandler::parseDependency() can deal with beta1 but not beta also mentioned in the summary because this would be fixed by using composer.json.

Update the summary to remove reference to the transitionary (8.x-MAJOR.MINOR.PATCH) numbering and list of issues.

gábor hojtsy’s picture

This is not anymore a requirement for 9.0 branch or alpha or even the release. It would still be very good to have this support in 9.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

tedbow’s picture

tedbow’s picture

Issue summary: View changes
xjm’s picture

Title: [META] Support semantic versioning for extensions (modules, themes, etc) in Drupal core » [META] Support semantic versioning for extensions (modules, themes, etc) in Drupal core, and allow modules to be compatible with Drupal 8 and 9 at the same time

Retitling to reflect the actual scope of work here, because there are two separate initiatives that sort of ended up being implementation details of each other. @tedbow and I are going to work on gathering all the various related core issues into the issue summary here so we can do triage on them.

xjm’s picture

Issue summary: View changes
dww’s picture

Issue summary: View changes

#3100110: Convert update_calculate_project_update_status() into a class was listed twice.
Moved it out of 'Needs triage' into a new 'Could-have' list.

xjm’s picture

Issue summary: View changes

Doing some further triage on issues that have an obvious MSCW,

xjm’s picture

Issue summary: View changes

Missing issues.

gábor hojtsy’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes

Adding #3113992: The 'Update' page has no idea that some updates are incompatible which is probably a regression in 8.8.x due to this work. It's at least a should-have and possibly a must-have. Also moved one issue that was already triaged to the should-have list.

xjm’s picture

Issue summary: View changes

Triaging a couple more issues based on previous discussions. The optional composer.json support issue is a could-have: We're not requiring it for 9.0.x, but it's a desirable API addition for a Drupal 9 minor. Disallowing core: 9.x would have a beta deadline and would be a prereq for allowing us to deprecate the key and constant for Drupal 10.

xjm’s picture

Issue summary: View changes

Just cleaning up redundant text in the IS.

xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes
xjm’s picture

tim.plunkett’s picture

Issue tags: -beta target

Untagging as beta target after discussion with @tedbow and @xjm. All child issues were reviewed and individually tagged where appropriate.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

agentrickard’s picture

I just discovered that the documentation for https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension... doesn't tell us how to specify SEMVER version releases for module dependencies in an info.yml file, nor does https://www.drupal.org/docs/creating-custom-modules/let-drupal-know-abou....

Is that addressed in this META and its children or should it be another issue?

Example:

dependencies:
  - drupal:field
  - search_api_field_map:search_api_field_map (>=8.x-3.x)
  - search_api_solr:search_api_solr (>=8.x-3.x)
  - token:token

Search API Solr current is now 4.1.4. What changes need to be made to this info file?

tedbow’s picture

@agentrickard Semver is not supported in dependencies in info.yml files

See #24. There are a lot of problem with the current way we parse version for dependencies. We decided we would tackle this in #3005229: Provide optional support for using composer.json for dependency metadata. So if you wanted Semver for dependencies you could use composer.json when that issue is completed.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

andypost’s picture

There's only 1 "must have" left

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

murz’s picture

This issue #3010334: Document how contrib hook_update_N() should be numbered now that modules can be compatible with multiple major branches and versioned semantically is closed, but from the current documentation it is still totally unclear about how to start numbering the hook_update_N() functions for modules, that use semantic versioning!

So, I created a separate issue #3485835: Standardize numbering of hook_update_N following the module semantic versioning to improve this, please take a look.

quietone’s picture

Status: Active » Needs review

The must-haves and should-haves in the issue summary are complete and semantic versioning is supported. So, it seems to me that this can be closed. Should some or all of the child issue be moved to a new meta?

nicxvan’s picture

Status: Needs review » Needs work

Yes, let's open a new Meta for the remaining issues.

dww’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.