Problem/Motivation

Drupal has an automated testing system which is a major feature in ensuring code quality. However, due to a design flaw automated testing does not and cannot work for all projects. The root of the problem is that we often talk about modules when we mean projects. The two are not the same. In particular, module names are not unique while project names are unique (drupal.org/project/
).

The info file specifies the module name for dependencies. Since the module name is not unique it is impossible to guess the correct project in all cases. The fact is the project maintainers know the correct project for their dependencies but there is no place to specify it so we have to resort to guessing.

Open source projects are built around the idea of being able to fork a project when needed. Due to this design flaw, forking a project can break automated testing. An example is https://www.drupal.org/project/webform and https://www.drupal.org/project/webform_patched. Or various modules are moved into core (simpletest, etc.) or removed from core and spun off in a contributed project (php).

This design flaw also limits the capabilities of Drush.

Proposed resolution

Make it possible (but not required) to specify which project we are talking about. For example,

dependencies
  - webform_patched:webform (>= 7.x-3.20)

This change is backward compatible and has no effect on module installation or dependency calculation in Drupal core. It simply adds a project key to the dependency structure.

Remaining tasks

There is code for Project Dependency waiting for this patch to be committed so that the problems with the testbots can be fixed. There are critical issues filed on Project Dependency that are held up due to this design flaw.

Drush will be able to extend the capability for automatically downloading projects.

This change has no affect on Drupal core but it does provide the project name which may be used for future changes.

Projects will be able to update their dependencies. Although this is optional, updating the dependencies will prevent problems with automated testing so it is highly recommended. Note that these problems can suddenly occur in a project even if the project has not changed (e.g. a new project with the same module name appears).

User interface changes

None.

API changes

It becomes possible to depend modules in specific projects.

Original report by @trobey

The current format for the module.info.yml file looks like it has the format

dependencies:
  - <module>

Most people would read module as project since there is a tendency to conflate the two. But they are very different. Project names are unique while module names are not. There is an inherent ambiguity in the current way the dependencies are specified. As the number of projects increases there will be increased collisions between module names. This causes problems for Project Dependency because the only recourse is to guess between the projects which will inevitably be wrong in some cases. It also results in a very convoluted process of starting with a module name, searching for releases with that module name and then finally arriving at the project (hopefully the right project) when searching for dependencies.

In addition this dependency format can lead to the problem of a project being created that crashes the testbots. This is not a nice prospect.

At some point this needs to be addressed. The suggested change is to namespace the module name with the project name similar to

dependencies
 - <module> (<project>:<version>)

where the project is optional (as is the version restriction). This would allow a unique way to specify module dependencies instead of the current ambiguity. This would require drupal_parse_dependency() to return the project in the structure that is returned (when it is supplied). Since the project name is optional this would maintain backward compatibility and impacts should be limited.

The original issue is #2194683: webform_patched being downloaded instead of webform for course module. I will create a hack to deal with the original issue but we will continue to get additional issues until this ambiguity is fixed.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task per Dries (https://www.drupal.org/node/2205271#comment-9013109)
Issue priority Major (although the original issue in the Project Dependency issue queue is critical).
Prioritized changes This is a priority because it is needed to fix a problem with the testbots failing. It also is tagged for backport to Drupal 7. There also is a security impact because a malicious person can cause the testbots to fail.
Disruption The change is backward compatible so there is negligible impact.
CommentFileSizeAuthor
#159 project_namespace_for_dependencies-2205271-159.patch4.13 KBtrobey
#146 project_namespace_for_dependencies-2205271-146.patch5.88 KBtrobey
#144 project_namespace_for_dependencies-2205271-144.patch5.89 KBtrobey
#137 project_namespace_for_dependencies-2205271-136.patch5.79 KBtrobey
#135 project_namespace_for_dependencies-2205271-134.patch5.79 KBtrobey
#132 project_namespace_for_dependencies-2205271-132.patch5.65 KBtrobey
#127 project_namespace_for_dependencies-2205271-127.patch5.63 KBtrobey
#125 project_namespace_for_dependencies-2205271-125.patch6.17 KBtrobey
#123 project_namespace_for_dependencies-2205271-123.patch3.96 KBtrobey
#120 project_namespace_for_dependencies-2205271-120.patch3.96 KBtrobey
#113 project_namespace_for_dependencies-2205271-113.patch14.22 KBtrobey
#108 project_namespace_for_dependencies-2205271-108.patch19.96 KBtrobey
#90 project_namespace_for_dependencies-2205271-90.patch19.83 KBtrobey
#81 project-namespace-for-dependencies-2205271-81.patch19.57 KBjhedstrom
#81 interdiff.txt2.11 KBjhedstrom
#79 project_namespace_for_dependencies-2205271-79.patch19.49 KBtrobey
#76 project_namespace_screenshot-2205271-76.png85.66 KBtrobey
#76 project_namespace_for_dependencies-2205271-76.patch19.49 KBtrobey
#73 project_namespace_for_dependencies-2205271-73.patch13.73 KBtrobey
#61 project_namespace_for_dependencies-2205271-61.patch8.36 KBtrobey
#19 project_namespace_for_dependencies-2205271-19.patch7.4 KBtrobey
#17 project_namespace_for_dependencies-2205271-16.patch7.4 KBtrobey
#15 project_namespace_for_dependencies-2205271-15.patch6.79 KBtrobey
#10 project_namespace_for_dependencies-2205271-9.patch6.44 KBtrobey
#7 project_namespace_for_dependencies-2205271-7.patch1.79 KBtrobey

Comments

hass’s picture

As discussed in #2047557: Support Drupal 8-style *.info.yml files we have the problem today that modules cannot define a dependency on https://www.drupal.org/project/php. Every test run fails completly and makes automated testing impossible. GA depends on php filter module and always fail, see https://qa.drupal.org/pifr/test/480418.

hass’s picture

After more reading the webform case I do not understand how this proposed change could be backwards compatible. There are many modules out that use a version string in dependencies. e.g.

test_dependencies[] = autoload (>7.x-1.5)
dependencies[] = autoload (>7.x-1.5)

Prefixing the version with a project name should fail the same way like prefixing the module name with a project. Untested, but I think this cannot work without changes. Unbelivable... This cannot wait for D9 and needs to be backported to D7, too.

hass’s picture

Issue tags: +beta-blocker

As it may require changing every .info.yml file.

hass’s picture

Issue tags: -beta-blocker

Wrong tag.

hass’s picture

Aside... We could fix this in a lot cleaner way by adding a new key to info files that only project dependency uses. Like we already done with test_dependency. What do you think about this?

Example:
test_project_dependencies[] = php

This could force project dependency to download these listed projects as preferred projects. If the test_dependencies modules are found in these projects the project dependencies module stops trying to download the dependend modules from random projects. This should be maintainable in project dependency module, too.

@trobey: Does this work for you?

trobey’s picture

I think there are many ways to specify the necessary information. I would note that the problem is not limited to Project Dependency. The modules page also uses the dependencies although usually only the installed modules are considered instead of all possible modules.

trobey’s picture

Status: Active » Needs review
Issue tags: +Needs backport to D7
StatusFileSize
new1.79 KB

The attached patch adds a project key to parseDependency($dependency) in Drupal core. This will return the project name in the project key and the module name in the module key. The name key is retained for backward compatibility. To add the project name to the dependency specified in the info.yml file:

dependencies:
  - <project>:<module>

The current style

dependencies:
  - <module>

should still work but no project key will be returned from parseDependency(). So this should be backwards compatible but should add additional information about the dependency that should solve problems with ambiguity about which project contains the specified module.

hass’s picture

That is a good start. There may be some more changes required. I cannot remember for sure, but I thought update module will download dependend modules automatically... Isn't it? I could be wrong as I'm using drush for such a long time...

Status: Needs review » Needs work

The last submitted patch, 7: project_namespace_for_dependencies-2205271-7.patch, failed testing.

trobey’s picture

Status: Needs work » Needs review
StatusFileSize
new6.44 KB

Updated patch. The failed tests do not seem to run when I run local tests so cross my fingers and hope I got it.

tim.plunkett’s picture

