-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PLIP 3395 plone.base
: Untangles existing circular dependencies (imports/zcml) in Plone.
#3395
Comments
plone.base
: Untagles existing circular dependencies (imports) in Plone.plone.base
: Untagles existing circular dependencies (imports) in Plone.
plone.base
: Untagles existing circular dependencies (imports) in Plone.plone.base
: Untangles existing circular dependencies (imports) in Plone.
I implemented already the major part of it. |
plone.base
: Untangles existing circular dependencies (imports) in Plone.plone.base
: Untangles existing circular dependencies (imports/zcml) in Plone.
Cool to see this moving forward!! 🎉 💯 One question from a CI point of view: the goal is of course to get rid of the circular dependencies, but do we have a way to ensure we are not adding them back yet? 😅 Should we add another check on our CI, that tests, only on an approved list of the sorts (to avoid too much noise), that packages do not get themselves tangled in a circular dependency? 🙂 |
@gforcada I think this is a good idea. I am not familiar with the tools to analyse on import level (and as bonus ZCML!) if we run into circular dependencies. |
ZCML is indeed a bit more complex... for import level, if we use |
Well, checking |
that's exactly what |
I have added myself as seconder of this PLIP. Status: Jens mostly finished this in January already. In the Plone 6 coordination meeting today, he said he wants to wait until all the ES6 stuff is merged, and then finish it. Note that there is not yet an initial approval of the idea by the @plone/framework-team. |
This PLIP has been approved in some follow up emails after the FWT meeting the happened the 10th of March. |
This would need an upgrade step in See |
Also, we should be careful that we do not clean this up and then reintroduce old interfaces later on, for example when running a |
This would be necessary, but it is not necessary for the next alpha. |
part 1 merged |
@jensens Can you make a PyPI release of Without a release, currently the |
@maurits wouldn't it be better to fix the GHA over there to use buildout.coredev? I anyway wondered why such a non standard layout is used there. |
See:
That test setup will be a recurring pain |
This is done, improvements are still possible. Left are deprecation warnings. I tend to close this one and do so. |
PLIP (Plone Improvement Proposal)
Dear @plone/framework-team - I am happy to submit this PLIP
Responsible Persons
Proposer: @jensens
Seconder: @mauritsvanrees
Abstract
This PLIP is a major step toward the cleanup of our dependency mess in Plone core. It untangles the (implicit) dependencies on import/ ZCML level and ensures a clean dependency graph.
Motivation
After discussion around PLIP #3355, the result was to start with a new
plone.base
package to resolve existing circular dependencies.Current circular dependencies between
Product.CMFPlone
and severalplone.app.*
and someProducts.*
packages are inconvenient and wrong. My heart is bleeding with this architecture. In #3355Assumptions
Product.CMFPlone
is consumer of (IOW it imports) mostplone.*
and someProducts.*
packages. If it provides functionality, this is done by adapters and utilities only.Most circular dependencies are between other core and
Product.CMFPlone
modules/packagesinterfaces.*
permissions
utils
PloneBatch
defaultpage
i18nl10n
That said, some packages have special needs, here an analysis of all packages:
plone.app.contentlisting
: utils, interfaces andBatch
is used. Latter could live inplone.base
or moved toplone.batching
. Plone base overhaul plone.app.contentlisting#43plone.app.contentmenu
: utils, interfaces Plone base overhault plone.app.contentmenu#34plone.app.contentrules
:plone.app.contenttypes
:CMFPlone.browser.syndication.adapters.CollectionFeed
.plone.app.dexterity
utils, interfaces, Batch Plone base overhaul plone.app.dexterity#348plone.app.discussion
utils, interfaces, Batch, DISCUSSION_ANNOTATION_KEY (could be moved to pa.discussion) Plone base overhaul plone.app.discussion#195plone.app.layout
Base overhaul plone.app.layout#302CMFPlone.browser.syndication.adapters.*
CMFPlone.defaultpage.check_default_page_via_view
plone.app.multilingual
- utils, interfaces andCMFPlone.defaultpage.is_default_page
. This one is an optional addon anyway. Should be moved as a dependency ofPlone
package, there are only few traces in CMFPlone anyway. That way it would be a consumer ofProducts.CMFPlone
so it could depend directly onProducts.CMFPlone
(which is not necessary).plone.app.registry
- utils, interfaces. Plone.base overhaul plone.app.registry#63plone.app.theming
CMFPlone.resources
.plone.app.users
CMFPlone.controlpanel.events.ConfigurationChangedEvent
,CMFPlone.RegistrationTool.EmailAddressInvalid
plone.app.workflow
: interfaces, utils. Plone base overhaul plone.app.workflow#32plone.app.event
: interfaces.utils andCMFPlone.i18nl10n
. Plone.base overhaul plone.app.event#356plone.app.linkintegrity
: interfaces.plone.app.querystring
: utils and interfacesplone.app.redirector
: single interface importplone.app.relationfield
: single interface in ZCMLplone.app.textfield
: one util, one interface usageplone.app.versioningbehavior
: one usage of utilsplone.app.widgets
: one use of utilsplone.app.z3cform
: interfaces and utilsPackages which are OK as dependencies of CMFPlone
plone.app.i18n
plone.app.intid
plone.app.lockingbehavior
plone.app.uuid
Packages which are OK as pure consumers of CMFPlone:
plone.api
plone.app.upgrade
plone.app.caching
plone.app.iterate
Packages with circular dependencies not primary addressed by this PLIP. We try to fix them along anyway if possible without major efforts.
plone.app.vocabularies
- it is a nice idea to bundle all vocabularies here, but in fact they should be placed where semantically belonging to, except the generic ones in there. I.e. ifplone.app.querystring
has data to be presented as vocabulary, well, put it there. This can probably be untangled with some effort. Same for Image sizesCMFPlone.utils.getAllowedSizes
dependency.plone.app.content
Products.CMFPlone.DublinCore
is needed here. Question is how much we need fromDublinCore
and if it can go in toplone.dexterity
? Need research.plone.app.contentrules
: FurthermoreCMFPlone.browser.navigation.PhysicalNavigationBreadcrumbs
andProducts.CMFPlone.Portal.PloneSite
(in zcml) is used.plone.app.viewletmanager
:CMFPlone.exportimport.tests.base.BodyAdapterTestCase
Proposal & Implementation
A new package
plone.base
will be created. It contains at least:interfaces.*
permissions
utils
PloneMessageFactory
in NS-root.batch
i18nl10n
For each moved package a deprecation will be created according to the best practices in our Plone Deprecation Guide.
Already deprecated functionality from Plone 5 wont be moved but removed.
Imports will be fixed in
Products.CMFPlone
.In a second step all core packages will be fixed to use the new
plone.base
.If there are tests for the moved functionality and it is feasible to move those w/o major efforts, it will be moved to, otherwise it stays in CMFPlone.
Deliverables
The PLIP will be merged in two steps:
new
plone.base
andProducts.CMFPlone
- this should happen in alpha phase!PLIP config at https://github.com/plone/buildout.coredev/blob/6.0/plips/plip-3395-plone.base-part-1.cfg
adopt package by package to fix imports and remove deprecation warnings
Risks
Participants
The text was updated successfully, but these errors were encountered: