Skip to content

Commit 5973e85

Browse files
authored
chore: updates all dependencies and updates dependency script (GoogleCloudPlatform#1055)
1 parent 24321dd commit 5973e85

File tree

31 files changed

+90
-77
lines changed

31 files changed

+90
-77
lines changed

appengine/flexible/logging/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
3-
"google/cloud-logging": "^1.16.1",
4-
"google/cloud-error-reporting": "^0.15.0",
3+
"google/cloud-logging": "^1.20.0",
4+
"google/cloud-error-reporting": "^0.16.2",
55
"silex/silex": "^2.0",
66
"twig/twig": "^1.29"
77
},

appengine/php55/grpc/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"google/cloud-spanner": "^1.15.0",
4-
"google/cloud-monitoring": "^0.18.0",
4+
"google/cloud-monitoring": "^1.0.0",
55
"google/appengine-php-sdk": "^1.9"
66
}
77
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"google/cloud-error-reporting": "^0.15.0"
3+
"google/cloud-error-reporting": "^0.16.2"
44
}
55
}

appengine/php72/grpc/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"require": {
33
"google/cloud-spanner": "^1.15.0",
4-
"google/cloud-monitoring": "^0.18.0",
5-
"google/cloud-speech": "^0.27.0"
4+
"google/cloud-monitoring": "^1.0.0",
5+
"google/cloud-speech": "^1.0.0"
66
},
77
"require-dev": {
88
"paragonie/random_compat": "^2.0"

asset/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"google/cloud-storage": "^1.9",
4-
"google/cloud-asset": "^0.4.0",
4+
"google/cloud-asset": "^1.0.0",
55
"symfony/console": " ^3.0"
66
},
77
"autoload": {

bigquerydatatransfer/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"google/cloud-bigquerydatatransfer": "^0.14.0"
3+
"google/cloud-bigquerydatatransfer": "^1.0"
44
}
55
}

bigtable/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-bigtable": "^1.0.0",
3+
"google/cloud-bigtable": "^1.3.1",
44
"psr/cache": "^1.0"
55
},
66
"autoload-dev": {

debugger/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "project",
44
"require": {
55
"php": ">= 7.0",
6-
"google/cloud-debugger": "^0.19.0",
6+
"google/cloud-debugger": "^1.0.0",
77
"silex/silex": "~2.0",
88
"twig/twig": "^2.3"
99
},

dlp/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "google/dlp-sample",
33
"type": "project",
44
"require": {
5-
"google/cloud-dlp": "^0.22.0",
5+
"google/cloud-dlp": "^0.26.1",
66
"google/cloud-pubsub": "^1.11.1"
77
}
88
}

endpoints/getting-started/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"require": {
33
"silex/silex": " ^2.3",
44
"symfony/console": " ^3.0",
5-
"google/auth": "^1.5.1"
5+
"google/auth": "^1.8.0"
66
},
77
"require-dev": {
88
"symfony/browser-kit": " ^3.0",

error_reporting/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"google/cloud-error-reporting": "^0.15.0"
3+
"google/cloud-error-reporting": "^0.16.2"
44
}
55
}