Status: Needs review » Needs work
+++ b/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php
@@ -496,21 +496,21 @@ public function testDependencyParsing($dependency, $expected) {
-      array('system', array('name' => 'system')),
-      array('taxonomy', array('name' => 'taxonomy')),
-      array('views', array('name' => 'views')),
-      array('views_ui(8.x-1.0)', array('name' => 'views_ui', 'original_version' => ' (8.x-1.0)', 'versions' => array(array('op' => '=', 'version' => '1.0')))),
+      array('system', array('name' => 'system', 'module' => 'system')),
+      array('taxonomy', array('name' => 'taxonomy', 'module' => 'taxonomy')),

You shouldn't have to change all of these expectations. The code should assume that the module is the same. You should just add a couple test cases where the module is different, I guess?

trobey’s picture

I have to make a choice here. It is not the only choice but no one else is stepping up with any suggestions. If I am returning the optional project name with a key of 'project' then does the key 'name' make sense? Is this the project name or the module name? Just 'name' is ambiguous but we need to retain it for backward compatibility. So perhaps it makes sense to add a 'module' key that is clearer? But if I add the 'module' key then the tests break because it is not included in the canned result array. So I can fix that array or I can remove the 'module' key. I do not care which way it is done.

It would probably be a good idea to add a test for the project but I am first trying to get the patch to pass.

hass’s picture

Do we really need backward compatibility in D8? I do not think so. I would use module and project as keys and may backport a workaround.

trobey’s picture

It is okay with me. Anyone else? I will re-roll the patch and now that it is passing I will add a test for the project name.

trobey’s picture

Status: Needs work » Needs review
StatusFileSize
new6.79 KB

Here is the updated patch with an added test.

Status: Needs review » Needs work

The last submitted patch, 15: project_namespace_for_dependencies-2205271-15.patch, failed testing.

trobey’s picture

Status: Needs work » Needs review
StatusFileSize
new7.4 KB

Update patch.

hass’s picture

I'm confused about views:views_ui. Views UI is in project drupal:views_ui as I know. We should try adding php module and see how project dependency behaves :-)

trobey’s picture

I forgot that Views had been moved into core. Not that it really matters but here is an updated patch.

hass’s picture

Status: Needs review » Reviewed & tested by the community

Code looks good, has green tests and I have no idea what else could I test manually than what the tests have tested. Let's get this in before beta.

chx’s picture

Status: Reviewed & tested by the community » Needs work

+ * A dependency string, for example 'project:module (>=8.x-4.5-beta5, 3.x)'.

*blinks slowly*

Thanks for working on this but this comment needs a lot of better examples of what "project" and "module" can be. Not to mention that just "module ()" still works and that's not visible from the comment.

trobey’s picture

Status: Needs work » Needs review

@chx: After this patch is committed just "module()" will still work. But I do not want to put this in the code comment because I do not want anyone to specify dependencies that way. The reason I do not want to is it will work *until* someone submits a new project with a module name identical to yours and suddenly your module no longer passes tests. And I will again be fielding angry complaints about "why did my module suddenly stop working when I have not touched anything." And I will point out to them that they did not specify the project in their dependency. And they will respond that the code comment said they could specify just the module name. And I will drum my fingers and sigh. Another four or five hours wasted.

When I started working on this issue I could not find any documentation for Drupal 8 about how dependencies are specified. I was confused and I am very familiar with this code in the earlier versions of Drupal. Searching now all I can find is https://www.drupal.org/node/2000204. The reason I have not included any documentation changes in this patch (or along with it) is because I cannot change something that does not exist. If someone can point me to the proper place I can try to write up something about specifying dependencies and add in documentation about this change.

hass’s picture

That sounds like we should write a change notice that every module should specify dependency only in the new format and the old module-only format is deprecaded? I'm fine with this change if it is a permanent fix. This makes this patch again RTBC, isn't it?

tim.plunkett’s picture

So why did both #17 and #19 both pass? #17 was wrong, it should have failed.

hass’s picture

No, they pass as we only define the dependency. The test validates that splitting the dependency string works properly. In project dependency module we can test if downloading the dependency works. We could also add a test module to core that downloads php filter module and this will for sure fail on today test robot. But before we implement this, we need a core patch that has been accepted.

I'm not sure if we want a test in core that depends on a contrib project... Next core version produces a test failure if there is no contrib dev available.

trobey’s picture

There are several options in order of increasing impact.

1) Rely on Drupal best practices to encourage people to supply the project name for dependencies.

2) Deprecate using only the module name for Drupal 8 and make the project name required for Drupal 9.

3) Require the project name for dependencies for Drupal 8.

The first two options eliminate the problem with collisions with module names. The last option would allow me to remove a lot of the code in Project Dependency that currently is used to figure out the project from the module name and also have performance impacts for the testbots. But even though option 3 makes my life a lot easier I am okay with any of these as they are all roads to the same place eventually and they all solve the problem with the testbots.

Which option should we choose? Option 3 might require a change to the patch to throw an error if the project name is missing. The other two options do not require a change to the patch and the issue could be changed to RTBC.

I guess you are saying we would need a change notice for the last two options. I guess that would be written once the patch is committed. I could do that.

hass’s picture

Aside... I think we should very hard discourage people from creating colliding namespaces. We could also discuss unpublishing modules doing this. I fear that people start doing this if we force the project name...

chx’s picture

If this about requiring Drupal developers to put in drupal: for every version dependency then count me as squarely opposed to this issue. Such a change would require wide buy in from the community and I don't see that here.

trobey’s picture

@tim.plunkett: Is 1 == +1? For all practical situations they are the same. But #7 failed because the test is simplistic and is checking for identical output rather than equivalence. This is why I had to update the tests.

hass’s picture

@chx: version is not required. It may be arguable if we require the "project:", but I would not require this. The problem today is simply that I cannot require php module as dependency. See https://qa.drupal.org/pifr/test/480418 how it fails. We need an optional project name in dependency string to solve the test bot inability. We also have the same troubles in drush that cannot resolve the project name and may download a wrong project, too. This are really heavy problems that may cause a lot of troubles for maintainers.

chx’s picture

Then write an issue summary that makes the use case understandable because by now I absolutely have no idea what this issue is about. Concrete examples would be welcome. For eg. is project Views? Or what? etc.

hass’s picture

e.g: this fails, because there are core alpha versions that have the php module integrated. The reason is the project dependency module tries to find a good match and finds drupal:php (project: drupal, module: php)

test_dependencies:
  - php

This will not fail (project: php, module: php)

test_dependencies:
  - php:php

Both projects drupal had and php project have the module php. Than my test downloads the required modules and tries to enable "php" module, but fails as core (DEV) does not have php embedded any longer. Root cause - project dependency think it still has (as there is a php module in an alpha release). The info.yml setting will force the testbot and drush to download php module from php project and not drupal.

Does this makes things clearer?

trobey’s picture

@chx: There are many examples. Someone forked the webform project into the webform_patched project with both having a module named webform #2194683: webform_patched being downloaded instead of webform for course module. Project Dependency at that time used a heuristic of using the most recent release so the webform_patched project was chosen and the tests failed. This also showed that anyone could create a new project with a module name that collides with a popular module and crash the testbots. So I modified the heuristic to prioritize projects with the same name as the module. The php module was part of core but was split off into its own separate php project. So hass's tests failed because Project Dependency is choosing a Drupal core release with a php module in it (see comment #63 of #2047557: Support Drupal 8-style *.info.yml files). Damien Touroud on a previous issue suggested using the popularity of the project in the heuristic but this would fail miserably for the php module. There was a problem with Simpletest #1276914: Contrib module may be considered a dependency instead of core module of the same name. rfay suggested core should have preference in the heuristic and again this would fail miserably for the php module. Then there was the google_analytics and googleanalytics projects. The latter project has been deleted but there are releases. You can probably just look at the issue queue for Project Dependency and find several more. The sad thing is the programmer knows which project they want but there is no place to specify it so I have to guess and there is no way that I can create a heuristic that will always be right.

Also consider the case where you have released your project and everything is going fine and then someone creates a new project and suddenly your tests start failing. But you have not touched your code. jthorson will get people screaming about problems with the testbots and then it will get passed to me and I will have to deal with someone that is berating me up and down that this needs to get fixed yesterday and how could we possibly be #$^*%*$* everything up because the code did not even get changed. And you are complaining that the programmers might have to actually tell me which project they really want? That is why this has to be at least a Drupal best practice because it really is unacceptable for something that has been passing tests fine to suddenly stop working when nothing in that project has changed.

chx’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: -Needs issue summary update
chx’s picture

Issue summary: View changes
chx’s picture

Issue summary: View changes

Now we know what are we talking about, if we want to make the project string required then a followup and a (very) wide community buy in is required for that. I recommend not holding the issue with it. However, it is optional at the moment + // Split out the optional project name. so we might've misunderstood each other and noone wanted required in the first place?

Grayside’s picture

This seems like a very drupally way of trying to specify which repository to use for a given library (module) dependency, which sounds like the same problem space as configuring tools like composer to use a different fork. If we followed that model, the directive might be on a separate line.

dependencies[] = webform
repository[webform] = webform_forked
hass’s picture

@grayside: That looks like my #5 idea. That is really backward compatible I think. I like it, too.

trobey’s picture

@Grayside: I am trying to think how that would work. I am not sure that I completely understand how that approach would be implemented so I am thinking out loud. I take the structure from drupal_parse_dependency() and have to pass it into drupal_check_incompatibility(). These are core functions or ports of core functions. (The core maintainers always assume that Drupal 7 core only has to understand Drupal 7 info files but this is not true. I have to use Drupal 7 core to read Drupal 6 and Drupal 8 info and info.yml files. So I often have to port the code but it is core code nonetheless.) So if we introduce a new line then I no longer can use the core drupal_parse_dependency() and have to write my own and try to create a structure that mimics the drupal_parse_dependency() structure so I can pass it into drupal_check_incompatibility(). There is always the risk that my function produces different results and then there may be problems. We went through a long exercise to port the ability to parse Yaml files to Drupal 7 so I could read the Drupal 8 info.yml files. I tried several Yaml parsers which were rejected because they might produce different results than Drupal 8 until we decided to use the Symfony module which someone had written to allow Symfony stuff to be used in Drupal 8. So I think I am already going to get people complaining if I do not use drupal_parse_dependency().

This problem also applies to other parts of Drupal. The modules page uses the dependencies to decide whether something can be enabled. It is not as big a problem there because the universe of choices is the installed projects while Project Dependency has to work with the universe of all possible projects.

