git_deploy's hook_requirements implementation is poorly done.

If the Glip library is not found the following message is displayed in green (i.e. REQUIREMENT_OK) on the status page:

Glip Library     See the instructions in sites/all/modules/git_deploy/README.txt
The Glip library must be present to use git_deploy.

Confusing at best.

Comments

fenstrat’s picture

Status: Active » Needs review
StatusFileSize
new1.57 KB

Attached patch clears up the hook_requirements to display a standard "Glip Library - Exists" message if present, but keeps the same error if it is not present.

_-.’s picture

Status: Needs review » Active

cd ./sites/all/modules
drush -y pm-disable git_deploy
rm -rf git_deploy
git clone --branch master http://git.drupal.org/project/git_deploy.git
drush -y pm-enable git_deploy

...
Glip has been cloned via git to /srv/www/d7t3/sites/all/libraries/glip/glip
...

ls -al ./sites/all/libraries/glip
total 12
drwxr-xr-x 3 wwwrun www 4096 Jul 9 10:30 ./
drwxr-xr-x 7 wwwrun www 4096 Jul 9 10:30 ../
drwxr-xr-x 5 wwwrun www 4096 Jul 9 10:30 glip/

ls -al ./sites/all/libraries/glip/glip
total 120
drwxr-xr-x 5 wwwrun www 4096 Jul 9 10:30 ./
drwxr-xr-x 3 wwwrun www 4096 Jul 9 10:30 ../
drwxr-xr-x 2 wwwrun www 4096 Jul 9 10:30 doc/
-rw-r--r-- 1 wwwrun www 63840 Jul 9 10:30 Doxyfile
drwxr-xr-x 8 wwwrun www 4096 Jul 9 10:30 .git/
-rw-r--r-- 1 wwwrun www 9 Jul 9 10:30 .gitignore
-rw-r--r-- 1 wwwrun www 743 Jul 9 10:30 HACKING
drwxr-xr-x 2 wwwrun www 4096 Jul 9 10:30 lib/
-rw-r--r-- 1 wwwrun www 17987 Jul 9 10:30 LICENSE
-rw-r--r-- 1 wwwrun www 575 Jul 9 10:30 README

@ http://www.mysite.com/admin/reports/status

Glip Library See the instructions in sites/all/modules/git_deploy/README.txt
The Glip library must be present to use git_deploy.
OK

shouldn't glip be cloned into:

/srv/www/d7t3/sites/all/libraries/glip

not

/srv/www/d7t3/sites/all/libraries/glip/glip ?

_-.’s picture

also, if i

cd /srv/www/d7t3/sites/all/libraries
mv glip glipTOP
mv glipTOP/glip .

then, @ status report

Glip Library See the instructions in sites/all/modules/git_deploy/README.txt
The Glip library must be present to use git_deploy.

again, in 'Green' (i.e. REQUIREMENT_OK) .

fenstrat’s picture

Status: Active » Needs review

@x746554 You've found yet another issue, it should indeed be cloned to /site/all/libraries/glip not /site/all/libraries/glip/glip. I've spun that off into #1214494: Incorrect Glip clone location with Libraries in drush_git_deploy_download()

Also, your status report in green noted in #3 should not happen if the patch here in #1 was applied. Can you confirm it that you have the patch in #1 applied?

Freso’s picture

Title: Clear up hook_requirements info » Clean up git_deploy_requirements()
Status: Needs review » Needs work

@fenstrat: It's great with all your help here in the queue. Although we're slow, it is greatly appreciated. :)

$value = t('Exists'); should probably either be more specific (e.g., "Glip library exists") or provide context.

Also, just because I can't help picking those nits: in future patches, I'd like to see non-related Doxygen fixes left out, so it's just the fix itself in the patch. Feel free to open a new issue for fixing/improving Doxygen though. :) (I'm talking about the @file block here, the "..._requirements()" is fine, as that actually relates to cleaning it up.)

Apart from the two (minor) points above, the code looks sound, so if those are nailed and someone chimes in and can confirm that what I'm reading is what is happening, this should be good to go. (It's a hard to review patches properly without a development system to test on. :/)

_-.’s picture

Ah, my mistake ... patch posted, but not committed to git. Sry.

short story, applying both patches to latest git tree, i still am seeing an issue at 'drush up' :-/

details:

cd /data/downloads
wget http://drupal.org/files/issues/1212942-1-hook_requirements.patch
wget http://drupal.org/files/issues/1214494-1-glip_clone_location.patch

drush -y @d7t3 pm-disable git_deploy
cd /srv/www/d7t3/sites/all
rm -rf libraries/glip

cd modules/
rm -rf git_deploy
git clone --branch master http://git.drupal.org/project/git_deploy.git

cd git_deploy
patch -p1 < /data/downloads/1212942-1-hook_requirements.patch
	patching file git_deploy.install
patch -p1 < /data/downloads/1214494-1-glip_clone_location.patch
	patching file git_deploy.drush.inc

drush -y @d7t3 pm-enable git_deploy
	...
	git_deploy was enabled successfully.
	...
	Glip has been cloned via git to /srv/www/d7t3/sites/all/libraries/glip.               [success]

ls -1 /srv/www/d7t3/sites/all/libraries/glip/lib
	binary.class.php
	git_blob.class.php
	git.class.php
	git_commit.class.php
	git_commit_stamp.class.php
	git_index_pack.php
	git_object.class.php
	git_ref_cache.class.php
	git_tag.class.php
	git_tree.class.php
	glip.php

@ nav to: http://.../admin/reports/status

now correctly displays: "Glip Library Exists"

checking drush mgmt, e.g.,

cd ./sites/all/modules/memcache
git log | head -n 3
	commit 8fab0c9f602bf5261a3ab8c611f630630e122c57
	Author: catch <catch@35733.no-reply.drupal.org>
	Date:   Mon Jul 4 23:54:05 2011 +0900

drush pm-list | egrep "git|memcach"
 Other             Git Deploy (git_deploy)                                 Module  Enabled        master
 Performance and   Memcache (memcache)                                     Module  Enabled        7.x-1.x
 Performance and   Memcache Admin (memcache_admin)                         Module  Enabled

but, at

drush up

	Update information last refreshed: Sun, 07/10/2011 - 19:16

	Update status information on all installed and enabled Drupal projects:
	 Name                           Installed      Proposed       Status
	                                version        version
	 Drupal                         7.4            7.4            Up to date
	...
	 Git Deploy (git_deploy)        master         7.x-1.x-dev    Installed version not supported
	...
	 Memcache (memcache)            7.x-1.x        7.x-1.0-beta4  SECURITY UPDATE available
	...

	Security and code updates will be made to the following projects: Git deploy [git_deploy-7.x-1.x-dev], Memcache API and Integration [memcache-7.x-1.0-beta4]
	...
	Do you really want to continue with the update process? (y/n):

which is drush incorrectly (?) ignoring the git-deployed "git-deploy" and "memcache" modules, and trying to actually DOWNgrade them.

at this point, i'm unsure if git-deploy, drush, or my config/understanding is not quite right.

Freso’s picture

Those last issues are more than likely not at all related to this issue here. Try looking at #1007890: Add support for annotated tags or #1011170: When a user is working from a local branch, display the release it was branched from, it sounds like your issue is more along those lines.

fenstrat’s picture

StatusFileSize
new1.37 KB

@Freso, no worries, glad to be of assistance, also glad to see some feedback!

Attached patch addresses your review in #5:
1) I've left the $value = t('Exists'); because this is the way both core and contrib do this, e.g. "Protected" and "Exists" - they don't make sense out of context, but on the status page with their title they become "Access to update.php - Protected" and "CTools CSS Cache - Exists".
2) I've removed the file Doxygen, it is indeed out of context, will follow up in another issue.

The feedback in #6 "now correctly displays: 'Glip Library Exists'" suggests this patch is working for x746554

@x746554, the issues you're seeing indeed look like they're not related to this issue. Also, it appears you're using the patch in #1214494: Incorrect Glip clone location with Libraries in drush_git_deploy_download(), can you mark that as RTBC if that's the case.

fenstrat’s picture

Status: Needs work » Needs review

No time atm, but this needs to be integrated with sun's approach in #1215372: Requirements check fails on Drupal installation

adammalone’s picture

I've had a quick stab at conglomerating both the patch by fenstrat and 'sun's approach'.

fenstrat’s picture

@typhonius The 7.x-2.x branch is a total rewrite from the groud up by chx, pretty sure the 1.x branch is not getting any further development?

Freso’s picture

Actually, The -2.x of both 6.x and 7.x is using an approach that required the "git" binary to be available for use on the webserver. And while the -2.x branches will receive the most love, good patches are still accepted for the -1.x branches, as those should work even on systems without the "git" binary (though obviously more limited - and with more dependencies).

(If we weren't accepting any patches for -1.x, the issues pertaining to these versions would be "won't fix"'ed. ;))

@typhonius:
By "sun's approach", you mean removing the fall-back of having the Glip library installed as a subdirectory of git_deploy? I think my personal taste would be for having the two patches done separately. Feel free to reopen and move #1215372: Requirements check fails on Drupal installation to 7.x-1.x and change status to "patch (to be ported)" (unless you port it immediately, of course :)).

adammalone’s picture

Ok sounds good. I'll split the patch up into one for this issue and a 7.x version port for the other issue.
Attached is the patch for this issue.

  • Darren Oh committed ac3828e on 7.x-1.x
    Issue #1212942 by fenstrat, adammalone: Fix confusing message on status...
darren oh’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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