[drupal-devel] RFC: drupalversions.module
A common request in Drupalspace is a way to keep track of which version of Drupal is running on a Drupal site. While the CHANGELOG.txt file will show the current version, that's not entirely accurate, as pieces of the code could be patched, contributed modules could be installed, or the site could be some version of Drupal HEAD (where the changelog version is moot). What is needed is a single, agreed-upon method of discovering and reporting the versions of the various code used in a Drupal installation. What I propose is a drupalversions.module to handle this task. The features of such a module should be: * discovery of the CVS $Id$ tags of every .module, .inc, .theme, .css .xtmpl, etc. storing of these version numbers * comparison of these versions to official Drupal releases, and reporting of variations from the standard release numbers reporting of all non-core files and their version numbers * a good report that could be requested by drupal-support to assist in bug tracking and problem solving. Advanced features could be: * versions of contributed modules that correspond to official Drupal core releases. For example, the author of image.module could specify that version 1.220 is the first version to be used with Drupal 4.6.0, and that it is compatible with 4.6.1 and 4.6.2, but image.module 1.224 should be used with Drupal 4.6.3, and 1.230 is for Drupal HEAD only. So the drupalversions schema would have to store the filenames of all files in the Drupal core and the version numbers of the official releases. This would have to be easily extendable/accessible by contributed modules through a hook or api. We should support problems like this (examples only): * "node.module 1.410.2.6 is the official version for Drupal 4.6.0." * "For Drupal 4.6.2, Image.module should be 1.224 or higher." * "weblink.module 1.30 requires common.inc version 1.401.2.3 or higher." * This installation is a 4.6.2 version of Drupal, except that the node.module and search.module appear to be newer, and the following contrib modules are installed..." What I'm not addressing is the question of patches. It would be simple enough, I think, to store MD5 hashes from the 'official' module and have hook_cron periodically compute the hashes and compare them with the db, which would then appear on the admin report which files weren't in sync with their official versions. How would all of this fit in to the install system? I am in no position to start contributing code to this at present, but I plan on doing so if there is such a need. I still don't know what the hook would look like or what the schema would be. So... what do you think, sirs? -- e one inch frame: http://eafarris.al.umces.edu/
While I think it's a good idea, I'm not sure:
* discovery of the CVS $Id$ tags of every .module, .inc, .theme, .css .xtmpl, etc. storing of these version numbers
this is a good way to implement. Somewhere in the CVS docs, they caution AGAINST using $Id$ as a version number. Off the top of my head, I can think of some reasons why: * CVS server crashes, wiping out all histories. Revisions start over. * Just because I patch my local copy doesn't mean I committed my patch to a server somewhere, or that I changed the $Id$ of my local copy. Comparisions would fail. * $Id$ isn't everywhere, is it? Does it always lock us into CVS forever, or are there easy equivalents in SVN? And, if we did switch to another RCS in the future, what happens to all the $Id$s we've been basing comparisons on? -- Morbus Iff ( you are nothing without your robot car, NOTHING! ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ O'Reilly Author, Weblog, Cook: http://www.oreillynet.com/pub/au/779 icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
On 7/28/05, Morbus Iff <morbus@disobey.com> wrote:
While I think it's a good idea, I'm not sure:
* discovery of the CVS $Id$ tags of every .module, .inc, .theme, .css .xtmpl, etc. storing of these version numbers
this is a good way to implement. Somewhere in the CVS docs, they caution AGAINST using $Id$ as a version number. Off the top of my head, I can think of some reasons why:
* CVS server crashes, wiping out all histories. Revisions start over.
* Just because I patch my local copy doesn't mean I committed my patch to a server somewhere, or that I changed the $Id$ of my local copy. Comparisions would fail.
* $Id$ isn't everywhere, is it? Does it always lock us into CVS forever, or are there easy equivalents in SVN? And, if we did switch to another RCS in the future, what happens to all the $Id$s we've been basing comparisons on?
Excellent points, all, but is there a solution that is simple, elegant, and right? Patching your version isn't addressed by the discovery and storage of $Id$ tags, but if the MD5 hashes could be used, we would know, for instance, that even though your search.module says it's version 1.130, the hashes don't match. (it could even run a diff, would't *that* be helpful for support) $Id$ might not be everywhere, but at least SVN has a similar construct. So, if $Id$ isn't ideal (and I'll concede that point), are hashes the answer? something else? I'm completely open to all ideas here. I'm convinced there's a need for some sort of standardized method of providing release version information, and I'd love to see that, umm, hashed out. :) -- e one inch frame: http://eafarris.al.umces.edu/
Well if you're thinking about adding a hook ( hook_version()?? ) anyways, why not just use that info for this? Developers could stick the $id$ tag in there if they want, or they could choose to update it manually... or both... I propose that hook_version() would return a keyed array with several defined keys, such as: 'version', 'cvsversion' ($id$), 'created', 'last updated', 'author', 'maintainers', 'contact', 'copyright', 'description', 'homepage', 'readme', 'install', 'dbfiles' (might tell installer what to install), as well as an array of 'supported systems' containing the Drupal versions for which the module is presumably compatible. Maybe this is getting out of the 'version' scope... So maybe we're looking at hook_description() or hook_info() or something along those lines. In an ideal world, some of this information would be available to the admin/modules page as well as the projects.module for display at Drupal.org. Also, I believe that patched modules are the responsibility of the site administrator. I could understand a simple checksum-type comparison, but I don't think that we should be bending over backwards to support the chaotic world of patched and modified (a.k.a. hacked) modules. -Jeff Robbins On Jul 28, 2005, at 7:59 AM, eric Farris wrote:
On 7/28/05, Morbus Iff <morbus@disobey.com> wrote:
While I think it's a good idea, I'm not sure:
* discovery of the CVS $Id$ tags of every .module, .inc, .theme, .css .xtmpl, etc. storing of these version numbers
this is a good way to implement. Somewhere in the CVS docs, they caution AGAINST using $Id$ as a version number. Off the top of my head, I can think of some reasons why:
* CVS server crashes, wiping out all histories. Revisions start over.
* Just because I patch my local copy doesn't mean I committed my patch to a server somewhere, or that I changed the $Id$ of my local copy. Comparisions would fail.
* $Id$ isn't everywhere, is it? Does it always lock us into CVS forever, or are there easy equivalents in SVN? And, if we did switch to another RCS in the future, what happens to all the $Id$s we've been basing comparisons on?
Excellent points, all, but is there a solution that is simple, elegant, and right?
Patching your version isn't addressed by the discovery and storage of $Id$ tags, but if the MD5 hashes could be used, we would know, for instance, that even though your search.module says it's version 1.130, the hashes don't match. (it could even run a diff, would't *that* be helpful for support)
$Id$ might not be everywhere, but at least SVN has a similar construct.
So, if $Id$ isn't ideal (and I'll concede that point), are hashes the answer? something else? I'm completely open to all ideas here. I'm convinced there's a need for some sort of standardized method of providing release version information, and I'd love to see that, umm, hashed out. :)
-- e
one inch frame: http://eafarris.al.umces.edu/
Id say: just use the hook_help for this. case "admin/versions#mymodule" return '$id$ for 4.6' $id$ is filled from svn/cvs. 4.6 must be hand-edited on a release But, while all this is nice, i beleive Adrian had a versioning system built in the update/install system. Op donderdag 28 juli 2005 17:45, schreef Jeff Robbins:
Well if you're thinking about adding a hook ( hook_version()?? ) anyways, why not just use that info for this? Developers could stick the $id$ tag in there if they want, or they could choose to update it manually... or both...
I propose that hook_version() would return a keyed array with several defined keys, such as: 'version', 'cvsversion' ($id$), 'created', 'last updated', 'author', 'maintainers', 'contact', 'copyright', 'description', 'homepage', 'readme', 'install', 'dbfiles' (might tell installer what to install), as well as an array of 'supported systems' containing the Drupal versions for which the module is presumably compatible.
Maybe this is getting out of the 'version' scope... So maybe we're looking at hook_description() or hook_info() or something along those lines.
In an ideal world, some of this information would be available to the admin/modules page as well as the projects.module for display at Drupal.org.
Also, I believe that patched modules are the responsibility of the site administrator. I could understand a simple checksum-type comparison, but I don't think that we should be bending over backwards to support the chaotic world of patched and modified (a.k.a. hacked) modules.
-Jeff Robbins
On Jul 28, 2005, at 7:59 AM, eric Farris wrote:
On 7/28/05, Morbus Iff <morbus@disobey.com> wrote:
While I think it's a good idea, I'm not sure:
* discovery of the CVS $Id$ tags of every .module, .inc, .theme, .css .xtmpl, etc. storing of these version numbers
this is a good way to implement. Somewhere in the CVS docs, they caution AGAINST using $Id$ as a version number. Off the top of my head, I can think of some reasons why:
* CVS server crashes, wiping out all histories. Revisions start over.
* Just because I patch my local copy doesn't mean I committed my patch to a server somewhere, or that I changed the $Id$ of my local copy. Comparisions would fail.
* $Id$ isn't everywhere, is it? Does it always lock us into CVS forever, or are there easy equivalents in SVN? And, if we did switch to another RCS in the future, what happens to all the $Id$s we've been basing comparisons on?
Excellent points, all, but is there a solution that is simple, elegant, and right?
Patching your version isn't addressed by the discovery and storage of $Id$ tags, but if the MD5 hashes could be used, we would know, for instance, that even though your search.module says it's version 1.130, the hashes don't match. (it could even run a diff, would't *that* be helpful for support)
$Id$ might not be everywhere, but at least SVN has a similar construct.
So, if $Id$ isn't ideal (and I'll concede that point), are hashes the answer? something else? I'm completely open to all ideas here. I'm convinced there's a need for some sort of standardized method of providing release version information, and I'd love to see that, umm, hashed out. :)
-- e
one inch frame: http://eafarris.al.umces.edu/ Regards, Bèr -- [ Bèr Kessels | Drupal services www.webschuur.com ]
This whole idea of making it easier for site administrators to identify which release and versions of core code and modules is one I've brought up several times before over the past couple of years. I have even submitted several patches against core to support the idea, and at one time even coded an XML-RPC module which would allow third-party remote support and problem reporting which would provide version info as needed. It always seemed to fall on deaf ears, so I am really happy to see some people showing interest in this idea. As a site administrator with multiple Drupal sites to manage, the things I most often want to know are: 1. What is the release version of the core that is running? 2. Which additional modules and themes are installed? 3. What are the versions of those additional modules and themes? 4. What version of the database update is the site at? 5. Have any of the source files been patched locally? (I generally try to stay away from doing this precisely because it makes management and upgrading more difficult, but sometimes it's necessary. Being able to easily identify when that has been done is really useful.) Bèr Kessels wrote:
Id say: just use the hook_help for this. case "admin/versions#mymodule" return '$id$ for 4.6'
$id$ is filled from svn/cvs. 4.6 must be hand-edited on a release
Using the RCS/CVS $Id$ keyword string only works for answering the fine grain questions. It will more often be useful with contrib modules than anything else. For the rest of the code, I want the release version, which can be gotten from the $Name$ keyword string -- if a release is symbolically tagged, and then checked out explicitly with that tag (as it should be!) when building the downloadable tarballs. Every version control system I've ever seen has this idea of version keywords, so if we move to Subversion or something else, we may need to change $Id$ and $Name$ to some other keyword, but it will be a global search/replace to do so. For some of my previous efforts, see: http://drupal.org/node/20439 http://drupal.org/node/20448 http://drupal.org/node/20445 http://drupal.org/node/20444 (4 different patches for head and 4.6, core and contrib) http://drupal.org/node/15818 -- Chris Johnson
On Thursday 28 July 2005 09:59 am, eric Farris wrote:
I'm convinced there's a need for some sort of standardized method of providing release version information, and I'd love to see that, umm, hashed out. :)
With my contributed modules I simply print out the CVS Revision tag as part of the title on the settings page. drupal_set_title(t('TinyMCE settings (%revision)', array('%revision' => '$Revision: 1.35 $'))); I then ask for this information when users file bug reports. While crude, it's easy for folks to find and for me to identify version incompatibilities. Matt
Matt Westgate wrote:
On Thursday 28 July 2005 09:59 am, eric Farris wrote:
I'm convinced there's a need for some sort of standardized method of providing release version information, and I'd love to see that, umm, hashed out. :)
With my contributed modules I simply print out the CVS Revision tag as part of the title on the settings page.
drupal_set_title(t('TinyMCE settings (%revision)', array('%revision' => '$Revision: 1.35 $')));
I then ask for this information when users file bug reports.
While crude, it's easy for folks to find and for me to identify version incompatibilities.
Matt
I think Matt's is an elegant solution to get revision info. But that info, though useful, can be sometimes misguiding: - My sites are in my own svn repository, which I update from time to time following Drupal releases, so I have my own revision numbers - When you have a module with more than one file, that revision numbers will only increase when updating the main module file What I'd like to have is some module_info hook, that could provide all this info and more. It would admit params like - 'revision' to get cvs revision as Matt's module does - 'version' to get a manually assigned module version, that would be assigned by moudle maintainers following Drupal's main versions, like 4.6.2.10, where the first three digits would be Drupal version, and the following ones, could be form module versions/revisions -.... maybe more, for dependencies, etc...
On Thu, Jul 28, 2005 at 10:26:52AM -0400, eric Farris wrote:
I am in no position to start contributing code to this at present, but I plan on doing so if there is such a need. I still don't know what the hook would look like or what the schema would be. So... what do you think, sirs?
I think this sort of thing is much needed, but I'm not sure that it fits well with the previous work at http://drupal.org/node/22472. For example, I am currently working on update.php with the plan of making it able to manage the database tables for all modules, not just Drupal core. The DB schemas need to be versioned. The numbering scheme will be similar to that used in database/updates.inc today. A CVS id would not work in this case because those are simply too unpredictable for use elsewhere. Even for tracking compatibility of the module itself (works with 4.6.x, etc) I imagine matching the auto-genrated ids to be infuriating for many developers. There is simply a large learning curve to to figure out what system the CVS numbers use and be able to precict which number will be next. I suppsoe there could be something that scrapes this information out of the CVS repository by looking at the tags. That would make us dependant upon CVS and feels like an overly-complex system. -Neil
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I am aiming to introduce module / theme / style / everything metadata with the dependency patch. Each module will be in it's own directory , and each module will have it's own module.dsc file in the format of variable: value For instance, system.module will be modules/system/system.module and have a modules/system/system.dsc file with : name : system version: 4.6.2 branch: 4.6 schema: 140 (or the update_X version it needs to have to run) requires : block, filter, user, watchdog Each module implicitly requires system , and should have a branch: 4.6 (or branch: head ) On 28 Jul 2005, at 7:26 AM, eric Farris wrote:
A common request in Drupalspace is a way to keep track of which version of Drupal is running on a Drupal site. While the CHANGELOG.txt file will show the current version, that's not entirely accurate, as pieces of the code could be patched, contributed modules could be installed, or the site could be some version of Drupal HEAD (where the changelog version is moot). What is needed is a single, agreed-upon method of discovering and reporting the versions of the various code used in a Drupal installation.
What I propose is a drupalversions.module to handle this task. The features of such a module should be:
* discovery of the CVS $Id$ tags of every .module, .inc, .theme, .css .xtmpl, etc. storing of these version numbers * comparison of these versions to official Drupal releases, and reporting of variations from the standard release numbers reporting of all non-core files and their version numbers * a good report that could be requested by drupal-support to assist in bug tracking and problem solving.
Advanced features could be:
* versions of contributed modules that correspond to official Drupal core releases. For example, the author of image.module could specify that version 1.220 is the first version to be used with Drupal 4.6.0, and that it is compatible with 4.6.1 and 4.6.2, but image.module 1.224 should be used with Drupal 4.6.3, and 1.230 is for Drupal HEAD only.
So the drupalversions schema would have to store the filenames of all files in the Drupal core and the version numbers of the official releases. This would have to be easily extendable/accessible by contributed modules through a hook or api.
We should support problems like this (examples only):
* "node.module 1.410.2.6 is the official version for Drupal 4.6.0." * "For Drupal 4.6.2, Image.module should be 1.224 or higher." * "weblink.module 1.30 requires common.inc version 1.401.2.3 or higher." * This installation is a 4.6.2 version of Drupal, except that the node.module and search.module appear to be newer, and the following contrib modules are installed..."
What I'm not addressing is the question of patches. It would be simple enough, I think, to store MD5 hashes from the 'official' module and have hook_cron periodically compute the hashes and compare them with the db, which would then appear on the admin report which files weren't in sync with their official versions.
How would all of this fit in to the install system?
I am in no position to start contributing code to this at present, but I plan on doing so if there is such a need. I still don't know what the hook would look like or what the schema would be. So... what do you think, sirs?
-- e
one inch frame: http://eafarris.al.umces.edu/
- -- Adrian Rossouw Drupal developer and Bryght Guy http://drupal.org | http://bryght.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iD8DBQFC6S88gegMqdGlkasRAj6hAJ0QoJqY3Ej896SZQ5PfwwIUW4tbTwCgto5w guOn+Lai60I4OEqnzlMVZ/o= =7jXe -----END PGP SIGNATURE-----
On 7/28/05, Adrian Rossouw <adrian@bryght.com> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I am aiming to introduce module / theme / style / everything metadata with the dependency patch.
Each module will be in it's own directory , and each module will have it's own module.dsc file in the format of
variable: value
For instance, system.module will be modules/system/system.module and have a modules/system/system.dsc file with : name : system version: 4.6.2 branch: 4.6 schema: 140 (or the update_X version it needs to have to run) requires : block, filter, user, watchdog
Each module implicitly requires system , and should have a branch: 4.6
(or branch: head )
This sounds *wonderful*. Looking forward to seeing it. -- e one inch frame: http://eafarris.al.umces.edu/
I am aiming to introduce module / theme / style / everything metadata with the dependency patch.
Each module will be in it's own directory , and each module will have it's own module.dsc file in the format of
variable: value
For instance, system.module will be modules/system/system.module and have a modules/system/system.dsc file with : name : system version: 4.6.2 branch: 4.6 schema: 140 (or the update_X version it needs to have to run) requires : block, filter, user, watchdog
Each module implicitly requires system , and should have a branch: 4.6
(or branch: head )
Please use an established format, eg. something parse_ini_file() can understand. It is a lot easier to parse and edit in an editor having colorer support :) Goba
Op maandag 01 augustus 2005 13:09, schreef Gabor Hojtsy:
Please use an established format, eg. something parse_ini_file() can understand. It is a lot easier to parse and edit in an editor having colorer support :)
Goba
I was thinking of making a patch for parsing this as XML file. But I wanted to wait untill the patch by adrian landed. He has enough work to do on this without us bothering him about fileformats :) Regards, Bèr -- [ Bèr Kessels | Drupal services www.webschuur.com ]
participants (10)
-
Adrian Rossouw -
Bèr Kessels -
Chris Johnson -
eric Farris -
Gabor Hojtsy -
Jeff Robbins -
Jose A. Reyero -
Matt Westgate -
Morbus Iff -
neil@civicspacelabs.org