-
Notifications
You must be signed in to change notification settings - Fork 846
REST API endpoints: expand management endpoints #16713
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
Conversation
|
Thank you for the great PR description! When this PR is ready for review, please apply the E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-16713 Scheduled Jetpack release: September 1, 2020. |
|
I received a fatal error when I sent a POST request to the new It looks like |
Co-authored-by: Kim Brown <[email protected]>
…ic/jetpack into add/plugin-management-endpoints
Good catch. This should be solved in 6d3aa98 |
0190009 to
16e9cb2
Compare
leogermani
left a comment
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.
Tested following the instructions and the other PR and everything worked as expected.
The only thing I miss are... tests! Would be nice to have tests for those new endpoints.
Another thing not directly related to this PR is the message that appears in the block configuration when Jetpack CRM is active:
"Contacts from this form will be stored in Jetpack CRM if the CRM Jetpack Forms extension is active."
It feels ambiguous to me. We know the plugin is active, so we should not have the "if" there. What do you think?
kbrown9
left a comment
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 tested using the provided testing instructions, and the new endpoints worked well for me. I also tested the endpoints directly with valid and invalid args, and everything looked good.
To integrate form submission into the Jetpack CRM contacts, two things need to be active: the Jetpack CRM plugin and the CRM's Jetpack Forms extension: I think your point is valid. New users that just installed Jetpack CRM probably won't know that Jetpack CRM has extensions, so the current text is confusing and should be changed. We can handle that in a different PR since it's not related to the new endpoints. |
That's a good point! I can take care of that in a follow-up PR. How do you think I should go about mocking plugin lists and plugin installation / activation? |
|
r212300-wpcom |
I think there's a good chance WorDBless can handle it, because it basically involves writing/reading options. Another thing I forgot to mention: our debug helper plugin now has an API tester. So for PRs like this you can rely on it for testing new endpoints without the need of writing new code: props to @sergeymitr |
Co-authored-by: Kim Brown <[email protected]>


Changes proposed in this Pull Request:
Background
In WordPress 5.5, new plugin management endpoints will be added: 50321-core. Those will be used in the block editor by the block directory features. Those endpoints are useful, and could be useful in Jetpack as well to further integrations between our blocks and other plugins for example. #16519 is a good example of an integration that uses the existing
v4/pluginsendpoint, but could benefit from an endpoint allowing you to install the plugin.That said, those endpoints will not be available for us in Jetpack for a while, since we will be supporting folks using WordPress 5.4 until WordPress 5.6 comes out.
Until then, let's extend our current Jetpack endpoints to replicate some of what Core has added. I'd suggest trying to stick to the core implementation in our parameters and responses so we can deprecate our endpoints and switch to Core's once we drop support for WordPress 5.4.
Caveat
I had to add a new optional request parameter to the endpoints so we can pass the source of the request see pbtFPC-H5-p2 for more details.
That makes us diverge from the Core implementation, so it would make deprecating our endpoints once WP 5.5 is the minimum required version a bit more difficult. I could not think of a better alternative though.
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Proposed changelog entry for your changes: