Trying to do drush make on a make file containing the lines:

projects[media][version] = 1.3
projects[media][patch][] = https://drupal.org/files/1301774-remove-form-autosubmit-12.patch

I get this error:

The patch 'https://drupal.org/files/1301774-remove-form-autosubmit-12.patch' is not hosted on drupal.org.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Yup, that's a bug. It's hard-coded to only look for http. It's just using strpos() on a string literal. We probably want preg_match() and a regexp.

beeradb’s picture

Status: Active » Needs review
FileSize
1.74 KB

And here we are. There is some fuzz in the patch as well, removing trailing whitespace from a line.

killes@www.drop.org’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

beeradb’s picture

FileSize
2.24 KB

Updated regex for readability, and also changed the help text to specify it's a regex not a URL.

dww’s picture

Status: Reviewed & tested by the community » Needs work

Excellent, thanks!

A) Can we please add another unit test about this?

B) Why preg_grep() on an array with one element instead of just using preg_match()?

C) This should probably be postponed on #2012054: PHPunit tests are currently failing in master

Thanks again,
-Derek

dww’s picture

Assigned: Unassigned » dww

Now that #2012054: PHPunit tests are currently failing in master is done, I'm working on a test for this. Stay tuned.

dww’s picture

Status: Needs work » Needs review
FileSize
675 bytes
2.19 KB
2.59 KB

Here's a patch with just the new tests. Without the actual patch applied:

Time: 16 seconds, Memory: 5.00Mb

There were 2 failures:

1) drupalorgDrushMakeTestCase::testMakeDoSucceedHttps
Unexpected exit code: /.../drush --include=/.../drupalorg_drush/tests/.. --nocolor make /.../drupalorg_drush/tests/makefiles/do-succeed-https.make --test --md5=print --drupal-org --drupal-org-whitelist-url=file:///.../drupalorg_drush/tests/packaging_whitelist_data
Failed asserting that 1 matches expected 0.

/.../drush5/tests/drush_testcase.inc:332
/.../drush5/tests/drush_testcase.inc:399
/.../drupalorg_drush/tests/drupalorgTest.php:36
/.../drupalorg_drush/tests/drupalorgTest.php:82

2) drupalorgDrushMakeTestCase::testVerifyMakefileDoSucceedHttps
Unexpected exit code: /.../drush --include=/.../drupalorg_drush/tests/.. --nocolor verify-makefile /.../drupalorg_drush/tests/makefiles/do-succeed-https.make --test --md5=print --drupal-org --drupal-org-whitelist-url=file:///.../drupalorg_drush/tests/packaging_whitelist_data
Failed asserting that 1 matches expected 0.

/.../drush5/tests/drush_testcase.inc:332
/.../drush5/tests/drush_testcase.inc:399
/.../drupalorg_drush/tests/drupalorgTest.php:36
/.../drupalorg_drush/tests/drupalorgTest.php:138

FAILURES!
Tests: 31, Assertions: 36, Failures: 2.

Then, after applying the attached patch (which uses preg_match() instead of preg_grep()), it's all happy:

Time: 16 seconds, Memory: 4.75Mb

OK (31 tests, 37 assertions)

I think we're good here. Any final objections before I commit/push?

Thanks!
-Derek

beeradb’s picture

Status: Needs review » Reviewed & tested by the community

This look good to me. moving to preg_match over preg_grep is a good move. not sure what I was thinking.

Ran the tests locally and got the same results, test cases look sane, this is good to go.

dww’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +needs drupal.org deployment

Pushed #4 as beerabd:

http://drupalcode.org/project/drupalorg_drush.git/commit/0236ec7

And then my tests and fix for preg_match() from #7:

http://drupalcode.org/project/drupalorg_drush.git/commit/0995a6f

Thanks!
-Derek

dww’s picture

Issue tags: -needs drupal.org deployment

Now deployed.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Fixing markup.