Hi,
3 of my modules seem to have name spaces gone weird for some unknown reason.

As per this package url, the namespace is doubled:
https://packages.drupal.org/8/drupal/provider-2017-3$bd8441cfc7389cf77df95d9606ef353b4e907db086592b84774a7ce9320e7847.json

module at https://www.drupal.org/project/azure_emotion_api shows up as:

drupal/azure_emotion_api-azure_emotion_api: {
sha256: "b9f2d4e049c4c7d3191c3340370f21849e2647ccea62e26113ac8a0b5bf74f65"
},

module at https://www.drupal.org/project/azure_vision_api shows up as:

drupal/azure_vision_api-azure_vision_api: {
sha256: "882094019bcada2dc9bf07bb6efa9acc02860ebf6992cd6411d15fcfdc0189bf"
},

module at https://www.drupal.org/project/azure_face_api shows up as:

drupal/azure_face_api-azure_face_api: {
sha256: "35b5e829e3d4b9f130db386fb101df6a50d82b1b35f8b00cd2910ce90c01e3f0"
},

bug

Can you please help?

CommentFileSizeAuthor
Screen Shot 2017-10-06 at 10.59.48 pm.png43.83 KBdakku
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dakku created an issue. See original summary.

dakku’s picture

Issue summary: View changes
Mixologic’s picture

Status: Active » Fixed

The problem is that they existed at one time under your azure_cognitive_services_api project, and since that was first, it reserved the bare namespace, such that if something depended on the azure_face_api module in its .info.yml, composer would know to download the azure_cognitive_services_api.

http://cgit.drupalcode.org/azure_cognitive_services_api/commit/?id=0cfcb...

So, when those were moved to their own modules, we don't really have a way of disambiguating what a project means when it has a dependency on 'azure_face_api', without specifically adding the project name into the package name, because now it could mean "the one that used to come with azure_cognitive_services_api" or it could mean "the one in the project with the same name". We cant default to 'project with the same name' because oftentimes we have modules that get both moved *into* and *out of* drupal core, as well as modules that get moved into and out of other projects.

So what you are actually seeing is the "Project"-"Module" pattern. When the project and the module are the same name, we can usually leave out the project name and just call it by the module name.

When a module is in early development, such as yours, we can usually just get rid of the stuff in the bare namespace with the understanding that its highly, highly unlikely that anybody was dependent upon those modules directly (also I can doublecheck the counts in the database to see how often composer has been instructed to get those specific modules, which in this case is 0).

So what we do in this case is we'll change invert the logic such that 'drupal/azure_cognitive_services_api-azure_face_api' becomes the namespace for the old submodules (which probably wont get used) and we'll strip the project name from your modules.

You'll have to change your local composer.json back to not having 'azure_face_api-azure_face_api' as that no longer exists (only had one download request, which Im assuming was you)

All of this is a long winded answer so that I can eventually migrate this into a "composer for project maintainers documentation".

Steps I did to fix this (so I can document that too:)

1. Check that usage stats of drupal/azure_* for your three modules to prove they havent been used, or are low enough to not matter.
2. Rename the package_namespace such that the old modules got the old project namespace and the new modules got the projectless namespace.
3. re-ran the project composer project processor for all modules (root@btch1:~# sudo -u bender drush -v -r /var/www/drupal.org/htdocs pcpp azure_cognitive_services_api azure_face_api azure_vision_api azure_emotion_api)

dakku’s picture

Hi Ryan,
Firstly thank you for the super quick and detailed response. That makes perfect sense and I know for the future. The issue was that I started with these modules as submodules and then decided to create separate projects :)

I will remember that for the future projects.

Thank you very much for your speedy resolution.

Status: Fixed » Closed (fixed)

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