collective / dexterity.membrane

enables dexterity content items to be used as users and groups in Plone sites
3 stars 14 forks source link

Upgrade from 0.4 to 1.1.0b2 #14

Closed rodfersou closed 9 years ago

rodfersou commented 9 years ago

I have a package that uses version 0.4 and recently we created another addon with version 1.1.0b2, what makes me need to upgrade the first package to make both work on same buildout.

I noticed that for this upgrade this interface changed from:

dexterity.membrane.behavior.membraneuser.INameFromFullName
dexterity.membrane.behavior.membraneuser.NameFromFullName

to:

dexterity.membrane.behavior.user.INameFromFullName
dexterity.membrane.behavior.user.NameFromFullName

What is the best way to achive this upgrade?

mauritsvanrees commented 9 years ago

1.1.0b2 has backwards compatibility code so both work. So it looks to me like nothing is needed.

Well, it would be good to update the first package to import from the new location, either with a try/except so it still works with the old 0.4 version or with a minimum required version in setup.py.

Or are you thinking of going through the zodb looking for persistent data where this class is used? There might be code in plone.app.upgrade that does something similar.

hvelarde commented 9 years ago

@mauritsvanrees do you think something similar to this could work?

https://github.com/simplesconsultoria/sc.photogallery/blob/master/src/sc/photogallery/content.py#L6:L8

mauritsvanrees commented 9 years ago

@hevelarde That is not needed. We have that in another form: 0ecade9fd86824238aa709fd0893c4f72ac82f31

The only thing we might need extra is an upgrade step that goes through current members and changes them to use the new class and the new interface. And that fixes this in any other places where those classes might be used. Safer is to keep the backwards compatibility code forever.

rodfersou commented 9 years ago

@hvelarde @mauritsvanrees thank you for the guidance, I'll add the upgrade step in our package to fix the interface location.