Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
PLIP: Ship Plone with plone.restapi #2177
PLIP: Ship Plone with plone.restapi
Proposer: Timo Stollenwerk firstname.lastname@example.org
plone.restapi is a RESTful hypermedia API for Plone. Companies such as 4teamwork, code syntax, kitconcept, VNC and others use plone.restapi in production since many years already. Adding it to Plone core will allow us to further enhance our headless CMS efforts.
Proposal & Implementation
plone.restapi 1.0 will be released this year and is considered to be a stable and mature piece of software.
There is a small risk that plone.rest could break existing functionality of browser views that use application/json as HTTP accept header. We encountered a single issue since plone.restapi has been created. We do not really expect any problems, but they might occur.
moved this from Submitted (information complete)
to In Process (approved)
Nov 14, 2017
The PLIP was reviewed on Ubuntu 16.04 using python 2.7.8 (https://github.com/collective/buildout.python) and Chromium 49.0.2623.108.
December 10, 2017
and for plone.test:
Notes and observations
Tested in anonymous mode.
Tested in authenticated mode.
Implementation is clean.
plone.api is only used in tests.
Archetypes support is provided through
Very good documentation.
plone.rest and plone.restapi are ready to be shipped with Plone.
We need a pull request on Products.CMFPlone to add plone.restapi as a dependency.
It seems Plone 5.2 removed Products.Five.metaclass:
It there an upgrade guide for Plone 5.2 with a list of removed imports?
@pbauer thanks for the link! Though, this is still pretty far away from an integrators-ready upgrade guide. :)
@plone/framework-team When I wrote the PLIP, I really expected this to be a 30 minutes job. If this becomes more a days/week-like challenge, because of the Zope 4 changes, I might have to drop the PLIP.
I really want to focus on pushing things on the front end (plone-react, pastanaga, etc) and I think it makes more sense for the Plone community if I spend my time there.
If anybody wants to help out or take over this PLIP, I am happy to do what I can to help...
@jensens I will set up a PLIP jenkins job to show the current test failures. It seems something in plone.rest is broken that leads to additional test failures in plone.restapi. I fixed the obvious import problems. Though, as said, I have no idea about the changes in Zope 4, so I am lost.
Would be great if someone at the sprint could look into this!
The jenkins job that @tisto created is here http://jenkins.plone.org/view/PLIPs/job/plip-plone-restapi/ for everyone's pleasure to run it
As a starting point, I would recommend looking into why plone.rest returns a 404 instead of a 401:
referenced this issue
Jan 30, 2018
referenced this issue
Feb 5, 2018
We had a look at the TUS implementation.
It seems it stores the uploads in tmp-dirs. How is it supposed to scale up over more than one machine?
@jensens there is a TUS implementation in plone 5 and this issue was got around by turning it off by default. Not ideal but I don't see any choice but to do the same with restapi.
I'd love to see an analysis and roadmap of how current Plone core components (like folder contents and relation widget) will use the REST API together with this PLIP. This will make it easier for new developers to understand. Otherwise this is yat (Yet another thing
@tomgross +1, we need to write down some best practices for add-on developers how to implement a proper plone.rest-based and plone.restapi compliant API as well as start to move core components that do not need to be server-side rendered.
Though, I fully agree with @jensens that this is beyond the scope of this PLIP. The first step is to ship with plone.restapi. Then we can start with migrating. Not sure if we even need a PLIP, if both React and plone.restapi have been approved in the core.
Ideally, we can just make components from plone-react re-usable and integrate them into standard Plone.
Personally, I plan to fully focus on plone-react in the future. Though, the plone-react team is more than happy to assist if anybody is interested in using components outside of plone-react. :)
@plone/framework-team thanks to @davisagli and @sunew we are very close to a green build. Just one test isolation issue is left. Can we merge the PLIP right away on a green build? I see the risk that we have to spend way more work on this if we don't merge it as soon as it is green since the Plone 5.2 branch is under heavy development right now. :)
@tisto The flickering test is apparently more or less normal:
as seen in this build: https://jenkins.plone.org/job/pull-request-5.2/909/consoleFull
Plone 5.2 build is green: https://jenkins.plone.org/job/plone-5.2-python-2.7/1254/
I am pretty sure the Plip is not finished integration wise.