Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#17 | 2673048.diff | 2.86 KB | drumm |
Comments
Comment #2
trobey CreditAttribution: trobey commentedI 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.
Comment #3
MixologicUnfortunately, I dont think that fixed it:
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..
Comment #4
drummI rebuilt dependencies for the most recent release in this list, fblikebutton 7.x-2.4 https://drupal.org/node/2673212. That completed normally:
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.
Comment #5
trobey CreditAttribution: trobey commentedThere 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.
Comment #6
drummI 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()
intoproject_dependency_project_release_create_package()
. I could see this being a caching issue.Comment #7
trobey CreditAttribution: trobey commentedThat 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.
Comment #8
drummHere'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.
Comment #9
drummRemoving an extra word in the log message.
Comment #10
drummAn 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 as8.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.Comment #11
trobey CreditAttribution: trobey commentedStrange. Here is the command that is running to clone the code.
Here is what is checked out.
When I run the same command on my local computer I get
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
My local computer (Ubuntu 14.04)
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?
Comment #12
trobey CreditAttribution: trobey commentedFor Git 1.7.1 the man page has
The man page for Git 1.9.1 has
So it looks like cloning at a tag was added. What version of Git are we using on the appropriate server?
Comment #13
trobey CreditAttribution: trobey commentedIt looks like using --branch for a tag was introduced in Git 1.7.10.
Comment #14
drummAha, 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.)
Comment #16
trobey CreditAttribution: trobey commentedI 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.
Comment #17
drummI did a bit more testing and found:
--branch {tag}
does get a checkout, it falls back towarning: Remote branch 7.x-1.13 not found in upstream origin, using HEAD instead
, so the initial command can be kept.git checkout
fallback. This works well, even with--depth 1
on the initial checkout.Comment #19
trobey CreditAttribution: trobey commentedLooks 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.
Comment #20
trobey CreditAttribution: trobey commentedComment #21
drummI deployed this and it is working well.