-
Notifications
You must be signed in to change notification settings - Fork 846
Sync: Use the Heartbeat package to generate the stats array #18494
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
|
Scheduled Jetpack release: February 16, 2021. Thank you for the great PR description! When this PR is ready for review, please apply the |
The Sync package calls Jetpack::get_stat_data to obtain the heartbeat stats array. The Sync package needs to be independent of Jetpack, so use the Heartbeat::generate_stats_array() method instead. When the Jetpack plugin is installed, this method returns the same data as Jetpack::get_stat_data.
9b1dc3c to
7f0452a
Compare
projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-modules-stats.php
Show resolved
Hide resolved
* Add tests that do not require Jetpack data. These tests set their own hook on the 'jetpack_heartbeat_stats_array' filter. * Add comments to the Jetpack integration tests.
|
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 🤖 If you are an automattician, once your PR is ready for review add the "[Status] Needs Team review" label and ask someone from your team review the code. jetpack plugin:
|
Changes proposed in this Pull Request:
The Sync package currently calls
Jetpack::get_stat_data()to obtain the heartbeat stats array. The Sync package needs to be independent of Jetpack, so use theHeartbeat::generate_stats_array()method instead. When the Jetpack plugin is installed, this method returns the same data asJetpack::get_stat_data().I also fixed some phpcs warnings in
test_class.jetpack-sync-modules-stats.php.Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Install, activate, and connect Jetpack.
Set up your sandbox and Unagi so you can watch sync actions. For more info: PCYsg-lgg-p2
SSH in to your remote site and clear the
last_heartbeatJetpack option using wp cli:wp jetpack options delete last_heartbeatTrigger the heartbeat cron job using wp cli:
wp cron event run jetpack_v2_heartbeatYou should see the
jetpack_sync_heartbeat_statssync action in Unagi. Expand the meta data and verify that the data includes an array with these elements (version, wp-version, php-version, etc.).Proposed changelog entry for your changes: