Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

<genericsetup:upgradeDepends>

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


ra at burningman

Aug 7, 2008, 11:26 AM

Post #1 of 4 (295 views)
Permalink
<genericsetup:upgradeDepends>

hi all,

i've got a GenericSetup branch called 'ra-depends-tag' with a working
implementation of a <genericsetup:upgradeDepends> ZCML tag. this tag can be
used anywhere that you could use a <genericsetup:upgradeStep> tag (i.e. either
standalone, or nested within a <genericsetup:upgradeSteps>). in fact,
upgradeDepends is simply a special case of upgradeStep that allows you to
specify a set of profile import steps to be re-applied to the site, rather
than calling a generic python handler.

here's an example of how it looks:

<genericsetup:upgradeDepends
profile="Products.Something:default"
source="1.0"
destination="1.1"
sortkey="10"
title="Re-run 'foo' import step"
import_steps="foo"
purge="True"
run_deps="False"
/>

or alternatively:

<genericsetup:upgradeSteps
profile="Products.Something:default"
source="1.0"
destination="1.1"
sortkey="10"
/>
<genericsetup:upgradeDepends
title="Re-run 'foo' and 'bar' import steps"
import_steps="foo bar"
purge="True"
run_deps="False"
/>
<genericsetup:upgradeStep
title="Do something else"
handler="Products.Something.upgrades.do_something_else"
/>
</genericsetup:upgradeSteps>

some notes:

- there is no problem nesting both upgradeStep and upgradeDepends tags within
the same upgradeSteps tag

- the purge and run_deps attributes are optional and both default to False

- the import_steps attribute is of token type, so you can list multiple steps
separated by whitespace and they will all be run

- the import_steps attribute is optional, if it is omitted then the entire
profile will be reapplied

- it's not demonstrated in the examples above, but the 'checker' attribute
(which points to a callable that can be run to determine whether or not the
upgrade action should be performed) is supported, it functions exactly as it
does within an upgradeStep tag

the justification for the existence of this tag should be pretty obvious. one
of the most frequent actions that need to be performed when upgrading to a new
version of a product is the reapplication of whichever import steps have been
modified since the last profile revision. you could use the upgradeStep tag
to point to a handler that performs this operation, but that requires
boilerplate python code, and there's no easy way to express whether or not you
want the dependencies to be run, or purge_old to be set, or even which steps
should be run. this tag resolves those issues.

please feel free to peek at the branch and provide feedback on the work. if
there are no objections, i'd like to merge this to the GS trunk as soon as it
is deemed appropriate by the release manager.

thanks,

-r

_______________________________________________
Zope-CMF maillist - Zope-CMF[at]lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


ra at burningman

Aug 13, 2008, 4:22 PM

Post #2 of 4 (242 views)
Permalink
Re: <genericsetup:upgradeDepends> [In reply to]

Rob Miller wrote:
> hi all,
>
> i've got a GenericSetup branch called 'ra-depends-tag' with a working
> implementation of a <genericsetup:upgradeDepends> ZCML tag. this tag
> can be used anywhere that you could use a <genericsetup:upgradeStep> tag
> (i.e. either standalone, or nested within a
> <genericsetup:upgradeSteps>). in fact, upgradeDepends is simply a
> special case of upgradeStep that allows you to specify a set of profile
> import steps to be re-applied to the site, rather than calling a generic
> python handler.
>
> here's an example of how it looks:
>
> <genericsetup:upgradeDepends
> profile="Products.Something:default"
> source="1.0"
> destination="1.1"
> sortkey="10"
> title="Re-run 'foo' import step"
> import_steps="foo"
> purge="True"
> run_deps="False"
> />
>
> or alternatively:
>
> <genericsetup:upgradeSteps
> profile="Products.Something:default"
> source="1.0"
> destination="1.1"
> sortkey="10"
> />
> <genericsetup:upgradeDepends
> title="Re-run 'foo' and 'bar' import steps"
> import_steps="foo bar"
> purge="True"
> run_deps="False"
> />
> <genericsetup:upgradeStep
> title="Do something else"
> handler="Products.Something.upgrades.do_something_else"
> />
> </genericsetup:upgradeSteps>
>
> some notes:
>
> - there is no problem nesting both upgradeStep and upgradeDepends tags
> within the same upgradeSteps tag
>
> - the purge and run_deps attributes are optional and both default to False
>
> - the import_steps attribute is of token type, so you can list multiple
> steps separated by whitespace and they will all be run
>
> - the import_steps attribute is optional, if it is omitted then the
> entire profile will be reapplied
>
> - it's not demonstrated in the examples above, but the 'checker'
> attribute (which points to a callable that can be run to determine
> whether or not the upgrade action should be performed) is supported, it
> functions exactly as it does within an upgradeStep tag
>
> the justification for the existence of this tag should be pretty
> obvious. one of the most frequent actions that need to be performed
> when upgrading to a new version of a product is the reapplication of
> whichever import steps have been modified since the last profile
> revision. you could use the upgradeStep tag to point to a handler that
> performs this operation, but that requires boilerplate python code, and
> there's no easy way to express whether or not you want the dependencies
> to be run, or purge_old to be set, or even which steps should be run.
> this tag resolves those issues.
>
> please feel free to peek at the branch and provide feedback on the
> work. if there are no objections, i'd like to merge this to the GS
> trunk as soon as it is deemed appropriate by the release manager.

can i assume from the silence that there are no objections to me merging this
to trunk? if i don't hear any within the next 24 hours or so, i'll go ahead
and do so.

cheers,

-r

_______________________________________________
Zope-CMF maillist - Zope-CMF[at]lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


wichert at wiggy

Oct 8, 2008, 8:04 AM

Post #3 of 4 (124 views)
Permalink
Re: <genericsetup:upgradeDepends> [In reply to]

Previously Rob Miller wrote:
> hi all,
>
> i've got a GenericSetup branch called 'ra-depends-tag' with a working
> implementation of a <genericsetup:upgradeDepends> ZCML tag. this tag can
> be used anywhere that you could use a <genericsetup:upgradeStep> tag (i.e.
> either standalone, or nested within a <genericsetup:upgradeSteps>). in
> fact, upgradeDepends is simply a special case of upgradeStep that allows
> you to specify a set of profile import steps to be re-applied to the site,
> rather than calling a generic python handler.
>
> here's an example of how it looks:
>
> <genericsetup:upgradeDepends
> profile="Products.Something:default"
> source="1.0"
> destination="1.1"
> sortkey="10"
> title="Re-run 'foo' import step"
> import_steps="foo"
> purge="True"
> run_deps="False"
> />

I would like to see a simple extension: the ability to run one or more
steps from another profile. This can be very useful when you run
upgrades for a base profile which load (steps from a) profile from an
add-on package.

Wichert.

--
Wichert Akkerman <wichert[at]wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
_______________________________________________
Zope-CMF maillist - Zope-CMF[at]lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


wichert at wiggy

Oct 8, 2008, 8:05 AM

Post #4 of 4 (123 views)
Permalink
Re: <genericsetup:upgradeDepends> [In reply to]

Previously Wichert Akkerman wrote:
> Previously Rob Miller wrote:
> > hi all,
> >
> > i've got a GenericSetup branch called 'ra-depends-tag' with a working
> > implementation of a <genericsetup:upgradeDepends> ZCML tag. this tag can
> > be used anywhere that you could use a <genericsetup:upgradeStep> tag (i.e.
> > either standalone, or nested within a <genericsetup:upgradeSteps>). in
> > fact, upgradeDepends is simply a special case of upgradeStep that allows
> > you to specify a set of profile import steps to be re-applied to the site,
> > rather than calling a generic python handler.
> >
> > here's an example of how it looks:
> >
> > <genericsetup:upgradeDepends
> > profile="Products.Something:default"
> > source="1.0"
> > destination="1.1"
> > sortkey="10"
> > title="Re-run 'foo' import step"
> > import_steps="foo"
> > purge="True"
> > run_deps="False"
> > />
>
> I would like to see a simple extension: the ability to run one or more
> steps from another profile. This can be very useful when you run
> upgrades for a base profile which load (steps from a) profile from an
> add-on package.

.. and support upgrade-profiles similar to what we have been using for
Plone releases for a while now. Extremely useful stuff.

Wichert.

--
Wichert Akkerman <wichert[at]wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
_______________________________________________
Zope-CMF maillist - Zope-CMF[at]lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.