Problem/Motivation

Drupal 12 is on the horizon. To ensure a smooth transition for Commerce
sites when it releases, it is worth starting to prepare the codebase now.

Currently, installing Commerce alongside a Drupal 12 codebase is not
possible because:

  • composer.json declares "drupal/core": "^10.3 || ^11",
    which excludes Drupal 12.
  • All sub-modules declare core_version_requirement: ^10.3 || ^11
    in their .info.yml files.

Proposed resolution

Update the version constraints across the project:

  • composer.json: "drupal/core": "^10.3 || ^11 || ^12"
  • All .info.yml files:
    core_version_requirement: ^10.3 || ^11 || ^12

A preliminary code audit shows no usage of APIs deprecated in Drupal 10
and removed in Drupal 12. Hook implementations already use OOP
#[Hook] attributes. The main remaining risk is upstream
dependencies:

  • drupal/address ^2.0
  • drupal/entity ^1.0
  • drupal/profile ^1.2
  • drupal/state_machine ^1.5

These packages will also need to declare Drupal 12 compatibility before
Commerce can be installed without conflicts.

Adding OPT_IN_TEST_NEXT_MAJOR: '1' to the Commerce
.gitlab-ci.yml would provide an automatic signal: once all
upstream dependencies declare Drupal 12 compatibility, the job will turn
green without any manual follow-up needed.

Additional context

Contrib modules that depend on Commerce are
currently unable to run Drupal 12 CI jobs because of this constraint.
The _LENIENT_ALLOW_LIST workaround available in the Drupal
GitLab CI templates does not resolve transitive symfony/yaml
version conflicts introduced by the current drupal/core constraint.

Issue fork commerce-3586548

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

macsim created an issue. See original summary.

macsim’s picture

Issue summary: View changes
macsim’s picture

Issue summary: View changes