GenericSetup improvements
Some long-coming GenericSetup improvements have landed on the GS trunk.
While at the BBQ Sprint in Chapel Hill, North Carolina earlier this year I was part of a team of people working on improving GenericSetup. A lot was accomplished in NC, but it's been languishing on a branch for a while, waiting for me to find the time to finish up some tests. At long last I've done so, and the changes have been merged back into the GenericSetup trunk. Following is a description of the new goodies you'll find there:
- No more stateful "active profile"
- It used to be that you had to visit the (poorly named) Properties tab of the setup tool to choose an active profile. Then you would visit the Import tab to run all the steps. The process was the same for both base profiles and extension profiles, even though the consequences of importing those profiles are very different.
Now things are better. The profiles available are more clearly separated into baseline profiles and extension profiles. Only one baseline profile can be active at a time, but you can import as many extension profiles as you want to; you don't have to jump through the hoop of making them "active". - Audit trail logs of import actions
- Every time you import any profile, or any steps from any profile, the setup tool will now generate log objects recording the actions taken. Now, if things go pear shaped after an import, it's possible for developers to know exactly which steps were ran.
- Improved setup tool interface
- We needed to tweak the setup tool interface to support the new functionality, and the usability has improved considerably in the process. The ZMI is hardly end user friendly, but people who are managing site configuration will appreciate the changes.
- Profile metadata
- GenericSetup profiles now support a metadata.xml file, for profile metadata such as profile version number and profile dependencies.
- Upgrades
- This is the one I'm most excited about. The CPS upgrade extensions to GenericSetup have landed in the core and been extended somewhat. We've now got <genericsetup:upgradeSteps> and <genericsetup:upgradeStep> directives. Here are examples of what these might look like:
<genericsetup:upgradeStep
title="Merge Types"
description="Merges two formerly separate portal types into one type"
source="3.0"
destination="3.5"
handler="plone.upgrades.3_5.merge_types"
sortkey="1"
profile="Products.CMFPlone:plone" />
<genericsetup:upgradeSteps
source="3.0"
destination="3.5"
sortkey="2"
profile="Products.CMFPlone:plone">
<genericsetup:upgradeStep
title="SubStep 1"
description="SubStep 1 Desc"
handler="plone.upgrades.3_5.substep1"
checker="plone.upgrades.3_5.substep1IsNeeded"
/>
<genericsetup:upgradeStep
title="SubStep 2"
description="SubStep 2 Desc"
handler="plone.upgrades.3_5.substep2"
checker="plone.upgrades.3_5.substep2IsNeeded"
/>
</genericsetup:upgradeSteps>
Once Zope has started, you can visit the Upgrades tab of the setup
tool. There you'll see a dropdown of all of the profiles for which
there are registered upgrade steps. Choose one, and you'll see the
steps that are available. Only the upgrade steps that need to be run
(by virtue of either the source and destination versions, or a declared
checker function) will show up by default, but you can choose to view
all of them if you need to re-run a previous upgrade.
- Profile dependencies --- NOT
- Whoops. We put support for profile dependency registration into the metadata.xml parsing code, but we ran out of time and it isn't actually being used anywhere. Want to help?
You may be wondering at this point what versions of Plone this will work with. Unfortunately, it will currently not work with Plone 2.5.x; the GenericSetup trunk requires Zope 2.10. It works just fine with Plone 3.0, however; just replace the GS that comes with the bundle with the one from the svn trunk (svn://svn.zope.org/repos/main/GenericSetup/trunk), restart Zope, voila. It probably wouldn't be too hard to backport the changes to an older GenericSetup branch, for those so inclined.
I'm happy to see this stuff land; I've been looking forward to it for a while. Hope you enjoy it.
GenericSetup improvements