I expect the number of cases of module name collisions to increase as people port their projects to Drupal 8. So this is going to have to be fixed at some point. I might note I tagged it as a feature for core but it is a critical bug for Project Dependency which cannot be fixed until this feature makes into core.

trobey’s picture

Status: Needs work » Needs review
chx’s picture

To be considered: the "project" line does not exist as far as Drupal is concerned. Look here http://cgit.drupalcode.org/views/tree/views_ui.info

So we need to decide whatever way we add this to dependencies on what do we do if the project value is not available? It won't be from a git checkout.

Side note:

> The core maintainers always assume that Drupal 7 core only has to understand Drupal 7 info files but this is not true. I have to use Drupal 7 core to read Drupal 6 and Drupal 8 info and info.yml files.

That's off topic. If you want, please file a separate meta issue and get the community to agree with that. Until then, D7 code works with D7 modules.

chx’s picture

After a brief discussion on IRC: there's a sister issue to this, this is a followup to it: enact a policy (no code whatsoever) that project: line in *.info.yml is mandatory and add it to the core files. That can't be done past beta because if from beta1 to beta2 modules won't even be recognized as such then we sort of failed in "we are not turning the world upside down anymore past beta". If I may, I recommend putting considerable effort in making your case succinctly and precisely. That was not apparent in this issue. I am interested enough to condense the problem into an IS for this issue (which you probably want to reuse for the other one too) but trying to change policy this close to beta is an issue too controversial for my tastes so I can't help with that one. Don't be surprised if this change will need to wait for 8.1.

Once we have done such policy, this for D8 becomes an easy issue.

Then we can decide what do with D7. That's an entirely separate thing and I am not sure whether it's solvable *at all*. We can add an optional policy perhaps. That will also be fun to get through.

trobey’s picture

Enact a policy? I have no idea what you are talking about. Can you explain in English or provide a link?

Have we decided to proceed with project:module() with project mandatory? I submitted a patch where it is optional. Your previous comment suggested you are not in favor of it being mandatory. Did I miss something in the discussion?

chx’s picture

Well, you post an issue something like https://www.drupal.org/node/2134513 this and then somehow get attention to it and get it accepted. It's very informal. There's no formal process. Wish there was.

So far, I think we agreed on it being optional. It would be quite a blow to enforce for every dependency a project when so often it'd be X:X anyways.

trobey’s picture

Thanks for the help on the write up and the pointer to submitting a policy. I am getting hammered from all sides so it is a struggle for me to spend any time on this. I submitted a policy #2296241: [policy, no patch] Project namespace for dependencies and hopefully it makes some sense despite my lack of sleep.

hass’s picture

I'm totally confused what this case has to do with project: key in info.yml. Can we set this back to RTBC now?

chx’s picture

How do you plan to get the project from the info if it's not in git? Yes, the packaging script puts in there but if it's not in git then git checkouts have no way of gaining it. Not to mention custom modules. Also, we can't because I haven't seen better comments written...?

hass’s picture

Status: Needs review » Reviewed & tested by the community

I have not reviewed the project dependency code, but today we find the projects. Project key is not in the scope of this case. This is RTBC. Don't set it back, please. Create followups for other issues, please.

trobey’s picture

Issue summary: View changes
chx’s picture

Priority: Major » Normal
Status: Reviewed & tested by the community » Postponed
chx’s picture

Also why did you RTBC this despite I asked for better comments? You know what the community thinks of you for this behavior, right? Do not re-RTBC this. I am actually trying to help you despite your constant issue queue trolling.

trobey’s picture

@chx: While I appreciate your help you can do better than this. I did not RTBC this. I did update the comments. So if your comment is directed at me you are wrong twice. Sigh.

trobey’s picture

@chx: At this point I think you have completely screwed up this issue. You clearly did not understand the issue when you first responded. That is understandable as it is I am not sure I could jump into a new issue and make meaningful comments. But I do not know what is worse: no one reviewing an issue or someone confusing things with misdirected comments to the point where the issue is dead. I am beyond frustrated. This is a serious issue which is impacting those of us trying to maintain the testing infrastructure.

hass’s picture

Priority: Normal » Major
Status: Postponed » Reviewed & tested by the community

@Chx: as trobey said - you have not understand anything in this issue. Sorry. The last ~30 comments are ALL offtopic and have nothing - absolutly nothing to do with the issue here. You only confuse this case. Trobey has rewritten the intro and i have no idea how someone can explain this more detailed. I'm not trolling here, You do not understand the issue at all. The other confusing case has been closed. This patch is RTBC. Try understanding the issue first before you write another 20 nonsensical comments, please.

chx’s picture

An issue summary is a concise overview of a full issue report.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

This issue seems like only half the work or the testing is not complete. I would have expected test modules declaring dependencies on project:module configurations that exist or not not exist. Reading the code I can't see how the dependency graph is fixed for modules of the same name being provided by different projects. Are we only adding this information for https://www.drupal.org/project/project_dependency?

Setting back to "needs work" to get answers.

trobey’s picture

Status: Needs work » Needs review

@alexpott: These are good questions and I will try to address them one by one.

This issue seems like only half the work or the testing is not complete.

This patch is only for Drupal core. I have tried very hard to make the change as simple as possible and intuitive. So the patch is very small (excluding the changes for the testing). I have also tried to minimize the impacts on Drupal core and existing projects. There is a lot more work in Project Dependency that is required. I am trying to find time to begin on that but it will assume that Drupal core is not taking a completely different direction from this patch.

I would have expected test modules declaring dependencies on project:module configurations that exist or not not exist.

I added a test for project:module in the patch:

      array('drupal:views_ui(>8.x-1.x)', array('project' => 'drupal', 'module' => 'views_ui', 'original_version' => ' (>8.x-1.x)', 'versions' => array(array('op' => '>', 'version' => '2.x')))),

The tests are unit tests and do not check to see if the project or module exists. The added test follows this pattern. If additional testing is required then it should be a separate issue since it applies to more than just this change.

Reading the code I can't see how the dependency graph is fixed for modules of the same name being provided by different projects. Are we only adding this information for https://www.drupal.org/project/project_dependency?

The patch includes a couple of fixes for the dependencies on the module page. But this patch is also just limited to providing the missing information about the required project. How could this missing information be used on the module page? Have you ever gone to enable a module and looked at the dependencies that are listed that are missing? Those modules need to be downloaded and installed. Going back to the webform_patched:webform example, a module that has a dependency on the webform module shows up on the module page. So I need to install the webform module. But we do not install modules; we install projects. I always pause here to go "Oh yeah, that module is actually in this project." It is almost so automatic that we forget that other people not as familiar with Drupal could struggle to figure this out. For example, is it obvious that a missing fe_block module requires installation of the Features Extra project? But even experienced people could run into problems. For example, if the dependency happened to be for webform_patched:webform but I went out and installed the webform project which also contains the webform module then the wrong dependency has been installed. Presently Drupal has no way to know this and the code may fail to work or indicate the problem. If the project information is available, then it would be possible to fix the code so that Drupal can detect that the installed module belongs to the wrong project. Code could also be written so that red "missing" is actually a link to the project page. It happens that there have not been any issues filed to fix the modules page while I have had to deal with several issues related to this for Project Dependency and I currently have a critical issue that requires this fix. If the problem originated on the modules page I may have written a bigger patch to include using the project information on the modules page. But I do not want to hold up Project Dependency while wrestling over how to use the project information on the modules page.

I think I have answered all of your questions and have not come up with anything that has to be changed in the patch. So I am switching this back to "needs review."

alexpott’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

is it obvious that a missing fe_block module requires installation of the Features Extra project?

No it's completely not obvious - but I really can't see how this issue fixes that. Yes it would allow this to be fixed if modules included their dependencies like this. But this patch does not make that required or give any much of a clue that this is even possible. We need more documentation since at the moment it is not there to help module authors do the right thing. Plus this is a change from previous versions of Drupal so we need a change record.

trobey’s picture

I would be glad to provide more documentation. Where should it go? In my search I could not find anything for Drupal 8 on dependencies in the info.yml file. Should this be done before the patch is accepted?

Can you provide information on how to create a change record?

alexpott’s picture

The documentation should be added to the doc block for InfoParserInterface since this line is would be incomplete with this patch applied:

   * - dependencies: An array of shortnames of other modules this module requires.

And since there are no examples in core you will need to provide a valid one.

change records? Add one: http://drupal.org/node/add/changenotice | Instructions: https://drupal.org/contributor-tasks/draft-change-record | New change record process: https://groups.drupal.org/node/402688 | See also: needs change record? missing change record? for lists of issues. change record improvements?

trobey’s picture

I updated the patch to include changes to the documentation for InfoParserInterface. I will look at submitting a change record.

trobey’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record

I have created change record for this issue #2299747: Project namespaces can now be added for module dependencies so I am changing the status to "needs review."

hass’s picture

Status: Needs review » Reviewed & tested by the community

trobey has written change notice, project dependency integration. Setting back to RTBC as before. No changes to the patch made.

alexpott’s picture

So if I have both webform and webform_patched in my /modules directory and I install a module that depends on webform_patched's webform module how does the module installer choose the correct one to install?

To me this solution still seems half baked and we have work to do in core.

trobey’s picture

