Am seeking advice on how to handle an odd problem.

The Twitter module on D6 requires the "oauth_common" module from the OAuth package, so there's a dependencies[] line in twitter.info for "oauth_common". Because the correct oauth_common module comes from the oauth package I added a test_dependencies[] line for "oauth", which helped make sure the D7 version works. However, there is no 7.x-1.x branch of the outh_common package so it doesn't have any problems with the D7 branches.

When testbot downloads the Twitter module for D6 it see the oauth_common dependency and then goes hunting for the oauth_common package. Testbot finds the package, so then downloads git://git.drupal.org/project/oauth_common.git. Incidentally, it also downloads git://git.drupal.org/project/oauth.git because of the test_dependencies[] line. it then enables "oauth_common", which Drupal's module system identifies as coming from the oauth_common package rather than oauth, and fails because the Twitter module expects the correct API.

So the question is: what can be done to fix this mess so that Twitter tests for 6.x-5.x will pass? Might it help to rename the 6.x-1.x branch on the oauth_common package so that even if it's downloaded that there won't be something for Drupal to try to install?

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

I've opened #2562799: Deprecate this module, rename branches so that Twitter module's tests can work again for the oauth_common module, hopefully approaching the problem from that side might be easier than making changes to testbot.

damienmckenna’s picture

Project: Drupal.org Testbots » DrupalCI: Drupal.org Testing Infrastructure

Moving this to the DrupalCI project.

jthorson’s picture

Project: DrupalCI: Drupal.org Testing Infrastructure » Project Dependency
Version: » 7.x-1.x-dev

Dependency and checkout calculations are the realm of Project Dependency.

trobey’s picture

I hesitate to comment on this issue since it seems like everyone else has put their hat on and I am sadly lacking.

To sum up the problem Twitter 6.x-5.x requires oauth_common. The OAuth project has a release 6.x-3.0-beta5 which has the oauth_common and oauth_common_providerui components (modules). The dependencies for this release include the OAuth Common project. So even the OAuth project with an oauth_common module is pulling in the OAuth Common project's oauth_common module! The OAuth Common project release 6.x-2.0-beta2 has a single module oauth_common. So there are two projects that have oauth_common modules. More on why this happens below.

Module names are not unique. For Drupal 8 and Drupal 7 I spent a year getting patches accepted for Drupal core where this ambiguity could be resolved using project namespaces. For Drupal 7 this would look like:

dependencies[] = oauth:oauth_common

Then it would be clear which oauth_common module is required. But this patch has not been backported to Drupal 6 and that is not likely to happen since Drupal 6 is reaching end of support soon.

So why does a dependency on oauth_common find OAuth Common which does not even have a recommended release? The reason is that the Project Dependency code first looks for a project with the same name as the required module. So if you are looking for the webform module it will find the webform project instead of the webform_patched project. But no matter the heuristic employed it is going to be wrong sometimes.

In this case there probably is a work around. Note that the dependencies have the specification

dependencies[] = module (>=version)

Since OAuth Common is using 6.x-2.0-beta2 then specifying the dependency

dependencies[] = oauth_common (>= 6.x-2.1)

should avoid selecting OAuth Common. This may force some people using old versions of OAuth to update but those cases are probably rare.