Module vipps_mobilepay_commerce recognized by composer as metapackage

Created on 11 August 2024, 4 months ago
Updated 27 August 2024, 3 months ago

Problem/Motivation

I am the maintainer of the following modules:
- vipps_mobilepay
- vipps_mobilepay_commerce

At first, the latter module was a submodule under the former one, but with an intention to move it to its own repo at one point. I subsplited the directory of the module into its own git repository and pushed it to d.org. Unfortunately, since then I have been unable to install the module via composer as it is always seen as metapackage rather than drupal-module. I added composer.json to the module's repository trying to force composer package type but with no luck.

Here's a relevant part from installed.json:

{
            "name": "drupal/vipps_mobilepay_commerce",
            "version": "dev-1.0.x",
            "version_normalized": "dev-1.0.x",
            "require": {
                "drupal/commerce_payment": "*",
                "drupal/core": "^10 || ^11",
                "drupal/vipps_mobilepay": "*"
            },
            "type": "metapackage",
            "extra": {
                "branch-alias": {
                    "dev-1.0.x": "1.0.x-dev"
                },
                "drupal": {
                    "version": "1.0.x-dev",
                    "datestamp": "1723319009",
                    "security-coverage": {
                        "status": "not-covered",
                        "message": "Project has not opted into security advisory coverage!"
                    }
                }
            },
            "notification-url": "https://packages.drupal.org/8/downloads",
            "license": [
                "GPL-2.0-or-later"
            ],
            "authors": [
                {
                    "name": "zaporylie",
                    "homepage": "https://www.drupal.org/user/1532844"
                }
            ],
            "description": "Integrate Vipps MobilePay Merchant services with Drupal Commerce",
            "homepage": "https://www.drupal.org/project/vipps_mobilepay",
            "support": {
                "source": "https://git.drupalcode.org/project/vipps_mobilepay"
            },
            "install-path": null
        },

As you can see some references to vipps_mobilepay exist which is difficult to explain. I tried force-pushing to 1.0.x and rewriting history as I expect resuing objects with the same sha across 2 repositories is at the bottom of this problem but server hooks prevent me from doing that or deleting 1.0.x branch. Would be nice to have the history but I can live without it.

Module on git.drupalcode.org: https://git.drupalcode.org/project/vipps_mobilepay_commerce

Steps to reproduce

install the module on drupal 10+ with composer using

composer require drupal/vipps_mobilepay_commerce 1.0.x-dev
πŸ› Bug report
Status

Fixed

Version

1.0

Component

Namespace request

Created by

πŸ‡³πŸ‡΄Norway zaporylie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @zaporylie
  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    Linking related issue that discusses this as an ongoing problem inside the D.O. ecosystem.

  • πŸ‡ͺπŸ‡ΈSpain fjgarlin

    The composer command for the new module seems to be this composer require 'drupal/vipps_mobilepay_commerce-vipps_mobilepay_commerce:1.0.x-dev@dev' from the module page.

  • πŸ‡³πŸ‡΄Norway zaporylie

    The submodule was there only for convenience when I was initially developing this integration It is now removed and was never part of the tagged release - both modules are still in a pre-tagged phase while I am trying to resolve this problem. I see now that this way of working on new modules is not supported.

    However, having a quick look at https://www.drupal.org/project/book β†’ which used to be part of the core (metapackage) and is now a standalone Drupal project it seems like it is possible to promote metapackages to full projects and keeping the composer namespace. Is it possible to somehow manually reset both modules (drupal/vipps_mobilepay, drupal/vipps_mobilepay_commerce) in the registry to avoid composer require 'drupal/vipps_mobilepay_commerce-vipps_mobilepay_commerce:1.0.x-dev@dev' which is suboptimal and difficult to promote?

  • πŸ‡ΊπŸ‡ΈUnited States hestenet Portland, OR πŸ‡ΊπŸ‡Έ

    That is possible. It's not something we do very often, but we have a couple requests in the backlog, so I can see about doing a batch pretty soon.

  • πŸ‡ΊπŸ‡ΈUnited States drumm NY, US
  • πŸ‡³πŸ‡΄Norway zaporylie

    Thank you! Appreciate it.

  • Status changed to Fixed 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States hestenet Portland, OR πŸ‡ΊπŸ‡Έ

    I have swapped the package namespaces around - watch out for support requests related to the change.

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

Production build 0.71.5 2024