error_reporting/test/VerifyReportedErrorTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ private function verifyReportedError($projectId, $message)
5656
// Iterate through all elements
5757
$testFunc = function () use ($errorStats, $projectName, $timeRange, $message) {
5858
$messages = [];
59-
$response = $errorStats->listGroupStats($projectName, $timeRange, [
59+
$response = $errorStats->listGroupStats($projectName, [
60+
'timeRange' => $timeRange,
6061
'pageSize' => 100,
6162
]);
6263
foreach ($response->iterateAllElements() as $groupStat) {

firestore/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-firestore": "^1.4.1",
3+
"google/cloud-firestore": "^1.12.1",
44
"symfony/console": "^3.0"
55
},
66
"autoload": {

iap/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"symfony/console": "^2.8",
4-
"google/auth":"^1.7.1",
4+
"google/auth":"^1.8.0",
55
"guzzlehttp/guzzle": "~6.3.3",
66
"kelvinmo/simplejwt": "^0.2.4"
77
},

iot/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "google/iot-sample",
33
"type": "project",
44
"require": {
5-
"google/cloud-iot": "^0.9.0",
5+
"google/cloud-iot": "^1.0.0",
66
"symfony/console": "^3.3"
77
},
88
"autoload": {

iot/src/list_gateways.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ function list_gateways(
4343
$registryName = $deviceManager->registryName($projectId, $location, $registryId);
4444

4545
// Pass field mask to retrieve the gateway configuration fields
46-
$fieldMask = (new FieldMask())->setPaths(['config', 'gatewayConfig']);
46+
$fieldMask = (new FieldMask())->setPaths(['config', 'gateway_config']);
4747

4848
// Call the API
49-
$devices = $deviceManager->listDevices($registryName,
50-
['fieldMask' => $fieldMask]
51-
);
49+
$devices = $deviceManager->listDevices($registryName, [
50+
'fieldMask' => $fieldMask
51+
]);
5252

5353
// Print the result
5454
$foundGateway = false;

language/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-language": "~0.18",
4-
"google/cloud-storage": "^1.3"
3+
"google/cloud-language": "^0.22.2",
4+
"google/cloud-storage": "^1.20.1"
55
}
66
}

logging/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-logging": "^1.9.0",
3+
"google/cloud-logging": "^1.20.0",
44
"symfony/console": "^3.0",
55
"monolog/monolog": "^1.23"
66
},

monitoring/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"symfony/console": "^3.3",
4-
"google/cloud-monitoring": "^0.18.0"
4+
"google/cloud-monitoring": "^1.0.0"
55
},
66
"autoload": {
77
"files": [

pubsub/app/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"require": {
33
"php": ">=5.4",
4-
"google/cloud-pubsub": "^1.5",
5-
"google/cloud-datastore": "^1.2",
4+
"google/cloud-pubsub": "^1.23.0",
5+
"google/cloud-datastore": "^1.11.2",
66
"silex/silex": "^2.3",
77
"twig/twig": "^2.12",
88
"symfony/twig-bridge": "^4.4"

secretmanager/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"google/cloud-secret-manager": "^0.3.0"
3+
"google/cloud-secret-manager": "^1.0.0"
44
}
55
}

securitycenter/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-security-center": "^0.5.0",
4-
"google/cloud-pubsub": "^1.21"
3+
"google/cloud-security-center": "^0.6.0",
4+
"google/cloud-pubsub": "^1.23.0"
55
}
66
}

