Skip to content
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

Improve Plone Site Root object API #672

Merged
merged 4 commits into from Feb 16, 2019
Merged

Improve Plone Site Root object API #672

merged 4 commits into from Feb 16, 2019

Conversation

sneridagh
Copy link
Member

Addresses #671

/cc @tisto

@mister-roboto
Copy link

@sneridagh 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:

@jenkins-plone-org please run jobs

With this simple comment all the jobs will be started automatically.

Happy hacking!

@sneridagh sneridagh requested a review from tisto February 15, 2019 20:01
@coveralls
Copy link

coveralls commented Feb 16, 2019

Coverage Status

Coverage decreased (-0.06%) to 96.105% when pulling 1800902 on improveplonesiteapi into 9c5bd45 on master.

@sneridagh
Copy link
Member Author

@jenkins-plone-org please run jobs

Copy link
Sponsor Member

@tisto tisto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Maybe @lukasgraf or @buchi want to have a look as well...

Copy link
Member

@lukasgraf lukasgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes as such look good to me 👍 other than the mentioned point. The outdated documentation is the major point for me, I'd really appreciate if you could fix that up.

hiding the implementation details (the Plone Site Root has no workflow for
historical reasons) and equalizing it to the other content types, making the
API more consistent.
[sneridagh]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm, I'm not a fan of mixing together two such totally unrelated changes, let alone in a single commit. The fact that the changelog entry needs 6 lines should be an indication that this should be split up some more.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to improve the wording and I split up the entry. @sneridagh please double check if you are happy with my amendment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tisto thank you! IMHO that summarizes the changes perfectly. From what I understand, the "opt-in" part just referred to the fact that that the tiles-specific fields aren't required in the deserializer, which is the case in most places in the API, so that can be omitted.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tisto Absolutelly fine with me!!

# API we fake the response to the endpoint by providing an empty
# response instead of a 404.
if IPloneSiteRoot.providedBy(self.context):
result['workflow'].update({'history': [], 'transitions': []})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Immediately return result here? No point in even trying all the rest, right? That would make it clearer what happens here.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thx for the hint!

@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There already is an existing src/plone/restapi/tests/test_site_deserializer.py - can you please integrate your testing changes into that one instead? (And also rename it to something like TestSiteRootDeserializer - the Plone site is not DX content).

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the tests into test_site_deserializer.py and renamed the class name. Thx for the pointer!

@@ -15,6 +15,7 @@ Content-Type: application/json
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the http examples have been updated, the narrative documentation seems to be out of date. https://plonerestapi.readthedocs.io/en/latest/tiles.html needs a major update I think. I'm honestly quite confused at this point when trying to determine which tiles related functionality is implemented, and where, and where the documentation is just stubbed out, talks about future ideas that may or may not happen, or is outdated.

Please, please try to keep the documentation in sync with API changes - it's so very hard to even to attempt to do it after the fact, after things have changed over time.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukasgraf you are absolutely correct. Thanks for pointing that out. I created a separate issue for that since it is not directly related to the PR. #674

@tisto
Copy link
Sponsor Member

tisto commented Feb 16, 2019

@lukasgraf thanks for your detailed and thoughtful review (as always)! I will look into the tiles endpoint update asap.

@tisto
Copy link
Sponsor Member

tisto commented Feb 16, 2019

@jenkins-plone-org please run jobs

@sneridagh
Copy link
Member Author

@lukasgraf Thanks for the review!! Agreed that we have to improve the documentation in both plone.restapi and Volto itself (almost not existent) that's a must that we should address in the next major sprint.

@tisto tisto merged commit 1723564 into master Feb 16, 2019
@tisto tisto deleted the improveplonesiteapi branch February 16, 2019 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants