-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Simplify traversal #105
base: main
Are you sure you want to change the base?
Simplify traversal #105
Conversation
@thet thanks for creating this Pull Request and help improve Plone! To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass. Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:
With this simple comment all the jobs will be started automatically. Happy hacking! |
@jenkins-plone-org please run jobs |
|
||
# Wrap object to ensure we handle further traversal | ||
return RESTWrapper(obj, request) | ||
if IContentish.providedBy(obj) and not ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check for ITraversable
rather than or in addition to IContentish
? Doing that seems to still solve plone/plone.restapi#680 and plone/plone.app.theming#165 (even when converted to IService!) whilst still passing at least plone.rest
tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I'd guess that IContentish is always ITraversable. IContentish excludes the SiteRoot, not sure if that is traversable. Things are complex and different people worked on different parts that depend on plone.rest, so I'd like them to weight in as well. cc @buchi @jaroel @sneridagh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actively remove IContentish
from Plone Site
in https://github.com/plone/Products.CMFPlone/pull/2612/files#diff-860754a57fed2533e4aae6aab34a27caR238-R242 . I did not check how that will affect plone.rest
stuff, but so far it seemed to work.
My gut reaction is that ITraversable
is correct here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're adding IContentish back to PloneSite.
I don't think this changes my position on ITraversable, but it probably will affect other stuff.
Is this whole branch/approach still relevant actually?
@jenkins-plone-org please run jobs |
6e03466
to
66fcf2f
Compare
@jenkins-plone-org please run jobs |
1 similar comment
@jenkins-plone-org please run jobs |
…rtual hosted objects
f83f35d
to
afba67c
Compare
@jenkins-plone-org please run jobs |
@jenkins-plone-org please run jobs |
1 similar comment
@jenkins-plone-org please run jobs |
@thet @petri @petschki could you elaborate on the background of this simplification? What's the actual use case here and the reasoning behind this PR? The traversal mechanism has been subject to multiple refactorings in the past and it needs to cover multiple edge cases that we can not always put into proper unit tests. Changing this requires careful consideration and extensive testing and review. I'd like to understand the reasoning behind this for a proper tradeoff of the risks and chances here. |
I'll try my best... OLD strategy: Try Zope's DefaultPublishTraverse first an catch it's NEW strategy:
So this does exactly the same as before with the benefit of getting rid of the VirtualHostMonster (and possibly other objects) check. If there are missing special traversal objects/paths, they were missing before too. But they can be easily extended after step 3. and before step 4. hope this helps. |
NOTE: this branch is now on a Plone4.3/collective.exportimport migration project of us and works like a charm. The linage subsites delivered with VirtualHostMonster returns now plone.restapi JSON responses. Before there was this error:
/cc @thet I think you also had this one? |
btw. the Jenkins jobs are flapping randomly ... yesterday it was https://jenkins.plone.org/job/pull-request-5.2-3.8/ today it's https://jenkins.plone.org/job/pull-request-5.2-2.7/ but I didn't change anything ... has anybody a clue on this? /cc @jensens @rodfersou |
Thanks for the clarification @petschki. @buchi @sneridagh could you have a look at this PR? |
@jenkins-plone-org please run jobs |
If someone wants to get some more background on this PR, I added a link to the discussion (see thet's original post at the beginning of this PR). It in turn has pointers to some earlier discussions. One thing worth mentioning is that the PR should also let plone.app.theming UI work properly again... afaik it has been partially non-functional ever since plone.rest was included with plone core. |
@jenkins-plone-org please run jobs |
by @petri
Opening this PR to be able to discuss it right here.
EDIT (petri) For background, see discussion in https://community.plone.org/t/json-application-messaging-in-plone-core/12353/11