Parse project .info files: present module list and dependency information

bradlis7 - December 8, 2006 - 04:55
Project:Project
Version:6.x-1.x-dev
Component:Projects
Category:feature request
Priority:normal
Assigned:boombatower
Status:needs review
Description

When browsing drupal's current list of add-on modules, the list is extremely lengthy, and hard to browse unless you know what you're looking for. I'd like to suggest that project nodes have dependencies. For example, for the cck module, there are a lot of sub-modules (email field, url field, etc), it would be good if we could get those out of the current list of modules, and on the cck project page as a list, because they do the user no good without the cck module.

Of course, there are some projects that are only useful as dependancies, and the other projects should be listed on the Modules page anyways.

Maybe projects could either be marked as a "library" for other projects, or a subproject of a project, instead of dependant... I'm just throwing some ideas down.

#1

dww - December 8, 2006 - 05:46

FYI: you can already browse projects by category (which is now the default at http://drupal.org/project/Modules, in fact). when you do, there's a whole category for CCK and related modules: http://drupal.org/project/Modules/category/88. similarly, there are categories for Views (http://drupal.org/project/Modules/category/89) and Organic Groups (http://drupal.org/project/Modules/category/90) 3 of the biggest sets of modules that depend on each other in the way you describe...

also, many projects that currently depend on others are fairly good about documenting this and adding links in the project descriptions themselves.

however, it's true that a more formalized dependency system would be nice, if nothing else to standardize this info and visually format it consistantly. we've already got this in the .info files in 5.x core, in fact, so it makes some sense to do that to project nodes, too.

however, i'd be slightly worried about people not keeping these 2 sources of information in sync (and having the project.module parse the .info files and use them directly seems a little scary). also, in the future, you'll be able to specific version-specific dependencies (e.g. og-5.x-1.0 depends on views 5.x-1.0 or later, but og-5.x-1.2 requires views 5.x-1.1 (or something)). to continue that example, og 4.7.x-* does not depend on views at all, but 5.x-* does. it's not obvious if/how we can represent that via project-level dependencies as you're suggesting.

i'm not marking as "won't fix", i'm just sharing my ideas (and concerns), too. clearly, this needs more thought if anything's going to come of it.

thanks,
-derek

#2

bradlis7 - December 8, 2006 - 16:42

I did expect that there would be a few concerns (and many of your concerns were thoughts of mine as well). I think that parsing the .info file would be an option, and a lot less difficult than having the maintainers keep up with it seperately.

I think that having the ability to mark a module as a "library" module would be a good course of action though, because it doesn't make sense to list a module on the Modules download page if the module doesn't really do anything... IMO anyways. (Maybe there should be a way to specify a "library" or API module in the .info file). One thing to note, though, is that some modules provide both functionality, and a library for other modules to use... maybe once there is a way to specify library modules, developers should be encouraged to split off library functionality other functionality (or maybe there should be a "library" project type on drupal.org).

I realize that there are categories right now, but even still, there are a lot of projects to wade through. I'd like for things to be a little less cluttered, but I realize that it's going to add a level of complexity, so I'm not really sure if it's worth it or not.

#3

bradlis7 - December 9, 2006 - 17:47
Title:Project Dependancies on Other Projects» Project Dependancies, Subproject, and Library Support

I think all of these would be useful to have. Dependancies can be taken from the .info file.

#4

moshe weitzman - December 19, 2006 - 02:26

well, one of the main reasons I like out .ini format is that the info can there can be used safely by PHP code like project module. i think project should reuse most of the info in the .ini, to be honest. some disagree, which is fine. dependencies are a good place to start. not sure what the UI should look like. maybe just state the dependencies on the project page for now.

#5

dww - January 24, 2007 - 10:36

if we put code on d.o to parse .info files from drupal modules, it needs to go into project_d_o_hacks.module, not project.module, or else we undo a year's worth of effort on my part to try to make project.module useful for other sites.

the potential for supporting project dependencies and relationships in project.module itself is a reasonable (if low priority) feature reuqest. however, hard-coding .info file logic is out of the question. we need a separate module for that.

#6

catch - November 2, 2008 - 17:26
Version:x.y.z» 5.x-1.x-dev

See also: http://groups.drupal.org/node/11998

This would be a useful thing to have.

#7

nedjo - November 4, 2008 - 02:52
Title:Project Dependancies, Subproject, and Library Support» New module to parse project .info files and present dependency information
Assigned to:Anonymous» nedjo

Since dependencies are at the module rather than the project level, I think what we need is actually a project_info module that parses and stores from .info files:

* the association of modules and their titles and descriptions with projects (projects being identified by nid), tracked by version, and
* the dependencies of modules on each other, again tracked by version

From this, we could present e.g. in blocks that appear on a project's page:

1. The projects that this project depends on.

2. The projects that depend on this project.

3. The modules included in this project (with their titles and descriptions).

I'll have a go at sketching this in as a new module.

I'm changing the issue title to reflect this specific aim. A "library" categorization of modules looks to me like a separate feature request (possibly just a new vocabulary or term).

#8

nedjo - November 4, 2008 - 04:06

Versioning information is going to be tricky.

In the first place, dependencies vary between core compatibility versions. module_x's Drupal 5 version will have different dependencies than its Drupal 6 version. So we can't say module_x has an overall set of dependencies. Rather, we need to distinguish between dependencies by version.

But dependencies may also vary within a core compatibility version. E.g., a core 6.x version of a given module may exist in multiple releases. Each of these may have different dependencies.

And we know version information only on one side of this dependency. That is, we know that the 6.2 stable release of module_x is dependent on module_y, but we don't know what version of module_y is required (6.1, 6.2, etc.).

Possibly we need to track dependencies only by Drupal core compatibility--e.g., assign module_x a single set of dependencies for Drupal 6.

It's not going to be straightforward deciding how to display this information. But first things first--we need to capture it before displaying.

#9

dww - November 4, 2008 - 08:34

@nedjo: It's great you're going to be working on this. If you haven't yet, please read http://groups.drupal.org/node/11998#comment-39642. Thanks!

#10

nedjo - November 5, 2008 - 05:59

Here's a first very rough draft, completely untested.

Some quick notes:

* Creates a new module, project_info, which is in an info directory in project.

* We capture information on modules and their dependencies by calling a processing function from the packaging script.

* Modules are stored in a new table, project_info, with their associated release node ID and the various data in the .info file (name, description, etc.). Looking again at this table, it may be too normalized--it may be better to store e.g. the core compatibility tid and the project node nid here too, to reduce the need to join on other tables.

* Modules themselves have a release associated with them, but for dependencies all we have is a module name. So we store dependencies as a relationship between a module ID (the ID field of the project_info table) and the dependency's module name.

A lot still to do. I'll pick this up later in the week. Comments meantime or suggestions for how I could test would be great.

AttachmentSize
project_info.tar_.gz 4.6 KB
project_info.diff 1.58 KB

#11

drewish - February 7, 2009 - 19:19
Version:5.x-1.x-dev» 6.x-1.x-dev

subscribing, i guess we probably want to bump this forward to 6.x right?

#12

Owen Barton - March 18, 2009 - 01:31

Subscribe

#13

adrian - April 14, 2009 - 00:52

I've been working on this stuff recently, but from the perspective of an outside system.

http://groups.drupal.org/node/21295

Basically I am building a directory structure of easily mirror-able meta-information, that can be parsed on the client side.
This is specifically with the goal of writing something like apt-get for Drupal.

I'm already working on automating these dependencies in my code, but I'd very happily support this getting into the generated info files itself (I already use the values from the .info files where available)

Something to keep in mind, is that modules provided by a package might change between releases, so this shouldn't be tied to the project, but to the releases (I know it makes it more complex, but that's how it works)

