question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update Google PHP client services library to latest version (again)

See original GitHub issue

Since the Idea Hub API is still being under development and sees frequent updates, we need to make sure we keep the Google API client services library up to date so that we can work with the latest version of that API intuitively.

Unfortunately it looks like the entire library was recently bumped to a 0.2xx (see release notes), including a few substantial changes on the included code - so this update might not be super trivial. However, we shouldn’t have to deal with overall API changes like we had to before with AdSense (see #3517), so it’s still good we were able to do that separately.

Let’s update to the latest version of the library, so that we have the latest Idea Hub API client code and then are set up updating it again in the future more easily to keep up with the Idea Hub API.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The Google API client services PHP library should be updated to its latest version ("google/apiclient-services": "^0.200" in composer.json).
  • The Site Kit PHP code using this library should be updated to still work correctly with the high-level changes made in version 0.200.0.
    • It also needs to be ensured that code is still properly included in the third-party directory via PHP-Scoper.
  • From a QA perspective, this shouldn’t result in any user-facing change, but there should be thorough testing throughout all modules to avoid unexpected breakage. Preferably this should be merged as early as possible in a release cycle, so that enough organic testing can happen.

Implementation Brief

The goal here is to update the dependency, and load the site until it stops breaking, here’s the general approach to do this:

Once the site is up and running, test setting up each module to ensure the API for them still works as expected to get data.

Test Coverage

  • No new tests needed.

Visual Regression Changes

  • N/A

QA Brief

  • For engineering dev builds: install latest composer dependencies.
  • Enable debug logging in WordPress
  • Activate and use every module.
  • Note any errors in debug.log, there shouldn’t be any.

Changelog entry

  • Update Google PHP client services library to latest version

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
felixarntzcommented, Jul 7, 2021

@ivankruchkoff Good point, I agree with you we should go with option 2, keeping the real class names with simply a prefix. We can use aliasing where this causes issues.

0reactions
wpdarrencommented, Jul 19, 2021

QA Update: Pass ✅

  • I tested this on two sites: 1) a new site with all modules connected but no data and 2) a live site with all modules connected with data. Both of these sites had Query Manager and Debug Toolbar enabled and no errors appeared when connecting the modules or using them, changing date periods, engaging with the data, i.e. pie charts, etc.
  • No new console errors appeared while browsing Site Kit modules, settings, etc.

I’ve made @cole10up aware of this so we will keep a look out through this sprint of any weird behaviour.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started with the Google Data PHP Client Library
Choose the PHP installer option (in the Windows binaries section) corresponding to the newest version of PHP and allow it to download. ·...
Read more >
Upgrading Google API client PHP library - Stack Overflow
I use the PHP Google API client to authenticate users for some internal company tools and am in the processes of planning upgrading...
Read more >
google/apiclient - Packagist
Client library for Google APIs.
Read more >
Installation and Configuration | Google API PHP Client - Drupal
Make a libraries directory so now we have DRUPAL_ROOT/libraries; Download the latest release version of google-api-php-client from ...
Read more >
Client Libraries | Service Infrastructure Documentation
These autogenerated Google API Client Libraries are useful for calling the Service Management API. When you use these libraries, your apps benefit from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found