I'm making a dev module which helps refining dependencies for version-missed modules on which other modules depend.

This is definitely done by Git Deploy module, but as it doesn't distinguish between installed/not installed modules, we get performance issues. I personally consider this approach as firing a cannon at sparrows when you only need to fetch versions for just few modules to resolve dependency-sensitive operations (update/install).

IMHO, Git Deploy module could behave more subtle, allowing to configure e.g. whether to fetch all modules or just installed modules or just few specific. But this is arguable, so I just propose to move version detection code outside git_deploy_system_info_alter() hook and make it an API function for other modules could use it. This won't harm anything.

I'm gonna make a patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

OnkelTem created an issue. See original summary.

OnkelTem’s picture

FileSize
6.4 KB

And the patch thus far:

  • A new function which detects versions is called git_deploy_detect_version($file). It takes only one parameter - the file object itself.
  • I leaved the code which skips system modules and themes in git_deploy_system_info_alter()

Not setting "Needs review" as it actually needs work: while the patch allows for calling version detection stuff from other modules, the master weapon yet not disabled and Git Deploy still makes you suffer.

Now how to resolve the issue to leave API function available and yet not fire Git Deploy master weapon?

Ideas:

  1. Create a module configuration page with a checkbox for disengaging the master weapon.
  2. Split the module into two: one for api, and another — for default behavior.
  3. Thoughts?
OnkelTem’s picture

Implementing Idea 1 from #2 — elegantly disabling master weapon via admin/configure/system/git-deploy form while having not-configured module to behave in the old-fashioned read'em'all ways.

asd

Basically now you are not required to Disable the module to stop suffering from its slowness, you can just turn this checkbox off.

OnkelTem’s picture

Status: Active » Needs review

And here comes the first (and probably the last) module exploiting newly-born API.
Meet Git deploy dependents: https://www.drupal.org/sandbox/onkeltem/2554201
Thanks @merlinofchaos for the help with naming this tiny module.

Pushing the patch to Review.

OnkelTem’s picture

Issue summary: View changes
Darren Oh’s picture

Issue tags: +Needs reroll
Darren Oh’s picture

Status: Needs review » Needs work
Darren Oh’s picture

Status: Needs work » Closed (outdated)

Version detection has been moved to the internal function _git_deploy_get_upstream().

Darren Oh’s picture

Issue tags: -Needs reroll