Same case for dependencies. New dependencies might be added or removed.

#14

boombatower - October 23, 2009 - 22:42
Assigned to:nedjo» boombatower

I'm going to be working on this since I need it for project_issue_file_test (PIFT).

#15

boombatower - October 23, 2009 - 23:22
Status:active» needs review

Initial patch to confirm direction.

AttachmentSize
102102-project-info.patch 5.24 KB

#16

boombatower - October 23, 2009 - 23:23
Title:New module to parse project .info files and present dependency information» Parse project .info files: present module list and dependency information

#17

boombatower - October 23, 2009 - 23:40

This should store the list of modules.

AttachmentSize
102102-project-info.patch 6.25 KB

#18

boombatower - October 24, 2009 - 00:04

This should store dependencies to the highest dev release in the same drupal core API version...later we can add support for the advanced style .info files supported by D7.

I'll add some sort of views support for this.

AttachmentSize
102102-project-info.patch 9.39 KB

#19

boombatower - October 24, 2009 - 00:33

Module list view done, got to head out...I'll get it and dependency view done before posted.

#20

boombatower - October 26, 2009 - 18:48

With views!

AttachmentSize
102102-project-info.patch 23.83 KB

#21

boombatower - October 26, 2009 - 18:59

Added API.

Now I will attempt to integrate this with pifr.

