-
Notifications
You must be signed in to change notification settings - Fork 822
Add Jetpack Monitor uptime in get site endpoint response #43999
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
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
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 🤖 Follow this PR Review Process:
If you have questions about anything, 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. |
Code Coverage SummaryCoverage changed in 2 files.
|
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:
✅ https://public-api.wordpress.com/rest/v1.2/me/sites
-- returns the new field
❌ https://public-api.wordpress.com/rest/v1.1/sites/:idOrSlug
does not return the new field. Is this expected? Or I guess it's OK since we don't need this at single-site level as we already have another endpoint for it?
How I test:
- sandboxed public-api
- checked out the branch 185812-ghe-Automattic/wpcom on wpcom
- applied jetpack-downloader of this PR on wpcom
- and used Jetpack Beta Tester of this PR on the site.
@@ -82,6 +82,7 @@ class WPCOM_JSON_API_GET_Site_V1_2_Endpoint extends WPCOM_JSON_API_GET_Site_Endp | |||
'is_deleted' => '(bool) If the site flagged as deleted.', | |||
'is_a4a_client' => '(bool) If the site is an A4A client site.', | |||
'is_a4a_dev_site' => '(bool) If the site is an A4A dev site.', | |||
'uptime' => '(array) An array keyed by unit of time that contains the site uptime for each day.', |
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.
Follow-up: Is it really needed here?
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.
Looking closer, it inherits from the base class so it's not needed.
@@ -240,6 +241,7 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint { | |||
'was_hosting_trial', | |||
'was_upgraded_from_trial', | |||
'is_a4a_dev_site', | |||
'uptime', |
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 is needed so that when the a request is made on WoA sites, the endpoint redecorates the response with these WPCOM values.
Closing as we're not pursuing this approach for now. |
Ref DOTDASH-55.
Proposed changes:
This PR introduces the
uptime
field to the GET site endpoint. This field will be used to populate Jetpack Monitor uptime data for WP.com site/sites endpoints.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
This PR does not introduce any behavioral changes.