Migrating the LocalGov Drupal distribution to drupal.org

Created on 5 June 2025, 22 days ago

Hi folks!

Thank you, for all your help so far. I am reposting one of my emails here for transparency and collaboration.

We are migrating LocalGov Drupal projects from https://github.com/localgovdrupal/ to drupal.org

We've already released a bunch of projects to drupal.org, mostly owned or maintained by the localgov user https://www.drupal.org/u/localgov . These should be enough to test a default install of LocalGov Drupal.

We're trying to work out how the drupal.org packaging system works and how differs from packagist. A few specific questions, if I may.

1. Is there a description of how the drupal.org packaging works and how it is different from packagist?

2. Is it important to make the .info file and composer.json to have the same dependencies? (It seems that drupal.org packaging adds things it finds in the .info file).

We want to be able to 'composer require drupal/localgov' which does not currently work.

3. Why do profiles not seem to have packages created on drupal.org?

On this last point, we note that https://www.drupal.org/project/sector lists under "General projects" not "Distributions". Is this to be able to use composer require drupal/sector ?

We also note that Drupal CMS is has a composer scaffold in the root with an install profile included in web/profiles.

4. Could we map our localgovdrupal/ namespace to drupal.org in an easier way - like in the repository specification? This way we might be able to avoid forking the projects.

Ideally we would love to be able to maintain releases on both packagist and drupal.org while we get people updated , so if there's a way to keep the composer.json consistent across both, that'd be amazing.

Any other advice would be gratefully received.

Many thanks,

Finn

💬 Support request
Status

Active

Component

Packaging

Created by

🇬🇧United Kingdom finn lewis Oxford

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

Comments & Activities

  • Issue created by @finn lewis
  • 🇬🇧United Kingdom finn lewis Oxford
  • 🇬🇧United Kingdom finn lewis Oxford

    Just stumbled on this issue: https://www.drupal.org/project/rwprofile/issues/3332288#comment-14890644 📌 RW profile - module project Active

    That answers some of our questions.

    General projects that contain a composer.json file are published to Packagist.org, not packages.drupal.org. This allows distributions to be installed with composer create-project, without first setting up composer to know what packages.drupal.org is.

    This means the .info.yml Drupal dependency translation that packages.drupal.org does is not done. composer.json needs a complete set of PHP & Drupal dependencies that Composer should get on install.

    So I think we do want to release the localgov_project and localgov projects to "General Projects"

  • 🇬🇧United Kingdom ikit-claw

    1. Drupal.org is Drupal-specific; Packagist is for all PHP packages. Drupal.org enforces strict licensing and compatibility; Packagist is more flexible.

    2. In Drupal, the .info.yml file defines metadata and Drupal-specific dependencies (e.g., modules, core) for a module or theme, enforcing them at runtime to ensure proper enabling, while the composer.json file manages both Drupal and external PHP dependencies via Composer for installation. Synchronizing Drupal-specific dependencies between both files is crucial to prevent errors, such as installation failures or runtime issues, and aligns with best practices for module development, ensuring consistency for developers. External libraries are only declared in composer.json, not .info.yml, and optional dependencies may differ but should be documented clearly to avoid confusion or issues during deployment.

    3. Drupal's infrastructure used to be very limited so for a time a lot of destructions were developed away from drupal.org now drupal.org uses GitLab under the hood this is not an issue. Drupal.org stopped creating packages for installation profiles in November 2022, as the Drush Make-based distribution packaging was outdated and resource-intensive, shifting to Composer-based workflows where profiles are embedded in distributions or projects like Sector, which is listed as a “General project” rather than a “Distribution” to enable straightforward composer require drupal/sector installation, reflecting its modern, flexible approach. Profiles lack standalone packages on packages.drupal.org due to their complexity and are instead managed as part of larger Composer packages, such as distributions or Drupal core, which includes profiles like standard in web/profiles via the drupal/recommended-project scaffold, ensuring dependencies are resolved without separate packaging.

    4. Mapping the localgovdrupal/ namespace to Drupal.org is difficult due to Drupal.org’s fixed drupal/ namespace and lack of support for external namespaces in its repository specification, necessitating either direct project contributions to Drupal.org or a custom Composer repository to avoid forking, while maintaining releases on both Packagist and Drupal.org is achievable by using a unified composer.json with provide or replace directives to alias localgovdrupal/ and drupal/ packages, mirroring repositories across GitHub and Drupal.org, and automating synchronized versioning to ensure consistency.

    The cleanest option here would be to setup some kind of go between mirroring or run a script that automatically updates the specific entries so it can be easily tagged and deployed on both. I would also advise making sure the modules fall under the security release coverage to give people greater peace of mind and encourage adoption.

    If you have more questions I am happy to try and assist.

  • 🇬🇧United Kingdom finn lewis Oxford

    Hi @ikit-claw,

    Thanks so much for your time and considered response, very useful information.

    I think at this point we would like to move https://www.drupal.org/project/localgov from "Distributions" to "General projects" to support straightforward composer require. Is that something you can help with on this issue, or should I create a separate issue?

    Many thanks,

    Finn

  • 🇺🇸United States drumm NY, US

    I think at this point we would like to move https://www.drupal.org/project/localgov from "Distributions" to "General projects" to support straightforward composer require.

    That’s now done and https://packagist.org/packages/drupal/localgov is now available.

    2. Is it important to make the .info file and composer.json to have the same dependencies? (It seems that drupal.org packaging adds things it finds in the .info file).

    Yes, it is very important that dependencies are in composer.json. That is the only source of dependency management for general projects. Those are published straight to Packagist.org, which has no idea what an info file might be. It is a good idea to keep them in sync for modules & themes too.

    I think that might have everything in this issue answered

  • 🇬🇧United Kingdom finn lewis Oxford

    Hi @drumm,

    Thanks ever so much, I think that does indeed answer all our questions on this one for now.

    Looking forward to using Gitlab issue queues as soon as they are available too!

    Many thanks,

    Finn

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

Production build 0.71.5 2024