spanner/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-spanner": "^1.27",
3+
"google/cloud-spanner": "^1.27.1",
44
"symfony/console": "^3.2"
55
},
66
"autoload": {

spanner/test/spannerBackupTest.php

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
namespace Google\Cloud\Samples\Spanner;
1919

20+
use Google\Cloud\Core\ExponentialBackoff;
2021
use Google\Cloud\Spanner\Database;
2122
use Google\Cloud\Spanner\Backup;
2223
use Google\Cloud\Spanner\SpannerClient;
@@ -198,40 +199,28 @@ private function runCommand($commandName, $params = [])
198199

199200
public static function tearDownAfterClass()
200201
{
201-
if (!self::$instance->exists()) {
202-
return;
203-
}
204-
205-
self::waitForOperations();
202+
if (self::$instance->exists()) {
203+
self::waitForOperations();
206204

207-
$exceptions = [];
205+
$backoff = new ExponentialBackoff(3);
208206

209-
$dbs = self::$instance->databases();
210-
/** @var Database $db */
211-
foreach ($dbs as $db) {
212-
if (strstr($db->name(), self::$databaseId) !== false) {
213-
try {
214-
$db->drop();
215-
} catch (\Exception $e) {
216-
$exceptions[] = $e;
207+
/** @var Database $db */
208+
foreach (self::$instance->databases() as $db) {
209+
if (false !== strpos($db->name(), self::$databaseId)) {
210+
$backoff->execute(function () use ($db) {
211+
$db->drop();
212+
});
217213
}
218214
}
219-
}
220215

221-
$backups = self::$instance->backups();
222-
/** @var Backup $backup */
223-
foreach ($backups as $backup) {
224-
if (strstr($backup->name(), self::$databaseId) !== false) {
225-
try {
226-
$backup->delete();
227-
} catch (\Exception $e) {
228-
$exceptions[] = $e;
216+
/** @var Backup $backup */
217+
foreach (self::$instance->backups() as $backup) {
218+
if (false !== strpos($backup->name(), self::$databaseId)) {
219+
$backoff->execute(function () use ($backup) {
220+
$backup->delete();
221+
});
229222
}
230223
}
231224
}
232-
233-
if ($exceptions) {
234-
throw new \RuntimeException(PHP_EOL . implode(PHP_EOL, $exceptions));
235-
}
236225
}
237226
}

speech/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-speech": "^0.27.0",
4-
"google/cloud-storage": "^1.3.1"
3+
"google/cloud-speech": "^1.0.0",
4+
"google/cloud-storage": "^1.20.1"
55
}
66
}

storage/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"google/cloud-storage": "^1.18.0",
3+
"google/cloud-storage": "^1.20.1",
44
"paragonie/random_compat": "^2.0",
55
"symfony/console": " ^3.0"
66
},

testing/run_dependency_update.sh

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#!/bin/bash
2-
# Copyright 2016 Google Inc.
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2020 Google LLC
34
#
45
# Licensed under the Apache License, Version 2.0 (the "License");
56
# you may not use this file except in compliance with the License.
@@ -15,14 +16,36 @@
1516

1617
set -ex
1718

18-
# Loop through all directories containing "composer.json".
19-
# Update composer if a sample has a new major version that matches our requirements.
20-
find * -name "phpunit.xml*" -not -path '*vendor/*' -exec dirname {} \; | while read DIR; do
21-
pushd $DIR
22-
composer install
23-
if composer outdated --direct -m | grep -q 'google/' ||
24-
! composer validate --no-check-publish ; then
25-
composer update
19+
# Find all directories containing composer.json.
20+
directories=$(find . -name "composer.json" -not -path "**/vendor/*" -exec dirname {} \;)
21+
22+
# Update dependencies in all directories containing composer.json.
23+
for SAMPLE_DIR in $directories; do
24+
printf '\n### Checking dependencies in %s ###\n', "$SAMPLE_DIR"
25+
pushd "$SAMPLE_DIR"
26+
composer install --ignore-platform-reqs --no-dev
27+
28+
updatePackages=()
29+
outdatedPackages=$(echo \
30+
"$(composer outdated 'google/*' --direct --format=json | jq '.installed' 2>/dev/null) $(composer outdated 'firebase/*' --direct --format=json | jq '.installed' 2>/dev/null)" \
31+
| jq -s add)
32+
33+
if [[ "$outdatedPackages" != "null" ]] && [[ "$outdatedPackages" != "[]" ]] ; then
34+
count=$(echo "$outdatedPackages" | jq length)
35+
36+
for (( i = 0; i < count; i++ ))
37+
do
38+
name=$(echo "$outdatedPackages" | jq -r --arg i "$i" '.[$i | tonumber].name')
39+
version=$(echo "$outdatedPackages" | jq -r --arg i "$i" '.[$i | tonumber].latest' | sed -e 's/^v//')
40+
if [[ "${version:0:4}" != dev- ]]; then
41+
updatePackages+=( "$name:^$version" )
42+
fi
43+
done
44+
45+
if [ ${#updatePackages[@]} -gt 0 ]; then
46+
composer require --ignore-platform-reqs --update-no-dev --update-with-dependencies "${updatePackages[@]}"
2647
fi
27-
popd
48+
fi
49+
50+
popd
2851
done

texttospeech/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"google/cloud-text-to-speech": "^0.5.0"
3+
"google/cloud-text-to-speech": "^1.0.0"
44
}
55
}

trace/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
33
"opencensus/opencensus": "^0.2.1",
4-
"google/cloud-trace": "^0.15.0"
4+
"google/cloud-trace": "^1.0.0"
55
}
66
}

translate/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "google/translate-sample",
33
"type": "project",
44
"require": {
5-
"google/cloud-translate": "^1.5"
5+
"google/cloud-translate": "^1.7.2"
66
},
77
"require-dev": {
88
"google/cloud-storage": "^1.14"

vision/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "google/vision",
33
"type": "project",
44
"require": {
5-
"google/cloud-vision": "^0.24.0",
6-
"google/cloud-storage": "^1.3",
5+
"google/cloud-vision": "^1.0.0",
6+
"google/cloud-storage": "^1.20.1",
77
"symfony/console": "^3.1"
88
},
99
"autoload": {

0 commit comments

Comments
 (0)