Digging around in the database, I was able to find a considerable number of d7 and d8 projects that did not get their dependencies calculated and added to either project_dependency_component or project_dependency_dependency.

-- Show all of the release nodes that do no have dependencies in project_dependency
SELECT n.title, CONCAT('https://drupal.org/node/' ,n.nid) as `Release URL`, FROM_UNIXTIME(n.created) AS `Project Date`, fdtv6.taxonomy_vocabulary_6_tid, prj.title, prj.type
FROM node n
  LEFT JOIN project_dependency_component pdc on pdc.release_nid = n.nid
  LEFT JOIN field_data_taxonomy_vocabulary_6 fdtv6 ON fdtv6.entity_id = n.nid
  LEFT JOIN field_data_field_release_project fdfrp ON fdfrp.entity_id = n.nid
  LEFT JOIN node prj on prj.nid = fdfrp.field_release_project_target_id
WHERE n.type = 'project_release'
AND pdc.name IS NULL
AND fdtv6.taxonomy_vocabulary_6_tid IN (103,7234)
ORDER BY n.nid DESC;

With some of the composer.json patches and other processing requirements, this may get cleaned up as part of backfilling release data, but it would be good to find out whats causing these to get skipped.

CommentFileSizeAuthor
#17 2673048.diff2.86 KBdrumm
#9 2673048.diff866 bytesdrumm
#8 2673048.diff870 bytesdrumm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mixologic created an issue. See original summary.

trobey’s picture

I suspected this was happening. The vast majority of releases are never used by other releases so if there are reported problems then it would seem to be the tip of the iceberg. But it also seems that many projects have dependency information. This is important because it means that the release code is working. That means the probable causes are either the function call to process the release is not getting called or that Git is failing. If the function is not getting called then there is nothing that Project Dependency can do to fix the problem. If Git is failing then this probably is because the projects are updated instead of a clean clone of the project from the Git repository, This could be a permissions problem (current user does not have write privilege because the code was checked out under a different user) or a corruption of the checked out Git repository. (It also could be a problem with connecting to the Git repository but again that is not a Project Dependency problem.) Issue #2659782: Additional repositories are not installed as expected. changed from persisting the checked out code to a clean Git clone every time. This is in 7.x-1.0-beta12 release of Project Dependency which was released February 17. I do not have a way to test to make sure but I suspect that this latest release may have taken care of the problem. So the relevant question is whether you are still seeing project releases that are not getting processed.

There is code in the component block view code that checks the number of components from the project_dependency_component table. If the number is zero then I wrote code that processes the release. This is "self correcting" code since just visiting a release page with a problem fixes the problem. This code is commented out because it only worked when the persisted checked code was on the same server and it was decided we do not want to process releases on the webserver. But with the clean checkout of the code in the recent release this code probably would work. It would not cause significant server load because it only gets called when the components are zero which is only when a release is found that has a problem.

The other approach that I have considered is to use a query like you have in a cron job and process a few of the missing releases each time. There would probably have to be some safety so a release that will not process for some unknown reason does not get called again and again. But this requires processing releases on the webserver so it is not an option if we do not want to have the webserver processing releases.

Mixologic’s picture

Unfortunately, I dont think that fixed it:

