I'm trying to force the testbot to use feeds-6.x-1.x-dev as a dependency for Mailhandler. I added test_dependencies[] = feeds (>1.0-beta12) to the info file and waited for a dev snapshot to roll, but the testbot is still checking out feeds-6.x-1.0-beta12 instead of feeds-6.x-1.x-dev

Do the dependencies need to be rebuilt, or am I specifying the dependency incorrectly? Thanks.

Comments

rfay’s picture

I don't think the dev is considered greater than.

If you want the dev, specify the dev as the release.

I think that would be

test_dependencies[] = feeds (6.x-1.x-dev)
Dane Powell’s picture

I changed the test_dependencies in mailhandler.info and waited for the nightly dev to roll, but the tests are still getting feeds 6.x-1.0-beta12.

rfay’s picture

What's going on here is that mailhandler_default.info specifies feeds as a dependency without any further restrictions.

A regular dependency trumps a test_dependency, so I believe that's what's going on.

I did rebuild and saw what you saw, so checked it out to look further.

Dane Powell’s picture

Hrm... I added the test_dependencies line to mailhandler_default.info, but the problem remains. Note that mailhandler.info also lists feeds as a dependency, so I'm not sure why mailhandler_default.info is unique.

You say that regular dependencies trump test dependencies, so do I need to list the specific feeds version in the regular dependencies as well (even though Drupal core will ignore it in 6.x)?

rfay’s picture

If you have a regular unversioned dependencies[] on feeds *anywhere in any .info file* it will choose the recommended release. And if both dependencies[] and test_dependencies[] are found, then dependencies[] wins.

I *believe* dependency specification is a working feature in D6. Of course, what it does is to prevent enabling of a depending module if the dependency is not properly there.

Dane Powell’s picture

I added the version to the feeds dependencies in both .info files, but it's still not working. I might poke through project_dependency to see if I can figure out exactly where this is breaking down, since I'm getting kind of tired of pushing junk commits to d.o ;) Let me know if you have any other suggestions though. Thanks for the help so far.

Dane Powell’s picture

I installed a development version of project/project_dependency, but I realize now that I don't have time to go poking around it blindly. Can you recommend anything else to try?

Currently, the two .info files with feeds listed as dependencies look like this:

// mailhandler.info
name = Mailhandler
description = Accepts submissions via e-mail. Requires at least one retrieval plugin (the Mailhandler PHP IMAP module is recommended).
core = 6.x
dependencies[] = "ctools"
dependencies[] = feeds (6.x-1.x-dev)
// mailhandler_default.info
name = "Mailhandler quick-start"
description = "An example importer, source content type, and mailbox to get you started."
core = "6.x"
package = "Mailhandler"
dependencies[] = "features"
dependencies[] = feeds (6.x-1.x-dev)
dependencies[] = "feeds_ui"
rfay’s picture

Title: Rebuild dependencies for Mailhandler 6.x-2.x » Mailhandler 6.x-2.x dependencies do not find correct feeds version

I'll try to take a look at it this week. It is pretty hard to work on with without a d.o dump. Don't forget that begging feeds for a new release is an option for you.

rfay’s picture

I've spent a couple of sessions with this this week but don't have any traction yet. I have developed an easy way to use a local authoritative repo instead of using the d.o repo, so I can arbitrarily make commits to any project, so that's good. But haven't solved it yet.

At this point, when I give a (6.x-1.x-dev) version to feeds and feeds_ui, I end up with an *empty* array for the release that is to be loaded.

Dane Powell’s picture

Yuck, sorry to hear that. Meanwhile, I've posted a request for a new Feeds release, but that issue hasn't gained any traction yet: #1853162: Release 6.x-1.0-beta13 or 6.x-1.0-rc1

Thanks for working on this.

rfay’s picture

Category: task » support

I hate to say it, but this is actually a misunderstanding about what drupal_parse_incompatibility() can actually do.

          // Drupal considers "2.x" to mean any version that begins with
          // "2" (e.g. 2.0, 2.9 are all "2.x"). PHP's version_compare(),
          // on the other hand, treats "x" as a string; so to
          // version_compare(), "2.x" is considered less than 2.0. This
          // means that >=2.x and <2.x are handled by version_compare()
          // as we need, but > and <= are not.

As a result of that, *any* 6.x-1.anything is considered to be compatible with the version string "6.x-1.x-dev". In your case, that means that 6.x-1.0-beta14 and every other 6.x-1.0-* release of feeds is compatible with "6.x-1.x-dev"

So I don't think there is a way to force a dev release by using version strings.

Now, there is an open question about what version to use by default. Currently we use the recommended release if possible, or the most recent release otherwise. I suspect that's the correct thing to do. But we could add code that would use the recommended release first, the dev release second, and the most recent otherwise. But that wouldn't help you at all.

The logic in project_dependency is below. I believe it would work right if the potential versions got sorted out right by the drupal_parse_dependency().

      // We choose to use the project of the most recently created release
      // node. This is not guaranteed, but is a heuristic. Is there another?
      $first_dependent_release = reset($possible_dependent_releases);
      $dependent_pid = $first_dependent_release->pid;
      $recommended_release = project_release_get_current_recommended($dependent_pid, $api_term->tid);

      // If we found a recommended release for this project and that release
      // also contains this component, accept it.
      if (!empty($recommended_release) && !empty($possible_dependent_releases[$recommended_release->nid])) {
        // Accept the recommended release for the project used.
        $release = $possible_dependent_releases[$recommended_release->nid];
      }
      else {
        // The recommended release does not contain the component, so just
        // punt and accept the first release that was found.
        $release = $first_dependent_release;
      }
rfay’s picture

@twistor is the very faithful maintainer of feeds. I recommend pinging him via the contact form to request a new version. I doubt he'll delay.

Dane Powell’s picture

This sure is a pretty kettle of fish. Thanks for looking into it, I'll ping twistor directly.

isntall’s picture

Project: Drupal.org Testbots » DrupalCI: Drupal.org Testing Infrastructure
Component: unexplained test failure » Code
Issue summary: View changes
Status: Active » Postponed
jthorson’s picture

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

Project Dependency or core ... but not DrupalCI.

And possibly already resolved. Sending to Project_Dependency to find out.

trobey’s picture

Project Dependency just calls drupal_check_incompatibility()in order to be consistent with core. This just calls PHP's version_compare(). So open up a place where you can put some PHP test code and with the devel project. Start with the following:

dpm(version_compare('6.x-1.0', '6.x-1.1', '<'));

The result is TRUE. So let's try 6.x-1.x:

dpm(version_compare('6.x-1.0', '6.x-1.x', '<'));

which returns FALSE. If we switch this to the less obvious

dpm(version_compare('6.x-1.x', '6.x-1.0', '<'));

So, if you want to require the dev version you should

dependencies[] = feeds (<6.x-1.0)

or

dependencies[] = feeds (6.x-1.x)