[pmwiki-users] Proposal: version control for cookbooks recipes

Patrick R. Michaud pmichaud at pobox.com
Sat Oct 28 10:38:08 CDT 2006


On Sat, Oct 28, 2006 at 09:21:51AM +0100, Hans wrote:
> Tuesday, October 24, 2006, 11:50:19 PM, Patrick wrote:
> 
> > So, let's just start with that as a minimal specification and 
> > we can build on it later as we need to.  Thus, the minimum a cookbook
> > script should provide is:
> 
> >    $RecipeInfo['RecipeName']['Version'] = '20061025';
> 
> > By default, 'RecipeName' here means that the recipe can be
> > found at the Cookbook.RecipeName page on pmwiki.org.
> 
> Great idea. Lets do it! Two points to this:
> 
> 1.) For skin recipes $RecipeInfo needs to be declared global.

Yes.

> 2.) How can I deal with cases of two or more recipes sharing
> the same page on pmwiki.org?
> For instance we got now three versions of commentboxplus, but one
> Version number.

I think in this case we still do what I recommended above --
the first index of $RecipeInfo is the name of the Cookbook page 
on which the recipe is located.

If there are multiple scripts sharing a common cookbook page 
(e.g., the commentbox recipes), then I think it's unlikely 
that given site would be installing more than one of them.
So, there isn't likely to be a conflict in the $RecipeInfo
array itself.

However, this does point out that the 'Version' attribute is
associated more with the Cookbook page, as opposed to the recipe
itself.  But this is really what we want -- a way to signal
admins when something about the Cookbook recipe has changed
that needs their attention.  In the typical case of one-recipe-per-page,
the version number of the page and script can be identical, and
that's fine (and what authors expect).  In the case of
multiple-recipes-per-page, we may still want to have a shared
version number, so that highly related recipes stay abreast
of any changes to the others.

At this stage I'm inclined to go with the simplistic version
I've outlined above and see how it works in practice before
being too concerned about the special cases.

In fact, the most straightforward answer may simply be
that a cookbook page containing multiple scripts simply
lists the version number for each script in its Version: line.
Something like

  Version: 20060811 (xyz.php), 20060815 (xyz2.php), 20061016 (xyz3.php)

Then, when a site is checking for latest versions of each recipe,
instead of looking for an exact match between 
$RecipeInfo['XYZ']['Version'] and the Version: line of Cookbook.XYZ,
we simply report when the script version doesn't appear somewhere
in the line.

Pm




More information about the pmwiki-users mailing list