-
Notifications
You must be signed in to change notification settings - Fork 800
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
Publicize: Use get_all_connections_for_user in wpcom/v2 endpoints #40604
base: update/unify-schema-for-connections-management
Are you sure you want to change the base?
Publicize: Use get_all_connections_for_user in wpcom/v2 endpoints #40604
Conversation
Expanding on #40589 this attempts to refactor the wpcom/v2 endpoints and bring the get_all_connections_for_user method to publicize-base. It means we start relying on the XMLRPC calls entirely, which could be a performance problem with testing the connections. There's probably some more refactoring we could do to proxy the endpoints and use those within Publicize, by overriding some of the methods, like get_publicize_conns_test_results
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. 🔴 Action required: Please add missing changelog entries for the following projects: Use the Jetpack CLI tool to generate changelog entries by running the following command: Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
@@ -263,7 +263,7 @@ public static function get_api_paths() { | |||
} | |||
|
|||
return array( | |||
'refreshConnections' => '/jetpack/v4/publicize/connections?test_connections=1', | |||
'refreshConnections' => '/wpcom/v2/publicize/connection-test-results', |
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.
This won't work in Social plugin.
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.
IMHO #40607 implementation of moving the endpoint is better and will work in all scenarios.
It also has a well defined schema for the fields and also the properties marked as deprecated in the schema.
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.
Following that, we can deprecate the test connections endpoint because the above implementation incorporates that via a flag test_connections
and we don't need to have a separate endpoint for that.
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.
This won't work in Social plugin.
No, I know it went yet, as we also need to move the endpoint, but I've refactored the endpoints in this PR to use get_all_connections_for_user
so everything is using the same code to prodcue the connections data
Expanding on #40589 this attempts to refactor the wpcom/v2 endpoints and bring the get_all_connections_for_user method to publicize-base.
It means we start relying on the XMLRPC calls entirely, which could be a performance problem with testing the connections.
There's probably some more refactoring we could do to proxy the endpoints and use those within Publicize, by overriding some of the methods, like get_publicize_conns_test_results
Fixes #
Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: