[ckan-dev] Recommended practice for supporting both CKAN 1.8 and 2.0 in extensions
John Glover
john.glover at okfn.org
Wed Jan 16 18:52:08 UTC 2013
The solution we had for this before was to make a branch in the extension
with the same name as the CKAN release branch that it supports. So in
googleanalytics we would create branches release-v1.8 and release-v2.0. The
extension master branch would then be kept up to date with CKAN master.
John
On 16 January 2013 17:59, Sean Hammond <sean.hammond at okfn.org> wrote:
> Hey all,
>
> This is something we should probably get down in the extensions docs or
> on a wiki page before we release 2.0.
>
> If an extension wants to support both 1.x and 2.0, how should it do it?
>
> ckanext-googleanalytics supports both:
>
> https://github.com/okfn/ckanext-googleanalytics
>
> I gave it public, templates and legacy_public and legacy_templates dirs,
> and I made it look for the ckan.legacy_templates option in the config
> file and tell CKAN which dirs to use accordingly.
>
> But it's not just templates, there can also be Python differences, e.g.
> you import and use something that is new in 2.0 then your extension
> crashes in 1.8. You could again make the behaviour conditional on the
> CKAN version.
>
> But maybe it should be done with the master branch being 2.0 and a
> legacy branch for 1.x, and then just put install instructions for both
> 2.0 and 1.8 (saying to checkout the legacy branch) into the README on
> the master branch. The code would be simpler. If you added new features
> to the extension you'd have to manually port them to the legacy branch
> if you want them to work in 1.x. But I imagine a lot of extensions would
> not bother with 1.x support for new features,
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130116/bdb48e14/attachment-0001.html>
More information about the ckan-dev
mailing list