@alexpott: I think "half-baked" is a poor choice of words since it implies it is not well thought out when the rest of your comment indicates that you believe it to be incomplete. I believe there is a difference between the two. But you are correct that there is additional work to do in core for the situation you have outlined. In addition, there is additional work for Project Dependency which I have already written in a separate patch #2047557: Support Drupal 8-style *.info.yml files. That issue is a critical bug on Project Dependency which is preventing testing from working in some cases. So the Project Dependency part is ready to go but is being held up by this core issue. The additional work for Drupal core is not critical and there are several possible approaches. I do not think the Drupal core part is going to be ready for some time so should Project Dependency and the problems with the testbots be held up?

As an aside I fixed a bug in Project Dependency that was preventing Drupal 7 core from being processed. Without this fix the forum in Drupal core has a dependency on the taxonomy module which ends up as the leftandright project (which also happens to have a taxonomy module). I do not think this is a problem since the dependency chain is stopped with Drupal core but it is again an example of an unintended dependency due to the lack of uniqueness in module names.

alexpott’s picture

Sorry I didn't mean to imply that there has not been thought put into it - I was meaning to say I feel it is incomplete.

What I'm trying to say is that if we introduce this then we need to bake this into module dependency discovery so that the system behaves as the user expects. If a developer adds the project to the dependency info and the system enables the wrong module then this is going to be super confusing.

Whilst I understand that this enables Project Dependency to download the correct module and that this is very important - meeting developer expectations is important too.

alexpott’s picture

Also one of the advantages of the current system is that you can replace modules like webform with webform_patched and modules that depend on webform will still think their dependencies are met. If we start specifying projects then we don't get this flexibility. Obviously the current solution does not break this flexibility but if we enforced this type of dependency management in core we would have this issue. And what happens if there is a webform_patchedNG module?

trobey’s picture

@alexpott: So let me translate this.

  1. Automated testing will always have failures.
  2. I am wasting my time.

Well, I was going to try to dive into the system module but I guess I have better things to do.

hass’s picture

@alexpott: as maintainer of a module it is my decission on what module my module depends. I'm testing with php:php and not with random:php_patchedNG or any other. I need to make sure that only compatible dependencies are installed and not any random modules with the same name just for the reason that an idiot created a duplicate project and have not helped me fixing bugs in my module. I have test failures in google analytics that need to be fixed and I cannot workaround. This makes it impossible to share patches in queue as every "needs review" status ends with a testbot failure and a "needs work" status in *every* issue! This makes project issue queue and automated testing useless and failing in 100%. Is this what we want?

This is really a good solution and we do not force anything. Maintainers can also add test_dependency key with "php:php" and dependency key with "php" only to allow these suxxx flexibility described by you in the info files. I cannot and will never support random module integrations like webform_patched and webform_patchedNG if my module is only supported with webform. The others are outside the game. The developers of the random modules may have not understood how we maintain modules in this community and that we *fix* modules and do not create projects like webform_patched. This only suxxx. We are not on wordpress site where you have no idea what google analytics module you should download out of ~10-20 available ones. These theoretical flexibility is a lot less our problem than the issues we really have.

Independed of the issue here I would force a policy. Unpublish and delete such duplicate projects on d.o. But this is all OT here.

dries’s picture

Category: Feature request » Task
Status: Reviewed & tested by the community » Needs review

I'm reclassifying this as a 'task' as it will help address multiple issues for Testbot, Drush, the packaging scripts, the project pages on drupal.org and Drupal's module installation page. I'm also moving this back to 'needs review' because I don't feel like alexpott's questions have been answered appropriately. I certainly appreciate all the work that has gone into this patch, but I also feel it could use a bit more discussion based on alexpott's feedback. Thanks everyone!

greg.1.anderson’s picture

This issue, from a Drush perspective.

1. Drush will attempt to automatically download a module "foo" when it sees a module "foo" in the dependency list of some other module "bar" (during `drush pm-enable bar`) if there is no "foo" in any downloaded module in the current Drupal site. This patch will help Drush in instances where "bar" wants the "foo" module from the "foo_patched" project. The current workaround is to just manually download "foo_patched" before enabling "bar".

2. Drush has a larger problem when it needs a module "foo" that only exists in some project that is not named "foo". Some folks like to put the "baz_bob" module into the "bazbob" project, for example; less commonly, someone has a dependency on a submodule of a project without depending on the primary module (which is named after the project).

This proposal could help Drush out quite a bit to the extent that folks use it. From a Drush perspective, I am not concerned that "bar" might require "foo:foo" when the end user might prefer "foo_patched:foo"; Drush could simply treat the project name as advisory, and print a warning to the user if it decided to use "foo_patched:foo" ("foo_patched" module already downloaded) instead of the "foo:foo" that was requested (foo module not downloaded).

I don't think Drush will correctly handle downloading two differently-named projects that contain the same module name(s), but that is a Drush issue that does not affect this task. Drush could also really benefit from a modulename-to-projectname mapping service, for existing modules without the project info in the dependency list, but that is also a Drush issue that is perhaps orthogonal to this request (since knowing the project names does not help the testbot select which one should be used).

In conclusion, then, I think that this enhancement is a net win for Drush, and I for one would be interested in seeing it adopted if it meets the needs of other interested parties.

trobey’s picture

I think @greg.1.anderson's comment makes sense. The current patch parses the dependency and returns the project name but does not require it to be used. On the modules page it would allow the red "missing" to be a link to the proper project page. This would be helpful when the module name is different than the project name. For automated processes it would allow the requested project to be downloaded or whatever.

If a module of the same name is already installed but not from the requested project then the behavior is undetermined. It is not just a simple matter of downloading the requested project because I do not think it is possible to install two modules with the same name without encountering problems. Removing the existing module and installing the new project probably is not a good idea. So there has to be some manual intervention.

For Drupal core we only allow projects that are of a compatible version to be installed which is desirable for robustness. As a contributed project maintainer I worry about someone installing a project different from the one that I specified. It is likely that I have not tested with that project so problems are more likely (and those problems will of course be directed at me). But since there will be some manual intervention required there is a range of possible approaches from an emphasis on robustness to an emphasis on flexibility.

Project Dependency does have a table that could be used to map modules to projects. There is no way to currently access that information but it might be possible. But that is another topic.

trobey’s picture

Attached is an expanded patch to show how the project namespace for dependencies could be used in Drupal core. Since the project name is optional there should be no change when the patch is applied. Some instructions for testing are to download a contrib project such as the Devel project. You should download it instead of using Git to install it so that you get the packaging information in the .info.yml files. If you go to the modules page (admin/modules) the four Devel modules should appear under Development. Enable the first module, Devel. Then open the requirements for Devel node access. It should look like:

Version: 8.x-1.x-dev
Requires: Devel, Menu UI, Custom Menu Links

Now go to the devel_node_access.info.yml file. The dependencies should look like:

dependencies:
 - devel
 - menu_ui
tags:
 - developer

# Information added by Drupal.org packaging script on 2014-08-01
version: '8.x-1.x-dev'
core: '8.x'
project: 'devel'
datestamp: 1406909029

Note that the project should show up in the information added by the packaging script on drupal.org. Change this to explicitly specify the project as follows:

dependencies:
 - devel:devel
 - menu_ui

Now the requirements on the modules listing should look like:

Version: 8.x-1.x-dev
Requires: Devel:Devel, Menu UI, Custom Menu Links

Note that when a project name is available the requirements show up as a project:module pair. Also, the project is a link which takes you to the drupal.org page for that project. This greatly simplifies finding projects when the module name is not the same as the project name. Now to demonstrate a mismatch go back to the devel_node_access.info.yml file and change the project in the dependencies to specify the devel module in the Devil project:

dependencies:
 - devil:devel
 - menu_ui

Checking the modules listing the requirements now look like:

Version: 8.x-1.x-dev
Requires: Devil:Devel (mismatch), Menu UI, Custom Menu Links

The modules listing has detected that the installed module has the file devel.info.yml which the packaging information shows as belonging to the Devel project while the Devil project was requested. The link to the project should not work as there is no such project. The mismatch will not be detected if the packaging information is missing or the optional project namespace is missing.

This should demonstrate how the optional project namespace could be used by Drupal core. The demonstration tries to follow the suggestions so far. Since this is demonstration there is no attempt to make sure it does not break something in the tests.

hass’s picture

@alexpott: What exactly is not already answered here?

alexpott’s picture

Status: Needs review » Needs work
Issue tags: +Needs screenshots, +Needs tests

We should be adding a test module with a missing project dependency so that we can test the new behaviour. Much happier now that module page is reporting the missing dependency - but this needs testing. Also since the UI has new behaviour it'd be nice to have a screenshot of this working.

trobey’s picture

Status: Needs work » Needs review
Issue tags: -Needs screenshots, -Needs tests
StatusFileSize
new19.49 KB
new85.66 KB

I have updated the code and added tests of the functionality. The new tests are under Module in Drupal\system\Tests\Module\DependencyTest. The tests use a test project system_project_namespace_test. The test project contains two modules with system_project_namespace_test dependent on system_project_namespace_dependency_test. system_project_namespace_test.info.yml

dependencies:
  - project_namespace_test:system_project_namespace_dependency_test

where the name of the project is incorrectly specified. This creates a mismatch which is shown in the screenshot.

The screenshot shows the project name containing the required module and the project name is linked to drupal.org/project/
. This allows a user to easily find a required module even when the name of the module does not match the project.

