-
Notifications
You must be signed in to change notification settings - Fork 847
add Blog token health check #19301
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
add Blog token health check #19301
Conversation
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.
Here are some suggested test cases for this PR.
Connection
- In-place connection with free plan
- In-place connection with paid plan
- In-place connection with product purchase
- Classic connection. Use Safari, or set a constant
JETPACK_SHOULD_NOT_USE_CONNECTION_IFRAMEto true - Disconnect/reconnect connection
- Secondary user connection
- Connection on multisite
Verify that the changes are compatible with the plugins that use the connection package.
- WooCommerce Payments
- Jetpack Boost
- Previous versions of Jetpack
If you think that suggestions should be improved please edit the configuration file here. You can also modify/add test-suites to be used in the configuration file.
|
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 🤖 Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
fgiannar
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.
Hi Leo!
Thanks for working on this!
I left some thoughts/suggestions inline.
| $m = new Connection_Manager(); | ||
| $user_id = get_current_user_id() ? get_current_user_id() : $m->get_connection_owner_id(); | ||
| $m = new Connection_Manager(); | ||
| $user_id = get_current_user_id() ? get_current_user_id() : $m->get_connection_owner_id(); |
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.
Two suggestions :)
- How about we use
$m->is_userless()here? - I was thinking if it would be more straightforward to keep all token health checks in the same test? This way we don't need to skip it in case of a user-less connection or run a duplicate test in case of a full connection.
projects/plugins/jetpack/_inc/lib/debugger/class-jetpack-cxn-tests.php
Outdated
Show resolved
Hide resolved
fgiannar
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.
LGTM 🥇
Adapts the local suite tests to work with user-less.
If the test is called in a context without a logged in user and without a connection owner, it will skip the check for the user token health.
If there is a connected logged in user, or if the site has a connected owner, it will also check for the user token health
Changes proposed in this Pull Request:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
N/A
Testing instructions:
Invalidate the Blog token and see that the test fails