fblikebutton 7.x-2.4	https://drupal.org/node/2673212	2016-02-22 12:37:52	103	Facebook Like Button	project_module
leaflet 8.x-1.0-alpha1	https://drupal.org/node/2673152	2016-02-22 11:00:16	7234	Leaflet	project_module
masonry_views 8.x-1.0-rc1	https://drupal.org/node/2673140	2016-02-22 10:48:17	7234	Masonry Views	project_module
bahai_incubator 7.x-1.0-beta40	https://drupal.org/node/2673068	2016-02-22 08:14:50	103	Local Baha'i Community Website Incubator	project_distribution
pc 8.x-1.0-beta2	https://drupal.org/node/2673058	2016-02-22 07:57:38	7234	PHP Console	project_module
lightgallery 8.x-1.0-beta1	https://drupal.org/node/2673024	2016-02-22 06:34:14	7234	Lightgallery	project_module
extra_image_field_classes 8.x-1.0	https://drupal.org/node/2672726	2016-02-21 11:50:23	7234	Extra Image Field Classes	project_module
theme_filter 8.x-1.0	https://drupal.org/node/2672672	2016-02-21 08:16:47	7234	Theme Filter	project_module
special_taxonomy_tagging_in_body 8.x-1.x-dev	https://drupal.org/node/2672638	2016-02-21 06:59:39	7234	Special Taxonomy Tagging In Body	project_module
tea 8.x-1.x-dev	https://drupal.org/node/2672620	2016-02-21 06:35:51	7234	Tea	project_theme
teatheme 8.x-1.x-dev	https://drupal.org/node/2672616	2016-02-21 06:35:07	7234	TeaTheme	project_theme
teaserver 8.x-1.x-dev	https://drupal.org/node/2672612	2016-02-21 06:33:38	7234	TeaServer	project_distribution
content_language_access 8.x-1.0	https://drupal.org/node/2672568	2016-02-21 01:51:14	7234	Content Language Access	project_module
radiogrid 8.x-1.x-dev	https://drupal.org/node/2672548	2016-02-21 00:19:35	7234	RadioGrid	project_module
key 8.x-1.1	https://drupal.org/node/2672536	2016-02-20 22:49:40	7234	Key	project_module
restful 7.x-2.7	https://drupal.org/node/2672382	2016-02-20 11:11:38	103	RESTful	project_module
writer 8.x-2.2-rc1	https://drupal.org/node/2672316	2016-02-20 06:31:23	7234	Writer	project_theme
sharpspring 8.x-1.0	https://drupal.org/node/2672300	2016-02-20 05:58:57	7234	SharpSpring	project_module
snipcart 8.x-1.0-alpha1	https://drupal.org/node/2672190	2016-02-19 21:59:10	7234	Snipcart	project_module
itchio_field 8.x-1.0-alpha1	https://drupal.org/node/2672128	2016-02-19 20:17:01	7234	Itch.io Field	project_module
custom_pub 8.x-1.0-alpha5	https://drupal.org/node/2671980	2016-02-19 16:09:14	7234	Custom Publishing Options	project_module
require_login 8.x-1.1	https://drupal.org/node/2671950	2016-02-19 15:33:36	7234	Require Login	project_module
publish_to_apple_news 7.x-1.0	https://drupal.org/node/2671924	2016-02-19 14:29:18	103	Publish to Apple News	project_module
custom_pub 8.x-1.0-alpha4	https://drupal.org/node/2671590	2016-02-19 02:45:21	7234	Custom Publishing Options	project_module
nodejs 8.x-1.1	https://drupal.org/node/2671566	2016-02-19 00:46:41	7234	Node.js integration	project_module
cps 7.x-1.0-alpha6	https://drupal.org/node/2671562	2016-02-19 00:40:22	103	CPS	project_module
inline_entity_form 8.x-1.0-alpha4	https://drupal.org/node/2671480	2016-02-18 21:43:18	7234	Inline Entity Form	project_module
lightning 7.x-1.0-beta4	https://drupal.org/node/2671450	2016-02-18 20:53:14	103	Lightning	project_distribution
require_login 8.x-1.0	https://drupal.org/node/2671418	2016-02-18 19:48:03	7234	Require Login	project_module
custom_pub 8.x-1.0-alpha3	https://drupal.org/node/2671400	2016-02-18 19:14:53	7234	Custom Publishing Options	project_module
uk_postcode 7.x-1.0-alpha1	https://drupal.org/node/2671170	2016-02-18 13:31:53	103	UK postcode	project_module
lesser_forms 7.x-2.0-beta1	https://drupal.org/node/2671102	2016-02-18 11:36:14	103	Lesser Forms	project_module
destination_alter 7.x-1.0	https://drupal.org/node/2671012	2016-02-18 09:22:34	103	Drush Destination Alter	project_module
destination_alter 7.x-1.x-dev	https://drupal.org/node/2671010	2016-02-18 09:21:16	103	Drush Destination Alter	project_module
retina_images 7.x-1.0-beta5	https://drupal.org/node/2670938	2016-02-18 07:16:44	103	Retina Images	project_module
feet_inches_formatter 7.x-1.0-rc2	https://drupal.org/node/2670878	2016-02-18 04:00:45	103	Feet Inches Formatter	project_module
feet_inches_formatter 7.x-1.0-rc1	https://drupal.org/node/2670860	2016-02-18 01:48:49	103	Feet Inches Formatter	project_module
vertical_tabs_config 8.x-1.0-beta1	https://drupal.org/node/2670646	2016-02-17 18:43:47	7234	Vertical Tabs Config	project_module

Are all releases that have happened since the 17th that are missing from project_dependency_components.

We could also have that reprocess cron job run as one of our jenkins jobs and hit jenkins1 - where the releases already get processed..

drumm’s picture

I rebuilt dependencies for the most recent release in this list, fblikebutton 7.x-2.4 https://drupal.org/node/2673212. That completed normally:

Processing dependencies for fblikebutton
Processed fblikebutton: 7.x-2.4
Processed fblikebutton: 8.x-1.x
…

But there weren't components found for that release. I did see this this on a few other projects when I processed all releases that had been made in 2016 that had been missing dependencies. Some releases consistently aren't finding their components. I haven't dug into it to see the pattern yet.

trobey’s picture

There are three project_themes and three project_distributions that are skipped. The last three releases do not exist in my copy in addition to the missing radiogrid release. The two destination_alter releases are not typical projects with info files. special_taxonomy_tagging_in_body has Drupal 7 code in the Drupal 8 branch so the info file has not been converted yet into a info.yml file. That leaves 26 out of a total of about 138 over this period of time. It would appear that most releases are getting processed although there is significant failure rate.

I can manually process all 26 of these projects. I checked the logs and there are no messages about Git failing. So that would tend to indicate that the code is never getting called. That is consistent with what I have seem to have observed lately. Another observation is that the failures tend to cluster in certain projects although it could be a coincidence.

drumm’s picture

I found a recent release which did seem to be skipped. There isn't anything project_dependency-related in the logs, either it didn't run, or ran "successfully" at the time.

watchdog logging of the array as it is sent into project_dependency_info_batch_process_release() would be helpful to know what it is running.

Packaging passes the release node object straight from node_save() into project_dependency_project_release_create_package(). I could see this being a caching issue.

trobey’s picture

That sounds like a promising angle. Do you want me to add a call to watchdog in a formal commit? I think this is one of those very rare instances where just adding it manually would be okay since it is just for temporary debugging.

drumm’s picture

Assigned: Unassigned » drumm
Status: Active » Needs review
FileSize
870 bytes

Here's the patch I'm adding. I think it would be good to keep around permanently. I'll go ahead and apply as a patch to Drupal.org so we don't need to tag a new release for now.

drumm’s picture

FileSize
866 bytes

Removing an extra word in the log message.

drumm’s picture

An interesting missed release at the moment is leaflet_markercluster 8.x-1.0-alpha2, https://www.drupal.org/node/2673690. Re-processing dependencies for the projects does not populate the components there.

At the moment, 8.x-1.0-alpha2 is at the same place as 8.x-1.x, http://cgit.drupalcode.org/leaflet_markercluster?h=8.x-1.x. 8.x-1.x does have components successfully parsed, https://www.drupal.org/node/2068493.

trobey’s picture

Strange. Here is the command that is running to clone the code.

git clone --depth 1 --branch 8.x-1.0-alpha2 git://git.drupal.org/project/leaflet_markercluster.git '/tmp/leaflet_markercluster_1456354048' 2>&1

Here is what is checked out.

$ ls
leaflet_markercluster.api.php    leaflet_markercluster.make.example
leaflet_markercluster.drupal.js  leaflet_markercluster.module
leaflet_markercluster.info       README.txt

When I run the same command on my local computer I get

$ ls
leaflet_markercluster.api.php        leaflet_markercluster.make.example
leaflet_markercluster.drupal.js      leaflet_markercluster.module
leaflet_markercluster.info.yml       README.txt
leaflet_markercluster.libraries.yml

So this is not getting processed because the wrong code is getting checked out. Here is more information. On the system with the dev version of drupal.org we have

$ git --version
git version 1.7.1

My local computer (Ubuntu 14.04)

$ git --version
git version 1.9.1

It looks like both versions of git support --depth and --branch but I do see something about shallow clones having limited functionality before version 1.9. But the limited functionality should be sufficient. Maybe --branch does not support using a tag in the earlier version of Git?

trobey’s picture

For Git 1.7.1 the man page has

       --branch <name>, -b <name>
           Instead of pointing the newly created HEAD to the branch pointed to
           by the cloned repository’s HEAD, point to <name> branch instead. In
           a non-bare repository, this is the branch that will be checked out.

The man page for Git 1.9.1 has

       --branch <name>, -b <name>
           Instead of pointing the newly created HEAD to the branch pointed to
           by the cloned repository’s HEAD, point to <name> branch instead. In
           a non-bare repository, this is the branch that will be checked out.
           --branch can also take tags and detaches the HEAD at that commit in
           the resulting repository.

So it looks like cloning at a tag was added. What version of Git are we using on the appropriate server?

trobey’s picture

It looks like using --branch for a tag was introduced in Git 1.7.10.

drumm’s picture

Aha, we're on an older version of Git. (The versioncontrol* module integration parses output from git commands, so it gets pinned as we fear git output/behavior changes.)

  • trobey committed 383ef42 on 7.x-1.x
    Issue #2673048 by drumm, trobey: Many projects lack dependency...
trobey’s picture

I changed to use Git commands that work for older versions of Git. It is a lot less efficient. The more efficient version is commented out for use in the future. I did some testing but skim to make sure I did not miss anything. I also added the watchdog statement that already is deployed. I made a new release with these changes.

drumm’s picture

FileSize
2.86 KB

I did a bit more testing and found:

  • A code comment that could use some clarification.
  • Update the watchdog message for #9.
  • --branch {tag} does get a checkout, it falls back to warning: Remote branch 7.x-1.13 not found in upstream origin, using HEAD instead, so the initial command can be kept.
  • For static (project_release's term for tagged) releases only, do the git checkout fallback. This works well, even with --depth 1 on the initial checkout.

  • trobey committed 60efb3a on 7.x-1.x authored by drumm
    Issue #2673048 by drumm: Many projects lack dependency information
    
trobey’s picture

Looks like an improvement mostly in that the more efficient code will automatically work with newer versions of Git rather than having to create another release. The changes are in 7.x-1.0-beta14.

trobey’s picture

Status: Needs review » Fixed
drumm’s picture

I deployed this and it is working well.

Status: Fixed » Closed (fixed)

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