[Zope-CMF] Re: GenericSetup: How to use upgradeStep?

Maurits van Rees m.van.rees at zestsoftware.nl
Tue Sep 25 04:09:37 EDT 2007


Hi,

I've been on vacation I took my time answering.

Rob Miller, on 2007-09-06:
> okay, here's where things get off track.  in GenericSetup, there is no such 
> thing (yet, perhaps) as an "upgrade profile".  it's possible to define an 
> extension profile and to USE it as part of an upgrade process (Plone has been 
> doing this), but there's no special profile type that GS knows about.

Understood.

> upgrade steps are not meant to represent simple profile edits.  for those, 
> you'd just change the profile and up the profile version number, no need for 
> an upgrade step at all.

How do you add a version number to a profile?  You can add a version
to an import step in import_steps.xml, but I do not see version info
in the zcml of a profile.

Or do you just mean the version.txt?  The quick installer uses that of
course.  GenericSetup does not use that anywhere as far as I see.

> upgrade steps are needed for more complex situations, which cannot
> be represented as profile edits, and which require custom python
> code.

My main gripe with GS is currently the handling of catalog.xml.  See
this issue (well, feature request):
http://www.zope.org/Collectors/CMF/455

When you want to remove an index or column you can do that by editing
the profile and adding remove="True" to that index or column.  So this
upgrade can be represented as a profile edit.  But applying the
profile will empty the remaining indexes that are mentioned in that
profile.  So ideally I would want to apply the profile only once when
installing and rely on upgrade steps to handle any further changes
without applying that complete profile again.

It seems the new upgrade steps do not really solve this particular use
case then.  (It can sure be handy for other things, no doubt about
that.)  But I had hopes to use them to work around this issue with
catalog.xml.  Apparently a workaround is no substitute for really
solving the problem. ;-)

Is anyone going to the sprints after the Plone conference who wants to
take a shot at this with me?  Preferably someone with commit rights. :-)


[snip example]

> performing a full upgrade, then, would require reapplying the profile 
> configuration and running the upgrade steps.  reasonably the quickinstaller 
> (or even the GS interface) could do this all as one step.

Right.  Or a warning could be displayed: "This profile has upgrade
steps available; do you want to run them?"

> hopefully my above explanation helps clarify the intent of the upgradeSteps 
> directive.

Certainly.  Thanks a lot.

-- 
Maurits van Rees | http://maurits.vanrees.org/ [NL]
            Work | http://zestsoftware.nl/
"Do not worry about your difficulties in computers,
 I can assure you mine are still greater."



More information about the Zope-CMF mailing list