Background
Occasionally, project maintainers will forget to select the recommended version when they release new versions to drupal.org. Currently cck, captcha, features_extra, and media_vimeo are among those with no recommended version although they all have supported versions. If drush pm-download encounters a project without a recommended version, it will prompt the user to select from a list of recent versions unless the --select option is set to 'never'. If the assume yes option is set, pm-download will display the user prompt, but then continue on to download the most recent non-dev version (unless the --dev option is also specified).
drush make, by default sets the --select option to 'never'. When it encounters a project where the version is not specified in the makefile and the recommended version is not set by the maintainer, it will continue on without downloading the project or issuing a warning. The result is a broken site with unresolved dependencies. Example, the OpenChurch installation profile. The simplest fix is to change the default select option to 'auto' where drush make calls release_info_fetch. This changes the behavior of 'drush make' to be more like 'drush pm-download'.
It's not clear to me if the purpose of the --select=never option was to never prompt the user, or to never download the project. Currently, it does both which might be a bug if the intent was only to suppress the user prompt.
I'll prepare a patch when I have time tomorrow.
Comments
Comment #1
jonhattanNever prompt. See #1371220: release_info_fetch() $select should be more flexible.
If make fails silently this is a bug.
Comment #2
dude4linux CreditAttribution: dude4linux commentedThen we must have a bug. Here is a repeatable test.
Results from drush make. Note: the duplicate download is another bug - see 1417020#14
drush environment
Comment #3
dude4linux CreditAttribution: dude4linux commentedSorry, I forgot to include
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedI think the pm code is working as designed so I changed this to 'auto' and committed. See 63170a4f95cf653e687454d8978de3ca4fd97359
Comment #5
dude4linux CreditAttribution: dude4linux commented@moshe - Thanks for looking into this. When I opened this ticket, I thought that setting the 'auto' select mode would be sufficient, however, additional testing showed there are error cases that aren't handled. Currently there are four modules I'm aware of that don't have a recommended version selected, cck, captcha, features_extra, and media_vimeo.
My testing showed that setting select to 'auto' works for two of the above cases, cck and features_extra. The catch is that when more that one option is presented to the user, the assume_yes option defaults to cancel rather than continue so both captcha and media_vimeo fail to install. I've been working on testing an alternative patch which modifies updatexml_parse_release to return the latest supported release if no recommended release is found. It works for all four of the test cases, but I've been hesitant to post it because it also impacts the behavior of pm-download.
Add the following code to function updatexml_parse_release($request, $xml, $restrict_to = '') in commands/pm/release_info/updatexml.inc after "recommended" release and before "development" release.
Comment #6
dude4linux CreditAttribution: dude4linux commentedHere is a patch to make the change described above. Working on testing to make sure it causes no harm.
Comment #7
dude4linux CreditAttribution: dude4linux commentedResults of unit testing:
I can't see that this is related to my patch since it occurs with and without the patch installed.
A couple of thoughts:
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedPatch is 0 bytes.
Comment #9
dude4linux CreditAttribution: dude4linux commentedOpps. Sorry, my first attempt to use format-patch. I've got to learn to check everything twice :)
This should work better.
Comment #10
moshe weitzman CreditAttribution: moshe weitzman commentedComment #11
jonhattanCommitted a refactor of the resulting code after applying #9.
Also reverted
select => auto
. Interactivity is bad for makefiles.