Skip to content

Commit 3090b8a

Browse files
authored
chore!: Promote Trace to V2 (#9006)
1 parent adc8472 commit 3090b8a

81 files changed

Lines changed: 97 additions & 5658 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Core/src/ServiceBuilder.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
use Google\Cloud\Speech\SpeechClient as DeprecatedSpeechClient;
3131
use Google\Cloud\Speech\V2\Client\SpeechClient;
3232
use Google\Cloud\Storage\StorageClient;
33-
use Google\Cloud\Trace\TraceClient;
33+
use Google\Cloud\Trace\V2\Client\TraceServiceClient;
3434
use Google\Cloud\Translate\V2\TranslateClient as DeprecatedTranslateClient;
3535
use Google\Cloud\Translate\V3\Client\TranslationServiceClient;
3636
use Google\Cloud\Vision\V1\Client\ImageAnnotatorClient;
@@ -311,22 +311,16 @@ public function storage(array $config = [])
311311
}
312312

313313
/**
314-
* Google Stackdriver Trace allows you to collect latency data from your applications
315-
* and display it in the Google Cloud Platform Console. Find more information at
316-
* [Stackdriver Trace API docs](https://cloud.google.com/trace/docs/).
317-
*
318-
* Example:
319-
* ```
320-
* $trace = $cloud->trace();
321-
* ```
322-
*
323-
* @param array $config [optional] Configuration options. See
324-
* {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the available options.
325-
* @return TraceClient
314+
* @deprecated
315+
* @see TraceServiceClient
316+
* @throws \BadMethodCallException
326317
*/
327318
public function trace(array $config = [])
328319
{
329-
return $this->createClient(TraceClient::class, 'trace', $config);
320+
throw new \BadMethodCallException(sprintf(
321+
'This method is no longer supported, create %s directly instead.',
322+
TraceServiceClient::class
323+
));
330324
}
331325

332326
/**

Core/tests/Snippet/ServiceBuilderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@
1919

2020
use Google\Cloud\BigQuery\BigQueryClient;
2121
use Google\Cloud\Core\ServiceBuilder;
22-
use Google\Cloud\Datastore\DatastoreClient;
2322
use Google\Cloud\Core\Testing\Snippet\SnippetTestCase;
2423
use Google\Cloud\Firestore\FirestoreClient;
2524
use Google\Cloud\Language\LanguageClient;
2625
use Google\Cloud\Logging\LoggingClient;
2726
use Google\Cloud\PubSub\PubSubClient;
2827
use Google\Cloud\Spanner\SpannerClient;
2928
use Google\Cloud\Storage\StorageClient;
30-
use Google\Cloud\Trace\TraceClient;
3129

3230
/**
3331
* @group root
@@ -57,7 +55,6 @@ public function serviceBuilderMethods()
5755
['pubsub', PubSubClient::class, 'pubsub'],
5856
['spanner', SpannerClient::class, 'spanner', true],
5957
['storage', StorageClient::class, 'storage'],
60-
['trace', TraceClient::class, 'trace'],
6158
];
6259
}
6360

Core/tests/Unit/ServicesNotFoundTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ private static function getApis()
7575
"PubSub",
7676
"Spanner",
7777
"Storage",
78-
"Trace",
7978
"VideoIntelligence",
8079
];
8180
}
@@ -89,7 +88,6 @@ public function serviceBuilderMethods()
8988
['pubsub'],
9089
['spanner'],
9190
['storage'],
92-
['trace'],
9391
];
9492
}
9593

Trace/metadata/V1/Trace.php

Lines changed: 0 additions & 92 deletions
This file was deleted.

Trace/owlbot.py

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Google LLC
1+
# Copyright 2024 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -32,59 +32,16 @@
3232

3333
php.owlbot_main(src=src, dest=dest)
3434

35-
# Change the wording for the deprecation warning.
36-
s.replace(
37-
'src/*/*_*.php',
38-
r'will be removed in the next major release',
39-
'will be removed in a future release')
40-
41-
# Use new namespace in the doc sample. See
42-
# https://github.com/googleapis/gapic-generator/issues/2141
43-
s.replace(
44-
'src/V2/Gapic/TraceServiceGapicClient.php',
45-
r'@type Span_',
46-
r'@type ')
47-
48-
s.replace(
49-
'src/V2/Gapic/TraceServiceGapicClient.php',
50-
r'Span_',
51-
r'Span\\')
52-
53-
### [START] protoc backwards compatibility fixes
54-
55-
# roll back to private properties.
56-
s.replace(
57-
"src/**/V*/**/*.php",
58-
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
59-
r"""Generated from protobuf field \1
60-
*/
61-
private $""")
62-
63-
# Replace "Unwrapped" with "Value" for method names.
64-
s.replace(
65-
"src/**/V*/**/*.php",
66-
r"public function ([s|g]\w{3,})Unwrapped",
67-
r"public function \1Value"
68-
)
69-
70-
### [END] protoc backwards compatibility fixes
71-
72-
# fix relative cloud.google.com links
73-
s.replace(
74-
"src/**/V*/**/*.php",
75-
r"(.{0,})\]\((/.{0,})\)",
76-
r"\1](https://cloud.google.com\2)"
77-
)
78-
7935
# format generated clients
8036
subprocess.run([
81-
'npx',
82-
'-y',
83-
'-p',
84-
'@prettier/plugin-php@^0.19',
37+
'npm',
38+
'exec',
39+
'--yes',
40+
'--package=@prettier/plugin-php@^0.19',
41+
'--',
8542
'prettier',
86-
'**/Gapic/*',
43+
'**/Client/*',
8744
'--write',
8845
'--parser=php',
8946
'--single-quote',
90-
'--print-width=80'])
47+
'--print-width=120'])

Trace/phpunit-snippets.xml.dist

Lines changed: 0 additions & 16 deletions
This file was deleted.

Trace/src/Annotation.php

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)