Closed felixarntz closed 3 years ago
IB ready for review.
Added an estimate.
Updated to IB slightly to mention the assets/js/modules/search-console/datastore/constants.js
DATE_RANGE_OFFSET
value.
@benbowler IB ✅ , except one thing:
Update the offset value passed
DATE_RANGE_OFFSET
inassets/js/modules/search-console/datastore/constants.js
value back to2.
That should be set to 1 similar to how it is in PHP. Can you update that? I'll move over to Execution Backlog since that doesn't need another review 👍
After this is merged other devs may have to run composer install
within docker to update their local third-party
directory using phpscoper
as this directory is ignored by git.
@felixarntz I just noticed that the dataState
property is only available on master
branch not on the v0.156 release as of yet. I've tested this working with the dev-master
branch of the repository in composer.json
.
I would normally avoid using dev-master
for live projects but the Google PHP API Client Services README says:
If you are currently using the v1-master branch of the client library, but want to use the latest API services, you can do so by requiring this library directly into your project via the same composer command: composer require google/apiclient-services:dev-master
.
@eclarke1 @fhollis FYI this is awaiting an external update of the Google API PHP client library we're using. The work on this issue is basically completed, but it can only be merged and QAd once that library has released an update.
@benbowler I've added an extra bullet point to the QA Brief here, I think it's important to mention the exact user-facing change here: Now data is shown for 1 day ago, previously it was a different offset.
1.24.0
1.25.0
Search Console recently released a big API update relevant for Site Kit: Related to #2284 (where we actually incorrectly assumed this was already in place), we can now display "fresh data" in Search Console reports via the API.
We should migrate from using the legacy API
https://www.googleapis.com/webmasters/v3/
tohttps://searchconsole.googleapis.com/
as the new functionality is only available on the latter. Other than that though, the new API is fully backward-compatible, in fact it uses the same URLs (including "legacy prefix"/webmasters/v3/
within the new API) to achieve that.We can easily take care of this migration by updating the Google API client services library to the latest version and relying on the
SearchConsole
class instead of theWebmasters
class. We can then set the newdataState
argument via the new request class to include fresh data in the API responses. In combination with that change, we can now finally change the day offset to 1 day before, from currently 2 days before.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
SearchConsole
API instead of the legacyWebmasters
API.webmasters
service of the module should accordingly be renamed tosearchconsole
.GET:searchanalytics
REST datapoint should be updated to always pass thedataState
argument with value "all" to the Google API request.Implementation Brief
composer update google/apiclient-services
includes/Modules/Search_Console.php
that are prefixed withGoogle_Service_Webmasters
toGoogle_Service_SearchConsole
(Which is an extended version of the existing class) and update all uses of these classes in the rest of the file.webmasters
in values and function names tosearchconsole
in theincludes/Modules/Search_Console.php
+ testcreate_search_analytics_data_request
function withinincludes/Modules/Search_Console.php
before$filters = array()
to always set the dataState to "all" like so:$request->setDataState('all');
$this->parse_date_range(
at line 203 from2 // Offset.
back to1
.DATE_RANGE_OFFSET
inassets/js/modules/search-console/datastore/constants.js
value back to1
.Test Coverage
Visual Regression Changes
QA Brief
Changelog entry