Skip to content
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

feat: add new LongRunning client, rename LongRunning namespace (and add alias for BC) #6675

Merged
merged 10 commits into from
Apr 10, 2024
3 changes: 2 additions & 1 deletion Core/src/Testing/TestHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public static function snippetBootstrap()
'/vendor/',
'/dev/',
new RegexFileFilter('/\w{0,}\/vendor\//'),
new RegexFileFilter('/\w{0,}\/V\d{1,}\w{0,}\//')
new RegexFileFilter('/\w{0,}\/V\d{1,}\w{0,}\//'),
'LongRunning/', // LongRunning doesn't match the GAPIC regex, but should still be excluded
]);
$coverage = new Coverage($scanner);
$coverage->buildListToCover();
Expand Down
2 changes: 1 addition & 1 deletion LongRunning/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
deep-copy-regex:
- source: /google/longrunning/.*-php/src/(.*)
dest: /owl-bot-staging/LongRunning/src/ApiCore/LongRunning/$1
dest: /owl-bot-staging/LongRunning/src/LongRunning/$1
- source: /google/longrunning/.*-php/tests/(.*)
dest: /owl-bot-staging/LongRunning/tests/$1
- source: /google/longrunning/.*-php/proto/src/(.*)
Expand Down
Binary file modified LongRunning/metadata/Longrunning/Operations.php
Binary file not shown.
28 changes: 4 additions & 24 deletions LongRunning/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,11 @@
version_string="longrunning",
)

# Fix namespace for LongRunning GAPIC (ApiCore)
# This is defined in longrunning_gapic.yaml, but not being used by
# gapic-generator-php
# Add an alias for the previous namespace
s.replace(
"src/ApiCore/**/*.php",
r"^namespace Google\\LongRunning(.*);$",
r"namespace Google\\ApiCore\\LongRunning\1;")
s.replace(
"src/ApiCore/LongRunning/OperationsClient.php",
r"^use Google\\LongRunning\\Gapic\\OperationsGapicClient;$",
r"use Google\\ApiCore\\LongRunning\\Gapic\\OperationsGapicClient;")
s.replace(
"tests/**/*.php",
r"\\Google\\LongRunning\\OperationsClient",
r"\\Google\\ApiCore\\LongRunning\\OperationsClient")

# remove class_alias code
s.replace(
"src/**/*.php",
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
+ "\n"
+ r"^class_alias\(.*\);$"
+ "\n",
'')

"src/LongRunning/OperationsClient.php",
r"^}$\n",
r"}\n\nclass_alias('Google\\LongRunning\\OperationsClient', 'Google\\ApiCore\\LongRunning\\OperationsClient');\n")

### [START] protoc backwards compatibility fixes

Expand Down
Loading
Loading