AttachmentSize
102102-project-info.patch 24.86 KB

#22

boombatower - October 26, 2009 - 19:04

PIFT integration was simple:

Index: pift.cron.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_test/pift.cron.inc,v
retrieving revision 1.31
diff -u -r1.31 pift.cron.inc
--- pift.cron.inc 23 Oct 2009 22:32:12 -0000 1.31
+++ pift.cron.inc 26 Oct 2009 19:04:05 -0000
@@ -278,8 +278,8 @@
     else {
       // Load the Drupal core API release (branch) compatible with this branch.
       $api_release = node_load(pift_core_api_release($api_tid));
-      $item['dependency'] = $api_release;
-      $item['plugin_argument']['modules'] = array(); // TODO Include the list of modules.
+      $item['dependency'] = implode(',', array_merge(array($api_release), project_info_dependency_list_get($branch->nid)));
+      $item['plugin_argument']['modules'] = project_info_module_list_get($branch->nid);

       // If the core branch has not already been added then add it.
       if (!isset($branches[$api_release])) {

I'll work on deploying on d6.d.o and testing the .info file parsing on release build, and I suppose I need to figure out some sort of script to run on all projects as we talked about.

#23

boombatower - October 30, 2009 - 20:14

The view will need to be tailored to a particular release for a project since the current argument is just pid, but that is minor since we don't need to display them...we really need the parsing for pift.

This patch is update to a new schema that keeps track of the specific "module" that is depended on in addition to the release.

AttachmentSize
102102-project-info.patch 29.77 KB

#24

boombatower - November 3, 2009 - 21:09

After quick chat with dww:

Plan: copy package-release-nodes.php as parse-legacy-info.php and hack it to run in tmp and not touch db.

Preferably come up with hack to temporarily store dependencies and parse in second round without having to re-checkout everything.

#25

boombatower - November 5, 2009 - 18:47

More up-to-date, still needs work to finish #24.

AttachmentSize
102102-project-info.patch 35.56 KB

#26

boombatower - November 5, 2009 - 20:57

Seems to work well, I'll wait for d6.d.o to come back up for final testing.

AttachmentSize
102102-project-info.patch 39.47 KB

#27

boombatower - November 5, 2009 - 21:29

Cleaned version.

AttachmentSize
102102-project-info.patch 36.74 KB

#28

boombatower - November 11, 2009 - 00:48

Through testing on d6.d.o fixed this so far, plus requires #424372: :: in .info files causes Fatal error.

AttachmentSize
102102-project-info.patch 46.51 KB

#29

boombatower - November 12, 2009 - 02:18

Seems to be working well.

AttachmentSize
102102-project-info.patch 38.55 KB

#30

boombatower - November 12, 2009 - 03:41

Latest patch against PIFT.

Index: pift.cron.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_test/pift.cron.inc,v
retrieving revision 1.37
diff -u -r1.37 pift.cron.inc
--- pift.cron.inc 3 Nov 2009 23:42:28 -0000 1.37
+++ pift.cron.inc 12 Nov 2009 03:41:36 -0000
@@ -278,8 +278,8 @@
     else {
       // Load the Drupal core API release (branch) compatible with this branch.
       $api_release = node_load(pift_core_api_release($api_tid));
-      $item['dependency'] = $api_release->nid;
-      $item['plugin_argument']['modules'] = array(); // TODO Include the list of modules.
+      $item['dependency'] = implode(',', array_merge(array($api_release->nid), project_info_dependency_list_get($branch->nid)));
+      $item['plugin_argument']['modules'] = project_info_module_list_get($branch->nid);

       // If the core branch has not already been added then add it.
       if (!isset($branches[$api_release])) {
Index: pift.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_test/pift.info,v
retrieving revision 1.5
diff -u -r1.5 pift.info
--- pift.info 14 Apr 2009 02:29:50 -0000 1.5
+++ pift.info 12 Nov 2009 03:41:36 -0000
@@ -10,6 +10,7 @@
files[] = pift.project.inc
files[] = pift.test.inc
dependencies[] = project
+dependencies[] = project_info
dependencies[] = project_issue
dependencies[] = project_release
dependencies[] = cvs

#31

boombatower - November 12, 2009 - 05:39

Ass patch file.

AttachmentSize
102102-pift.patch 1.47 KB

#32

boombatower - November 13, 2009 - 04:43

This is ready to go, works great. @see http://d6.drupal.org/node/350371

#33

nedjo - November 13, 2009 - 16:59

Wow! It's great to see this longstanding need close to completed. Thanks the great work.

I browsed through d6.drupal.org and found what look to be a couple of remaining issues.

1. Some releases show the release's module itself as a dependency. E.g. Views http://d6.drupal.org/node/621428. This is probably happening because the release includes modules that depend on each other, e.g., views_ui on views.

2. Some dependencies are missing. E.g. CCK fieldgroup tabs, http://d6.drupal.org/node/553732. Correctly shows tabs as a dependency but misses fieldgroup. At first glance it looks like we're only getting dependencies shown where the module name matches the project shortname.

How hard would it be to capture and display the human readable module names, and also use the project node titles? Doing so would make the blocks more user friendly.

It might also be useful to capture and offer the .info description to offer a sense of what each included module does. Of course this could be done in a follow up patch.

In many cases a project will include multiple modules, some of them less needed or even fairly obscure. In these cases, listing the combined dependencies of all modules in a release could give the mistaken impression that all these other modules must be downloaded and installed before the release can be used.

Should we consider listing modules and dependencies in a single block? Maybe a horizontal one in the content area? It might look sort of like the admin/build/modules page table:

Includes the following modules

Name Description Dependencies
PIFR Server Manage queue of tests and list of clients. Project issue file review: PIFR; Views: Views; Tabs: Tabs

#34

boombatower - November 13, 2009 - 21:37

Personally, I would rather hold of on the UI stuff. If we want to just hide the blocks that is fine. I need this functionality to do contrib testing (which we really want in place a soon as possible so ppl write tests as they port their modules).

I think your ideas make some sense, but I would rather get the architecture in place before tweaking the UI.

#35

nedjo - November 13, 2009 - 21:50

Agreed that the UI can wait. But it's worth thinking about now to make sure the data structure is correct.

Currently the patch captures two types of data: modules (in 'project_info_module') and dependencies (in 'project_info_dependency'). The latter tracks the relationship between releases and the modules that are required by them.

This won't give us enough information to associate dependencies with a particular module. To do so, we would need 'project_info_dependency' instead to track a dependency relationship between two modules by project_info_module.module_id.

#36

boombatower - November 13, 2009 - 22:30

For the specifically, I am not sure what that gets us. I mean we can display it, but I am not sure it is all that useful.

#37

nedjo - November 15, 2009 - 04:05
Status:needs review» needs work

<?php
+function project_info_package_info_process_dependencies($rid, array $dependencies) {
+  foreach (
$dependencies as $dependency) {
+    if (
$nid = project_get_nid_from_uri($dependency)) {
?>

This looks to be the source of the problem I noted above. We're only recognizing dependencies that have a module name that matches a project shortname, so dependencies will be saved only for modules that match their project's name.

Another more minor issue is that, at the time we're processing a given release, we don't yet have full data for other releases, so dependencies we determine may not be up to date.

Beyond this, though, dependency is fundamentally a relationship between two modules. Starting with my original patch (sorry!) [edit: on second glance, no, I was indeed tracking by module], in the proposed schema we're capturing not this original relationship but the more general relationship between a release and the modules that it requires. This release-module data may be useful in some cases, but not all, and in particular I'm realizing now that it doesn't give us the level of information we need to provide the most useful information on dependencies to site admins evaluating a release or a project--e.g., the table I suggested in #33.

Rather than tossing out the module-to-module dependency data and storing just the generalized project-to-release info, we should capture and store the actual dependency relationship--from which we can easily determine the release-module dependency any time we want.

Proposed schema:

<?php
/**
* Implementation of hook_schema().
*/
function project_info_schema() {
 
$schema = array();

 
$schema['project_info_module'] = array(
   
'description' => 'The modules contained by a project release.',
   
'fields' => array(
     
'module_id' => array(
       
'description' => 'The unique ID of a module.',
       
'type' => 'serial',
       
'unsigned' => TRUE,
       
'not null' => TRUE,
      ),
     
'name' => array(
       
'description' => 'The machine readable name of a module.',
       
'type' => 'varchar',
       
'length' => 255,
       
'not null' => TRUE,
       
'default' => '',
      ),
     
'title' => array(
       
'description' => "The human readable name of a module as contained in the module's .info file.",
       
'type' => 'varchar',
       
'length' => 255,
       
'not null' => TRUE,
       
'default' => '',
      ),
     
'description' => array(
       
'description' => "A description of a module as contained in the module's .info file.",
       
'type' => 'text',
       
'size' => 'medium'
     
),
     
'rid' => array(
       
'description' => 'The {node}.nid of the project_release node that includes a module.',
       
'type' => 'int',
       
'unsigned' => TRUE,
       
'not null' => TRUE,
       
'default' => 0,
      ),
    ),
   
'primary key' => array('module_id'),
   
'indexes' => array(
     
'rid' => array('rid'),
     
'name' => array('name'),
    ),
  );

 
$schema['project_info_dependency'] = array(
   
'description' => 'The dependencies of a module.',
   
'fields' => array(
     
'module_id' => array(
       
'description' => 'ID of a module.',
       
'type' => 'int',
       
'not null' => TRUE,
       
'default' => 0,
      ),
     
'dependency_id' => array(
       
'description' => 'ID of a module that the module is dependent upon.',
       
'type' => 'int',
       
'not null' => TRUE,
       
'default' => 0,
      ),
    ),
   
'primary key' => array('module_id', 'dependency_id'),
  );

}
?>

We could determine the releases a given release depends on with a query something like the following:

<?php
$result
= db_query('SELECT DISTINCT(pim.rid) FROM project_info_module pim INNER JOIN project_info_dependency pid ON pim.module_id = pid.dependency_id INNER JOIN project_info_module pim2 ON pid.module_id = pim2.module_id AND pim2.rid = 3');
?>

(though we'd need an extra join or two plus where clauses to get the recommended stable release for the correct core version).

[edit: fixed error in schema--module name is not unique. And corrected reference to schema in #10.]

#38

nedjo - November 15, 2009 - 05:22

Rough, untested function for saving dependency data per the schema in #37:

<?php
function project_info_package_info_process_dependencies($module_id, $rid, array $dependencies) {
  static
$api_vid;
  static
$api_tids = array();

  if (
$empty($api_vid)) {
   
$api_vid = _project_release_get_api_vid();
  }

  if (!isset(
$api_tids[$rid])) {
   
// Determine the release's core API version.
   
$api_tids[$rid] = db_result(db_query('SELECT td.tid FROM {term_node} tn INNER JOIN {term_data} td ON tn.tid = td.tid WHERE td.vid = %d AND tn.nid = %d', $api_vid, $rid));
  }

  foreach (
$dependencies as $dependency) {
    if (
$dependency_id = db_result(db_query("SELECT pim.module_id FROM project_info_module pim INNER JOIN {term_node} tn ON pim.rid = tn.nid INNER JOIN {term_data} td ON tn.tid = td.tid WHERE td.vid = %d AND tn.tid = %d AND pim.module_name = '%s'", $api_vid, $api_tids[$rid], $module_id, $dependency)) {
     
$info = array(
       
'module_id' => $module_id,
       
'dependency_id' => $dependency_id,
      );
     
drupal_write_record('project_info_dependency', $info);
    }
  }
}
?>

#39

nedjo - November 15, 2009 - 17:45

To return to a key issue I noted in #8: modules indicate their dependencies on other modules, but we don't know the specific versions required.

So we have to either (a) make an inference or (b) add a way for modules to specify their dependencies' versions.

If we're making an inference, probably our best guess is that what's required is the current recommended stable release for the given core api version. But of course, this won't always be the case. E.g. http://drupal.org/project/apachesolr_views requires Views 3 (6.x-3).

The alternative is to introduce a way for modules to indicate the version they require. For e.g. a reliable testing system, I'm pretty sure we need this.

The most straightforward way would be an API change:

dependencies[] = 'views-6.x-3'

but it's obviously far too late for that for d6, and probably for d7 too.

But we could add an optional and supplemental:

version_dependencies[] = 'views-6.x-3'

and parse this along with the other data. That looks like the only way we'd get reliable dependency information.

#40

boombatower - November 16, 2009 - 22:48

That's the thing...the code was intended as placeholder code until we implement the Drupal 7.x style .info files which allow versions to be specified. Then having the relationship to a release makes more sense, not to mention the entire point I am writing this feature, testing. Testing needs the releases as it need something to checkout that it can test against.

For 6.x I thing we should just make an inference and we can choose to add an interface or workaround if we want. The focus is on getting Drupal 7.x contrib testing working. Thus I would like to design this with that in mind instead of adding things to 6.x.

You are correct in #37 that it only loads dependencies where they match the module shortname. That was an oversight when writing the code, but the design works fine. All I need to do is a run a query to determine which project contains he module first and then load that project (as I thought about, just failed to code).

As for the display part I am not sure what we gain, and such. I think we can store more module information and such, but the key is we want this functionality NOW. So apparent from holding up the patch I would really like to move this forward, and deploy this weekend, if possible.

I guess what I am hitting at. There are ton of things to make this 100%, currently with the one issue fixed this should be a 90-95% solution. That gets us a start, then people can play with contrib testing (hopefully encourage them to write tests as they port) and we can work out the bugs in contrib testing while we worry about how to make this 100%. I mean there are a lot of things to consider, and it may be possible to integrate with the Drupal 7 code that already does this, but I'd like to spend more time discussing and figuring that out.

I'll take a look at the code samples and fix/merge stuff. I think your schema makes sense and provides us with more detail. I'm just concerned that we will continue and delay this too long.

#41

boombatower - November 17, 2009 - 20:22

The code in #38 appears to be too simple for our needs. The query to determine which module_id the module depends on does nothing to pick a release other then that the release is in the same drupal core compatibility. Which means we are doing them with no respect to order (version) or any kind nor stable/dev.

I am working on changing the code to point to modules, but the code from #38 won't work. For now I will choose the dev release for the latest stable in the core compatibility tid. That will suite 90%+ of modules and we can use D7 .info format later to gain 100%.

#42

boombatower - November 17, 2009 - 21:24
Status:needs work» needs review

Views integration is not complete, but I believe I have workable code using module => module relationships. I need to run it on d6.drupal.org to see how it does, but its looking good.

I am not sure I about views integrations. I pulled that out of the patch so we can commit the structure part and then decide on displaying information.

This will also require a slight teak to pift patch.

AttachmentSize
102102-project-info.patch 38.55 KB

#43

boombatower - November 17, 2009 - 21:25

I should actually role patch. :)

AttachmentSize
102102-project-info.patch 22.7 KB

#44

boombatower - November 17, 2009 - 21:35

Updated both patches.

AttachmentSize
102102-project-info.patch 22.87 KB
102102-pift.patch 1.65 KB

#45

boombatower - November 18, 2009 - 03:51

Updated after some testing. Appears to work, I'll be running whole thing once more to double check.

AttachmentSize
102102-project-info.patch 22.94 KB
102102-pift.patch 1.75 KB

#46

boombatower - November 18, 2009 - 21:04

Latest patch looks for on project_info side. Ran entire thing on d6.d.o last night and today I check the results with:

<?php
print_r
(project_info_module_list_get(350371));
print_r(project_info_dependency_list_get(350371));
?>

Array
(
    [pifr_server] => Array
        (
            [module_id] => 16968
            [rid] => 350371
            [name] => pifr_server
            [title] => PIFR Server
            [description] => Manage queue of tests and list of clients.
        )

    [pifr_client] => Array
        (
            [module_id] => 16970
            [rid] => 350371
            [name] => pifr_client
            [title] => PIFR Client
            [description] => Request tests from server and performs actual testing.
        )

    [pifr_assertion] => Array
        (
            [module_id] => 16972
            [rid] => 350371
            [name] => pifr_assertion
            [title] => Assertion
            [description] => Provide generalize PIFR review assertion implementation.
        )

    [pifr_simpletest] => Array
        (
            [module_id] => 16974
            [rid] => 350371
            [name] => pifr_simpletest
            [title] => SimpleTest
            [description] => Provide PIFR review implementation for SimpleTest.
        )

    [pifr] => Array
        (
            [module_id] => 16976
            [rid] => 350371
            [name] => pifr
            [title] => PIFR
            [description] => Profiles base functionality for PIFR Client and PIFR Server.
        )

)
Array
(
    [0] => Array
        (
            [module_id] => 170
            [rid] => 95897
            [name] => views
            [title] => Views
            [description] => Create customized lists and queries from your database.
        )

    [1] => Array
        (
            [module_id] => 3380
            [rid] => 239151
            [name] => tabs
            [title] => Tabs
            [description] => A helper module for creating tabbed pages.
        )

    [2] => Array
        (
            [module_id] => 11172
            [rid] => 313695
            [name] => pifr
            [title] => Project Issue File Review
            [description] => Automatically review patches attached to issues.
        )

    [3] => Array
        (
            [module_id] => 35304
            [rid] => 518454
            [name] => chart
            [title] => Chart API
            [description] => Google chart API integration.
        )

)

#47

nedjo - November 18, 2009 - 22:48

Great work.

Yes, this looks like the best approach to take at this time. Eventually we'll probably want to point to the recommended release rather than a dev one, but as an interim step, to meet the testing needs, dev makes sense.

+++ info/project_info.package.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,220 @@
+      if ($release_node->project_release['rebuild']) {
+        // Release represents a dev branch, store it.
+        $best_release = $release;
+      }
+      elseif ($best_release) {
+        // Release represents a stable branch, since a dev branch has already
+        // been found then stop and use the dev branch as the best branch.
+        break;
+      }

Is this just the same as:

<?php
     
if ($release_node->project_release['rebuild']) {
       
// Release represents a dev branch, store it.
       
$best_release = $release;
        break;
      }
?>

?

+++ info/project_info.package.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,220 @@
+  foreach ($dependencies as $dependency) {
+    // Cycle through the releases made by the project until a dev branch is
+    // found of the latest stable series that matches the core API. The
+    // releases are in descending order from the largest release version to
+    // the smallest release version.
+    $releases = project_info_package_releases_get($dependency, $api_tid);

Because some D7 .info dependency data will have versions specified, we need to strip that out as an interim step until it's supported. We can just use whatever's before the first space.

When adding dependency version support, some of the needed code is in core's module.inc.

#48

boombatower - November 19, 2009 - 01:10

Shouldn't be the same.

for instance: views 3.x-dev, views 2.x-dev, views 2.7...thus it will stop on views 2.x-dev, not views 3.x-dev.

I added

<?php
// Remove any version identifiers from depenencies since those are not
// processed yet.
foreach ($info[$module]['dependencies'] as &$dependency) {
  list(
$dependency) = explode(' ', $dependency, 2);
}
?>

for other bit.

AttachmentSize
102102-project-info.patch 23.17 KB

#49

boombatower - November 19, 2009 - 01:49

Updated pift patch after some testing.

AttachmentSize
102102-pift.patch 3.47 KB

#50

boombatower - November 19, 2009 - 23:12

This seems to work as well as intended.

AttachmentSize
102102-pift.patch 3.45 KB
 
 

Drupal is a registered trademark of Dries Buytaert.