Note in the screenshot that just the required module is enabled. Then the other module detects that a module with the same name as required module is installed but the projects do not match (there is no mismatch if there are two uninstalled modules that match the name of the required module). This functions as a warning but does not prevent the module with the requirement from installation later in the test. Also note that the .info.yml files for this test contains the project line that is generated by the packaging in order to detect the mismatch. If either the optional project name in the dependency or the project name in the packaging information is missing then the mismatch is not detected. So the mismatch warning is only helpful in some situations.

claudiu.cristea’s picture

Status: Needs review » Needs work
  1. +++ b/core/lib/Drupal/Core/Extension/InfoParserInterface.php
    @@ -27,7 +27,11 @@
    +   *   - (>x.y): Version requirement with operator and version. (Optional)
    +   *   Example: drupal:system (>=7.22)
    

    Maybe we should suggest a more complex pattern having also comma, telling that the version requirement can be more complex?

  2. +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
    @@ -217,7 +217,8 @@ public function buildModuleDependencies(array $modules) {
    +          $graph[$module->getName()]['edges'][$dependency_data['module']]
    +            = $dependency_data;
    
    +++ b/core/modules/system/src/Form/ModulesListForm.php
    @@ -355,50 +356,78 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
    +            $row['#requires'][$module_name]
    +              = $this->t('!module (<span class="admin-warning">mismatch</span>)', array('!module' => Xss::filter($name)));
    ...
    +            $row['#requires'][$module_name]
    +              = $this->t('!module', array('!module' => Xss::filter($name)));
    

    This an unusual way to wrap lines. Better leave them on a single line.

  3. +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
    @@ -664,6 +665,12 @@ protected function verifyImplementations(&$implementations, $hook) {
    +    if (strpos($dependency, ':')) {
    +      list($project_name, $dependency) = explode(':', $dependency);
    +      $value['project'] = $project_name;
    +    }
    

    In the unlikely case of having $dependency equal to :views_ui the if (...) {...} block will not be executed because strpos() will be 0, leaving the $dependency dirty, with a colon in the first place.

  4. +++ b/core/modules/system/src/Form/ModulesListForm.php
    @@ -355,50 +356,78 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
    +        $project = l(Unicode::ucfirst($dependency['project']), 'https://drupal.org/project/' . $dependency['project']) . ':';
    ...
    +          $project = l(Unicode::ucfirst($dependency['project']), 'https://drupal.org/project/' . $dependency['project']);
    ...
    +          $project = l(Unicode::ucfirst($dependent['project']), 'https://drupal.org/project/' . $dependent['project']) . ':';
    

    Use $this->l() instead l() — I think is available in the class.

    Maybe www. on d.o URL?

hass’s picture

#2. yeah, should be one line.

#3: I do not think we need to handle this as this is not supported and in this case it should break intentionally.

trobey’s picture

Status: Needs work » Needs review
StatusFileSize
new19.49 KB

#3: A colon in the first position is not supported but I updated this anyway since it is a better programming practice.

#4: $this->l() failed tests so I did not make that change. I added the www to d.o.

The updated patch incorporates the suggested changes except for $this->l().

hass’s picture

This suxxx every day more. #2061157: Test stuck in queue. Please commit!!!

jhedstrom’s picture

StatusFileSize
new2.11 KB
new19.57 KB

This replaces l() with $this->l().

Status: Needs review » Needs work

The last submitted patch, 81: project-namespace-for-dependencies-2205271-81.patch, failed testing.

Status: Needs work » Needs review
trobey’s picture

Patch 81 does not work. I said in #79 that I did not include the suggestion for $this->l() because tests failed. So patch 81 added that change and ... tests failed. So patch #79 is still the one that I would suggest using.

Status: Needs review » Needs work

The last submitted patch, 81: project-namespace-for-dependencies-2205271-81.patch, failed testing.

trobey’s picture

Status: Needs work » Needs review

The last submitted patch, 79: project_namespace_for_dependencies-2205271-79.patch, failed testing.

trobey’s picture

I guess if we wait long enough the code changes enough so the patch will no longer work. I will update the patch and resubmit it.

trobey’s picture

I updated the patch. $this->l() has a change to the arguments from l() so I found the change record and made that correction to the patch.

hass’s picture

Priority: Major » Critical
Status: Needs review » Reviewed & tested by the community

Can we get this committed now, please? RTBC this again.

joachim’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record
+++ b/core/lib/Drupal/Core/Extension/InfoParserInterface.php
@@ -27,7 +27,11 @@
+   * - dependencies: An array of strings of the form project:module (>x.y).

This comment doesn't agree with the issue summary: is the project: part optional or not?

Also, AFAIK, current policy is that an unpublished change record must be written before the patch can be committed.

alexpott’s picture

This issue was a major task now critical. To evaluate this and whether we should make this change during the beta, we need to update the issue summary according to https://www.drupal.org/core/beta-changes to explain what improvements it makes and what the disruption of the change would be. Can someone add Drupal 8 beta phase evaluation template to the issue summary.

alexpott’s picture

Priority: Critical » Major

Also considering #91 contains no justification for the criticality according to https://www.drupal.org/core/issue-priority demoting back to major.

hass’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs change record

@Joachim: please read the case first. As noted several times "project:" is optional. A change notice for optional stuff seems not required from my point of view.

joachim’s picture

Status: Reviewed & tested by the community » Needs work

If it's optional, then the documentation in the patch is wrong.

hass’s picture

Status: Needs work » Reviewed & tested by the community

What does the words "Recommended for uniqueness" in the patch tell You?

For me this means it is recommended, but not required and therefore optional.

joachim’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/lib/Drupal/Core/Extension/InfoParserInterface.php
@@ -27,7 +27,11 @@
+   * - dependencies: An array of strings of the form project:module (>x.y).

This bit says it has to be of that form. (And while we're at it, the format should be quoted.)

hass’s picture

Status: Needs work » Reviewed & tested by the community
+++ b/core/lib/Drupal/Core/Extension/InfoParserInterface.php
@@ -27,7 +27,11 @@
+   * - dependencies: An array of strings of the form project:module (>x.y).
+   *   - project: Project shortname. (Recommended to ensure uniqueness)
+   *   - module: Module shortname within the project. (Required)
+   *   - (>x.y): Version requirement with operator and version. (Optional)
+   *   Example: drupal:system (>=8.22, <8.28)

This is more than clear. Can you read the details and tests, please?

trobey’s picture

Issue summary: View changes
trobey’s picture

joachim’s picture

> + * - dependencies: An array of strings of the form project:module (>x.y).

That is untrue, because you can have a string of the form just 'module', which is not the given form. I feel I'm banging my head on a brick wall here.

hass’s picture

That is untrue, because you can have a string of the form just 'module', which is not the given form.

Can you read the other 3 lines, please? These explain what you are looking for. If you ignore them you cannot understand the full picture. The full documentation of how the info strings may look like are on a d.o documentation page. We cannot cover all these complexity and examples in 80 chars inline documentation.

I feel I'm banging my head on a brick wall here.

If I only read the first line and ignore the 3 other lines than maybe.

hass’s picture

https://www.drupal.org/node/542202#dependencies is where the documentation goes after this has been committed. All previous syntax will be supported plus the new syntax with project name.

joachim’s picture

Yes, I can read them.

+++ b/core/lib/Drupal/Core/Extension/InfoParserInterface.php
@@ -27,7 +27,11 @@
+   * - dependencies: An array of strings of the form project:module (>x.y).
+   *   - project: Project shortname. (Recommended to ensure uniqueness)
+   *   - module: Module shortname within the project. (Required)
+   *   - (>x.y): Version requirement with operator and version. (Optional)
+   *   Example: drupal:system (>=8.22, <8.28)
    * - package: The name of the package of modules this module belongs to.

Ok, so a developer who doesn't know Drupal will see that the 'project' part is optional, and therefore write ':module' with the colon...

Look, all that's going to happen is that someone is going to file a documentation bug on this at some point in the future, and we'll shake our heads and sigh at patches that get in without clearly-written documentation :/

trobey’s picture

@joachim: With all due respect I do not think the change to the documentation you are suggesting is advisable. The project name is optional but that is so that the impact on existing projects is negligible. All new code should have the project name supplied. Essentially the use of only the module name for specifying dependencies would be deprecated and discouraged. And why would anyone refuse to provide the project name? They know the project name so it is not a burden. And without the project name they risk having their automated tests broken or their users spending time trying to find the correct project. Can you supply any case where someone would not want to supply the project name?

I would also ask that you consider those of us maintaining the infrastructure for drupal.org including the testbots and the testing infrastructure. I spend a lot of time tracking down problems associated with the testbots and there are others that contribute even more of their time. Once this is committed I do not want to spend an entire day tracking down a problem with the testbots only to have to tell them they should supply the project name in their dependencies. It is a waste of my time and their time.

joachim’s picture

> All new code should have the project name supplied.

What about custom modules that are in a site's codebase and have dependencies on other custom modules? Those are not on d.org and therefore don't have projects.

> Once this is committed I do not want to spend an entire day tracking down a problem with the testbots only to have to tell them they should supply the project name in their dependencies. It is a waste of my time and their time.

That's a very good point. How about we word it to say that modules hosted on d.org must include the project: prefix?

trobey’s picture

You are correct that custom modules do not have a project name. There are three places where I know these dependencies are used. The first is automated testing on drupal.org. This does not apply to custom modules. The second case is on the Modules page for ensuring that dependent modules are enabled. If the project name is supplied then a link is supplied back to the project on drupal.org to help download required modules. The third case is drush which would like to automate downloading projects but currently can only do so in limited cases (how cool would it be to do a drush dl
and have drush ask if you want to download any missing dependencies?). Again, this applies only to projects hosted on drupal.org. But your point is still valid. I suppose if we ever required the project name we could use "custom" in these cases. I updated the patch by hand.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 108: project_namespace_for_dependencies-2205271-108.patch, failed testing.

alexpott’s picture

  1. As per #93 we still need a beta evaluation completed.
  2. +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
    @@ -224,7 +224,7 @@ public function buildModuleDependencies(array $modules) {
    -          $graph[$module->getName()]['edges'][$dependency_data['name']] = $dependency_data;
    +          $graph[$module->getName()]['edges'][$dependency_data['module']] = $dependency_data;
    
    @@ -655,9 +661,8 @@ public static function parseDependency($dependency) {
    -    $value['name'] = trim($parts[0]);
    +    $value['module'] = trim($parts[0]);
    
    +++ b/core/modules/system/system.install
    @@ -528,7 +528,7 @@ function system_requirements($phase) {
    -        $required_module = $requirement['name'];
    +        $required_module = $requirement['module'];
    

    This change is a shame because then the dependency information has nothing that matches the Extension::getName() method. And it makes the current dependency code more difficult to share with themes in future. I'm not sure that this change is really necessary.

  3. +++ b/core/modules/system/css/system.admin.css
    @@ -167,6 +167,9 @@ small .admin-link:after {
     .admin-missing {
       color: #f00;
     }
    +span.admin-warning {
    +  color: #fb0;
    +}
    

    No need for the span also the use of colour here should be UX tested. Warnings elsewhere have a different colour.

  4. +++ b/core/modules/system/src/Form/ModulesListForm.php
    @@ -374,50 +375,79 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
    +        $url = Url::fromUri('https://www.drupal.org/project/' . $dependency['project']);
    +        $project = $this->l(Unicode::ucfirst($dependency['project']), $url) . ':';
    ...
    +          $url = Url::fromUri('https://www.drupal.org/project/' . $dependent['project']);
    +          $project = $this->l(Unicode::ucfirst($dependent['project']), $url) . ':';
    

    I don't think we should be assuming the project is stored on drupal.org. Removing this will reduce the amount of change on the ModulesListForm since all the change to use Xss::filter can be removed.

  5. +++ b/core/modules/system/src/Form/ModulesListForm.php
    @@ -374,50 +375,79 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
    +            $row['#requires'][$module_name] = $this->t('!module (<span class="admin-warning">mismatch</span>)', array('!module' => Xss::filter($name)));
    
    +++ b/core/modules/system/src/Tests/Module/DependencyTest.php
    @@ -14,6 +14,49 @@
    +    $this->assertRaw('Requires: <a href="https://www.drupal.org/project/project_namespace_test">Project_namespace_test</a>:System project namespace dependency (<span class="admin-warning">mismatch</span>)', 'Project mismatch warning works.');
    ...
    +    $this->assertRaw('Requires: <a href="https://www.drupal.org/project/project_namespace_test">Project_namespace_test</a>:System project namespace dependency (<span class="admin-warning">mismatch</span>)', 'Project mismatch warning works.');
    

    How is the user going to know what mismatch means?

Re #108 afaik drush will already download missing dependencies when you try enable a module with missing dependencies.

hass’s picture

#4. That is true. project status url = "http://example.com/release-history" could be set in .info files and than the download is not on d.o. This is possible. As I know the project URL is available in update status module and can be for sure outside of d.o.

Re #108 afaik drush will already download missing dependencies when you try enable a module with missing dependencies.

I do not think that this will work any longer for the php project as it was moved outside of core.

trobey’s picture

Issue summary: View changes
trobey’s picture

I uploaded a new patch.

1. I added a beta evaluation to the issue summary.

2. Near the beginning of this issue it was requested that I change "name" to module." I have changed it back in the new patch.

3. I am not an UX expert. I removed the span and changed the color to match the warning.svg (#e29700).

4. I removed all the links to drupal.org. I removed the Xss:filter.

5. I changed it from "mismatch" to "project mismatch."

As concerns drush, how exactly do you expect drush will automatically download a project that does not match the module name? It is the exact same problem we face with the testbots trying to guess the project. I was wrong about the drush command (drush pm-enable instead of drush dl) but there is a more complete discussion of this by greg.1.anderson (https://www.drupal.org/node/2205271#comment-9013487). I know it is a long issue so it is a bit much to expect anyone to remember or read everything.

hass’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 113: project_namespace_for_dependencies-2205271-113.patch, failed testing.

alexpott’s picture

I wonder if this patch is just trying to do too much. The problem space especially for the UI is extremely complex and this patch only adds a warning that probably will only serve to confuse the user since it does not prevent them from installing the module.

Given that potentially a module could be provided by any number of projects and those individual projects be depended on in conflicting ways, what we are really after is to know where to get the dependency from if it is not the expected place. For example, if a module depends on the webform module in webform_patched we need to know to download http://www.drupal.org/project/webform_patched. But it is possible for another variant to exist as well ie. http://www.drupal.org/project/webform_patched_better and other modules depend on that :(

Another issue is that the project information is only added by the packaging script so if you use git or drush with git deploy your module's info.yml files will not contain the project key. So whether or not the UI works will depend on how someone gets their modules. And even if the project is downloaded through a tarball only the top level .info.yml file has the project information added.

The original problem is that testbot (and drush) can not always determine where to get a dependency of a project. We should focus on that and leave the UI issues behind. The test should just ensure that if the project information is present in the dependency information it is ignored by Drupal's module installer when checking dependencies.

+++ b/core/lib/Drupal/Core/Extension/InfoParserInterface.php
@@ -27,7 +27,13 @@
+   * - dependencies: An array of strings of the form project:module (>x.y).
+   *   - project: Project shortname. (Recommended to ensure uniqueness*)
+   *   - module: Module shortname within the project. (Required)
+   *   - (>x.y): Version requirement with operator and version. (Optional)
+   *   Example: drupal:system (>=8.22, <8.28)
+   *   * Custom modules may not have a project. In this case the project name
+   *     may be omitted (e.g. system (>=8.22, <8.28)).

I think the use of the * here is weird. Just put everything together. Also a bit more text on the subject of uniqueness could be helpful using the examples in this issue.

joachim’s picture

TBH, if you create a webform module in a new project webform_patched, or use it, then you're asking for trouble. Project names on d.org are unique and modules within projects should be namespaced: if people stuck to that we'd be fine.

The webform_patched project shouldn't exist -- its maintainers should have become branch maintainers for the older branches of webform that they wanted to update.

hass’s picture

Another issue is that the project information is only added by the packaging script so if you use git or drush with git deploy your module's info.yml files will not contain the project key.

That is not correct. We are talking about dependency key and not what the packaging does. Packaging does not interfere here at all.

A few if not You only asked for the UI... :-)

alexpott’s picture

Re #118:

  1. The project key is used in the UI, is only added by d.o packaging and it can not be guaranteed to be there - this is a problem.
    +++ b/core/modules/system/src/Form/ModulesListForm.php
    @@ -374,50 +374,76 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
    +          if (isset($dependency['project']) &&
    +            isset($modules[$module_name]->info['project']) &&
    +            $dependency['project'] != $modules[$module_name]->info['project']) {
    

    It is used here

  2. @hass I guess you think #64 is what asked for a UI. All I was pointing out is that the user does not know which webform to install. And they still don't because the webform module dependency can be satisfied by both webform and webform_patched and all they will get is a warning. But yes you are correct that the final patch will probably look more like #61 than what we have now BUT we will have the improved tests ensuring that if the additional project information is in the dependency then it is ignored.
trobey’s picture

It is a sad fact that while a project has a project name on drupal.org the project name only appears in the info files in the lines provided by the packaging script. As I stated way back in comment #65 the critical issue here is fixing the automated testing and providing the same help to drush in locating modules. There are many approaches to using the project information on the modules page but this is not critical and should not hold up fixing the problems with the testbots. I have updated the patch to remove all the UI changes. This leaves six lines of code changes and one line changed in testing and the rest of the lines are documentation changes.

hass’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 120: project_namespace_for_dependencies-2205271-120.patch, failed testing.

trobey’s picture

alexpott’s picture

+++ b/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php
@@ -499,6 +499,7 @@ public function dependencyProvider() {
+      array('drupal:views_ui(>8.x-1.x)', array('project' => 'drupal', 'module' => 'views_ui', 'original_version' => ' (>8.x-1.x)', 'versions' => array(array('op' => '>', 'version' => '2.x')))),

This should be 'name' => 'views_ui'

Also I think we should still include test modules to ensure that having project in dependency information does not break anything.

trobey’s picture

Status: Needs work » Needs review
StatusFileSize
new6.17 KB

I added a test module that uses a project namespace dependency.

alexpott’s picture

  1. +++ b/core/modules/system/src/Tests/Module/DependencyTest.php
    @@ -14,6 +14,36 @@
    +   /**
    +   * Checks functionality of project namespaces for dependencies.
    +   */
    +  function testProjectNamespaceForDependencies() {
    

    The method should have a public scope. Also the docblock indentation of the first line is incorrect.

  2. +++ b/core/modules/system/tests/modules/system_project_namespace_test/system_project_namespace_test.info.yml
    @@ -0,0 +1,8 @@
    +  - drupal:taxonomy
    

    Let's make this dependent on filter so the test does not have to install so many modules.

  3. Whilst thinking about this issue I wonder if we should stop trying to cram everything into a single string. We could still support the short format but we could also support a long format like:
    dependencies:
      - webform:
          project: webform_patched
          version: >8.x-1.x
    

    This would have the advantage of making dependency information more extensible in the future.

trobey’s picture

1) I copied the format of all the other functions in this file. If they are wrong then it should be corrected in a separate issue. I fixed the indentation.

2) I changed the dependency to filter.

3) This is expanding the scope of this patch. I think it would be better handled as a separate issue.

alexpott’s picture

Status: Needs review » Needs work

It would be great if the test can explain what it is testing - ie. that project namespaces in dependencies are ignored. To that end...

+++ b/core/modules/system/tests/modules/system_project_namespace_test/system_project_namespace_test.info.yml
@@ -0,0 +1,8 @@
+dependencies:
+  - drupal:filter

Let's change drupal to something that should obviously be ignored and and more information to the test.

Regarding #127.1 - two wrongs don't make a right.

How is #127.3 expanding the scope? We're adding more information to the dependencies stored in .info.yml - this is just another way. That said this problem does not just affect Drupal 8 so going with a backportable solution probably makes sense.

Also the suggested structure is not easy to port to .info...

dependencies:
  - webform:
      project: webform_patched
      version: >8.x-1.x
  - node

... would be something like...

dependencies[0][webform][project] = webform
dependencies[0][webform][project] = >8.x-1.x
dependencies[1] = node

So possible but hard coding numeric keys is ugly.

hass’s picture

It may be a lot easier to implement the more flexible structure for D8 now and backport the feature itself to D7 with a single string variant. I'm not sure how many discussions we will run into about this if we have it different between D8 and D7, but I also think the suggested structure looks cleaner. For future we can make it therefore better, but for the current D6/D7 state of the art we have at least a workaround with the string. Not every maintainer will add the project name to D7, but for D8 we can do better from day one. Should we go this direction now? Will we really get this in?

alexpott’s picture

@hass I've looked at this a bit more. It's just not worth it. We should refactor this in 9.0.x there is too much madness in ModuleHandler::parseDependency()... for instance rebuilding the original version information...

      $value['original_version'] = ' (' . $parts[1];

... a sticking a space on the front. Why would we want that? :(

alexpott’s picture

Got to love Drupal... a later we remove it and the brackets

        $compatibility = drupal_check_incompatibility($requirement, $version);
        if ($compatibility) {
          $compatibility = rtrim(substr($compatibility, 2), ')');
trobey’s picture

We changed the comment for the test for the project namespace. It is not a good idea to change "drupal" to something else. At some point Drupal will use this information and as the code changes this test will then fail. Sure, it can always be changed at that time but why make things harder?

Every time we have been asked in this issue to expand the scope it has only slowed down progress and confused the issue. And eventually gets rolled back. We have learned the hard way to say no to scope expansion. There currently are contrib projects where automated tests do not work. This is a big impact on their development. How would you feel if the automated testing for Drupal core was broken? We would have people screaming for us to get it fixed. These contrib projects have not had automated testing working for almost a year. It may not be a critical issue for Drupal core but you can bet it is critical for those projects and for Project Dependency. That is not good for their development, software quality and Drupal's image.

We are very familiar with the code in parseDependency. We keep having to port it. Drupal.org uses Drupal 7 but Project Dependency has to read info files from Drupal 6, 7 and 8. Drupal core keeps removing the code to read past versions of info files. Thus Drupal 8 only reads Drupal 8 info files. But when drupal.org gets ported to Drupal 8 we will need to add code so we can read Drupal 7 (and 6) info files. If parseDependency changes and the new format is used then it will break Project Dependency. We will have to port the changes back to Project Dependency. Right now we have code that is ready to commit to Project Dependency to use the project namespace format. We have not looked at it in almost a year. The longer this goes on the more likely there are going to be problems with automated testing while we figure out the code again and get it committed. Already we worry it is no longer going to be a smooth process. On top of that, waiting until there are a rush of projects updating to Drupal 8 is not a good idea.

hass’s picture

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

I was asked in IRC to see if I could help with the documentation in this patch... several patches ago.

There are two chunks of documentation, and I think both of them are at best misleading, and in addition, they both have some formatting and punctuation/grammar problems.

a) InfoParserInterface - in patch:

+   * - dependencies: An array of strings of the form project:module (>x.y).
+   *   - project: Project shortname. (Recommended to ensure uniqueness.
+   *     Multiple projects may have modules with the same name which breaks
+   *     automated testing among other things.  Custom modules may not have a
+   *     project name.  in this case just the module name can be specified.)
+   *   - module: Module shortname within the project. (Required)
+   *   - (>x.y): Version requirement with operator and version. (Optional)
+   *   Example for project hosted on drupal.org:
+   *     drupal:system (>=8.22, <8.28)
+   *   Example for a custom module:
+   *     system (>=8.22, <8.28)

The two Example lines are not indented right, and there are grammar/punctuation problems... how about:

   * - dependencies: An array of dependency strings. Each is in the form
   *   'project:module (versions)'; with the following meanings:
   *   - project: (optional) Project shortname, recommended to ensure
   *     uniqueness, if the module is part of a project hosted on drupal.org.
   *     If omitted, also omit the : that follows.
   *   - module: (required) Module shortname within the project.
   *   - (versions): Version information, consisting of one or more
   *     comma-separated operator/value pairs or simply version numbers, which
   *     can contain "x" as a wildcard. Examples: (>=8.22, <8.28), (8.x-3.x).

b) ModuleHandler - from the patch:

+   *   A dependency string, for example 'project:module (>=8.x-4.5-beta5, 3.x)'.

My suggestion for this would be (this needs to be wrapped at 80 character lines):

A dependency string, which specifies a module dependency, and optionally the project it comes from and versions that are supported. Supported formats: 'module', 'project:module', 'project:module (>=8.x-4.5-beta5, 8.x-3.x)'.

trobey’s picture

Status: Needs work » Needs review
StatusFileSize
new5.79 KB

I updated the documentation.

jhodgdon’s picture

Status: Needs review » Needs work

Thank you!

So in the second piece:

+   *   A dependency string, which specifies a module dependency, and optionally
+   *   the project it comes from and versions that are supported. Supported
+   *   formats:
+   *     'module'
+   *     'project:module',
+   *     'project:module (>=8.x-4.5-beta5, 8.x-3.x)'

The list of examples should either use list format (see https://drupal.org/node/1354#lists) or the formats should just be in-line separated by commas.

trobey’s picture

In-line with commas looks horrible since there are strings that should not be broken. I added the dashes for the list.

trobey’s picture

Status: Needs work » Needs review
alexpott’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
@@ -633,7 +633,12 @@ protected function verifyImplementations(&$implementations, $hook) {
+   *   the project it comes from and versions that are supported. Supported
+   *   formats:
+   *     - 'module'
+   *     - 'project:module',
+   *     - 'project:module (>=8.x-4.5-beta5, 8.x-3.x)'

Either a missing comma or a misplaced comma. I think the comma is unnecessary.

Also this list looks exhaustive, because of the words Supported formats:. I suggest changing this to Supported formats include:. Or including module (versions). Also mixing project:module with (>=8.x-4.5-beta5, 8.x-3.x) is weird since we're mixing placeholders with real values.

alexpott’s picture

@trobey re #132 there's far too much I in that comment. You seem to be forgetting that Drupal is about we.

alexpott’s picture

The issue summary needs to be updated (and probably the CR) to reflect the fact the including the project dependency information has 0 impact on module installation and dependency calculation within Drupal core code. Since it is totally reasonable to expect the information to have some effect. Also the code documentation should be updated to reflect this too.

trobey’s picture

Issue summary: View changes
trobey’s picture

Issue summary: View changes
trobey’s picture

Status: Needs work » Needs review
Issue tags: -Needs issue summary update
StatusFileSize
new5.89 KB

We updated the issue summary to add that this patch has no effect on module installation and dependency calculation in Drupal core. We also updated the change record. We also changed everything to "we" in comment #132. We also updated the patch to remove the comma and change "Supported formats" to "Supported formats include." We changed the specific versions to the word version in the example templates. We also updated the code documentation to mention this change is currently ignored in Drupal core but is used for automated testing.

We also have a new related issue that is reporting a problem with the Twitter project due to this design flaw.

jhodgdon’s picture

Status: Needs review » Needs work

The docs formatting in ModuleHandler is still not quite right:

+   *   A dependency string, which specifies a module dependency, and optionally
+   *   the project it comes from and versions that are supported. Supported
+   *   formats include:
+   *     - 'module'
+   *     - 'project:module'
+   *     - 'project:module (>=version, version)'

The - should line up with the previous line. See https://www.drupal.org/node/1354#lists

trobey’s picture

Status: Needs work » Needs review
StatusFileSize
new5.88 KB

We fixed it and uploaded a new patch.

jhodgdon’s picture

Thanks! Docs look good to me now. I will leave the rest of the review to others.

damienmckenna’s picture

hass’s picture

Can we get this patch committed now, please?

hass’s picture

Status: Needs review » Reviewed & tested by the community

All green

alexpott’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed 305ed67 and pushed to 8.0.x. Thanks!

Thank you for adding the beta evaluation to the issue summary.

  • alexpott committed 305ed67 on 8.0.x
    Issue #2205271 by trobey, jhedstrom: Project namespace for dependencies
    
xano’s picture

I just tried to add this to Payment 8.x-2.x. The testbot handles it fine, but core seems to have problems with the new format.

hass’s picture

The testbot is not yet able to use the new format. The project dependency patch has not been deployed to d.o yet. I guess this is #2047557: Support Drupal 8-style *.info.yml files

alexpott’s picture

hass’s picture

@trobey: Do you plan to backport this to D7? You know we cannot RTBC our own patches... *hint*

trobey’s picture

@Hass: @DamienMcKenna was supposed to be looking into backporting to Drupal 7. I was going to wait a bit and catch my breathe and see if he comes up with anything. If not I should be able to put a patch together very quickly.

damienmckenna’s picture

@trobey: I haven't gotten to it yet, feel free to give it a try.

trobey’s picture

Here is a first try at a patch for Drupal 7.

hass’s picture

Status: Patch (to be ported) » Needs review
attiks’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks good, thanks for the backport

David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +7.40 release notes, +7.40 release announcement

Committed to 7.x - thanks! This looks like a nice improvement.

I fixed the following on commit (the first because it was in the Drupal 8 commit but seemed to just be flat-out missing from the backport, the second I reverted because it wasn't in the Drupal 8 commit and in fact looks inaccurate in a couple ways... we should have a followup issue to add that documentation though):

diff --git a/includes/common.inc b/includes/common.inc
index 91370e5..acef70a 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -7368,7 +7368,16 @@ function drupal_write_record($table, &$record, $primary_keys = array()) {
  * Information stored in a module .info file:
  * - name: The real name of the module for display purposes.
  * - description: A brief description of the module.
- * - dependencies: An array of shortnames of other modules this module requires.
+ * - dependencies: An array of dependency strings. Each is in the form
+ *   'project:module (versions)'; with the following meanings:
+ *   - project: (optional) Project shortname, recommended to ensure uniqueness,
+ *     if the module is part of a project hosted on drupal.org. If omitted,
+ *     also omit the : that follows. The project name is currently ignored by
+ *     Drupal core but is used for automated testing.
+ *   - module: (required) Module shortname within the project.
+ *   - (versions): Optional version information, consisting of one or more
+ *     comma-separated operator/value pairs or simply version numbers, which
+ *     can contain "x" as a wildcard. Examples: (>=7.22, <7.28), (7.x-3.x).
  * - package: The name of the package of modules this module belongs to.
  *
  * See forum.info for an example of a module .info file.
@@ -7662,8 +7671,7 @@ function debug($data, $label = NULL, $print_r = FALSE) {
  *
  * @return
  *   An associative array with three keys:
- *   - 'project' includes the name of the project containing the module.
- *   - 'name' includes the name of the module to depend on.
+ *   - 'name' includes the name of the thing to depend on (e.g. 'foo').
  *   - 'original_version' contains the original version string (which can be
  *     used in the UI for reporting incompatibilities).
  *   - 'versions' is a list of associative arrays, each containing the keys

  • David_Rothstein committed c60d7b0 on 7.x
    Issue #2205271 by trobey, jhedstrom, hass, alexpott, chx, joachim,...
David_Rothstein’s picture

I created a followup issue for the above-mentioned documentation change, and also updated the change notice for this issue so it applies to Drupal 7 also. Please review: https://www.drupal.org/node/2299747/revisions/view/8461810/8979767

Status: Fixed » Closed (fixed)

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

cweagans’s picture

Coming here from #2660992: Due incorrect dependency information, the module can not installed via composer and #2551703: Store composer.json if present.

I know it's a bit late to do this, so my apologies - but I think this should be reverted entirely unless I'm missing something. The entire premise of this change is based on the idea that I should be able to choose the project namespace that the "webform" module comes from, and I don't think that's a valid claim. We encourage people to collaborate on things for a reason: we don't want a zillion different webform projects that do the same thing, except for tiny variances. That's just setting people up for pain. hass had the problem that specifying a dependency on the "php" module was not actually downloading the contrib php module. That sounds like an issue with either the testbot or project_dependency, and really isn't something that core should have to work around. "If there's no PHP module available, then google_analytics can't be installed" is about as far as core should go. With this patch, though, if there is a valid reason to use webform_patched instead of just webform, I can't do that anymore if someone specifies the project namespace.

I'd suggest that a very simple fix here would involve leaving the dependencies key alone, and adding a new key that was something like "testbot_project_dependencies" or something, which would simply be a list of project namespaces (and not module names) to download as part of a test run.

If nothing else, does anyone have an objection to softening the language in the change notice? I don't think all new code needs to specify " - pathauto:pathauto (>=8.1.x)" when a simple " - pathauto" will do. I don't see any reason for encouraging people to do this unless they specifically need a module from another project namespace, or if the project namespace isn't clear (i.e. Features Extra submodules).

There was not a lot of support for doing this other than from trobey and maybe hass, and there was explicit disagreement on that point from chx and maybe others (I read the issue very quickly, so may have missed someone). This needs wider discussion before we say that the more verbose way is the "recommended" way of doing things.

EDIT: Removed some words that didn't make sense after I reordered the points in my comment.

David_Rothstein’s picture

I thought the main reason for this was to support automatically downloading modules that don't have the same name as the project they live in (and not just by the testbot, but also Drush).

For example if you have dependencies[] = date_api in an info file, Drush has no way to know that https://www.drupal.org/project/date is the project it needs to download to resolve that dependency. But if you use dependencies[] = date:date_api then it can.

Following the link from the change notice to https://github.com/drush-ops/drush/issues/1731 it seems like Drush might support that now (since the patch here was committed) but I haven't tested it myself.

I agree with you about the change notice though:

  • An example like the above would make more sense to include there than the "webform_patched" example.
  • "pathauto:pathauto" sounds redundant to me also.
hass’s picture

There is test_dependencies for testing only. I only use this in ga. However I think this is a valid aproach and must not rolled back.

If module should not support webform_patched than it is not allowed to use it. It may be hard, but it's also a way to tell people to collaborate and not fork. It also helps not ending in the wordpress mess. Hard, but maybe intentionally. I personally do not use this (and see it as last resort decission), but I see the reasons for doing this and like it.

quicksketch’s picture

The Date/Date API example is the primary reason for this functionality, and I think it's a great improvement as well. The webform_patched example might be an alternative use of this, but not the main reason it was added.

I updated the documentation for writing .info files at https://www.drupal.org/node/542202#dependencies.

dave reid’s picture

I think my major problem is that the change record and documentation seem to indicate that this is the only way to specify dependencies, and that in most cases, like, if you depend on ctools or token modules, this results in additional confusion over 'ctools:ctools' and 'token:token', in addition to modules possibly breaking people using Drupal < 7.40 when attempting to run database updates.

I would assume the new syntax should be used in the cases of date:date_api where project name <> module name, but that is not very clear.

dave reid’s picture

dave reid’s picture

This change in the documentation made sense to me, because it's clearly about ambiguous dependencies, and indicates that it requires Drupal 7.40: https://www.drupal.org/node/542202/revisions/view/9119944/9541547

The change in the above general section about dependencies is what confused me and I think should be reverted: https://www.drupal.org/node/542202/revisions/view/9541547/9556989

dave reid’s picture

I made the following edit to the section on .info files in D7, leaving most of the explanation about project dependencies in the project dependency section, and noting that in most cases, just the simple non-project dependency information is needed. https://www.drupal.org/node/542202/revisions/view/9557153/9800823

trobey’s picture

It is true that project namespaces are not required but the results without them are unpredictable. I added code to Project Dependency to prefer a project of the same name as the module name but this is not guaranteed. In view of the complexity of the code for calculating dependencies I think relying on this is putting more faith in my fix than I would have myself. So if you omit the project namespace it is done at your own risk. Unlike D8, this change was introduced late in the D7 life cycle so adding project namespaces is a concern if using old versions of D7 core. If maintainers are worried about old versions of D7 core and they have not had a problem with getting the wrong dependencies then I do not see anything wrong with waiting until there is a problem before adding a project namespace. At least project maintainers have an option now to fix problems with dependencies. Project namespaces are recommended for D8.

I might note that the number of issues filed on Project Dependency has slowed to a trickle since this change was implemented. This has greatly reduced the time that several of us were spending chasing down issues that could not be solved. There are some obscure issues for Project Dependency that I probably will not be able to tackle until project namespaces are required but they are not urgent (yet).

Mixologic’s picture

Bad news. This patch did not address all of the places in core that introspect the .info files.

Apparently installation profiles *also* check to validate their required dependencies and assume that any module listed in an install profiles .info file becomes a required module, and it parses each listed modules info files, and makes the assumption that the name is the module that needs to be listed.

Please refer to #2855026: Installation profiles do not support project:module format for dependencies .

mikran’s picture