Apache Solr support for CVS statistics

Dries - February 12, 2009 - 13:33
Project:CVS integration
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:drupal.org redesign
Description

Attached is a first draft of a patch required to implement the 'Most active' project blocks in the Mark Boulton designs.

AttachmentSize
apache-solr-support.patch1.18 KB

#1

dww - February 12, 2009 - 15:29
Status:active» needs work

A)

+  // TODO: ideally we'd be able to return statistics per branch but that
+  //       informaiton is not available in the CVS tables.

Sure it is. What do you think the {cvs_files}.branch field is about? ;)

B) $interval = 60 * 60 * 24 * 30 * 2; // 2 months

Seems like a nice thing to use a variable for so it's possible to alter this behavior without changing the code.

C) Probably wise to ensure the node you're indexing is a project that has CVS configured at all before doing any of the rest of this. For example, add this to the top of the function:

<?php
if (empty($node->cvs['directory'])) {
  return;
}
?>

That'll help with the "we need to optimize this" part too, since then you're only doing the nasty query on project nodes, not every node we try to index.

#2

aclight - February 12, 2009 - 16:01

Even better would be using project_use_cvs() instead of directly inspecting $node->cvs['directory'], no?

#3

lisarex - December 17, 2009 - 17:40

Linking this from the Redesign project #661680: Meta issue for CVS integration because this issue was tagged 'drupal.org redesign'

 
 

Drupal is a registered trademark of Dries Buytaert.