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

chore!: migrate Dataflow to new surface #7945

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dataflow/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
deep-copy-regex:
- source: /google/dataflow/v1beta3/.*-php/(.*)
dest: /owl-bot-staging/Dataflow/v1beta3/$1
- source: /google/dataflow/(v1beta3)/.*-php/(.*)
dest: /owl-bot-staging/Dataflow/$1/$2
api-name: Dataflow
43 changes: 10 additions & 33 deletions Dataflow/owlbot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,37 +32,14 @@

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

# Change the wording for the deprecation warning.
# remove class_alias code
s.replace(
'src/*/*_*.php',
r'will be removed in the next major release',
'will be removed in a future release')

### [START] protoc backwards compatibility fixes

# roll back to private properties.
s.replace(
"src/**/V*/**/*.php",
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
r"""Generated from protobuf field \1
*/
private $""")

# Replace "Unwrapped" with "Value" for method names.
s.replace(
"src/**/V*/**/*.php",
r"public function ([s|g]\w{3,})Unwrapped",
r"public function \1Value"
)

### [END] protoc backwards compatibility fixes

# fix relative cloud.google.com links
s.replace(
"src/**/V*/**/*.php",
r"(.{0,})\]\((/.{0,})\)",
r"\1](https://cloud.google.com\2)"
)
"src/V*/**/*.php",
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
+ "\n"
+ r"^class_alias\(.*\);$"
+ "\n",
'')

# format generated clients
subprocess.run([
Expand All @@ -72,8 +49,8 @@
'--package=@prettier/plugin-php@^0.16',
'--',
'prettier',
'**/Gapic/*',
'**/Client/*',
'--write',
'--parser=php',
'--single-quote',
'--print-width=80'])
'--print-width=120'])
12 changes: 6 additions & 6 deletions Dataflow/src/V1beta3/AutoscalingEvent.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions Dataflow/src/V1beta3/AutoscalingEvent_AutoscalingEventType.php

This file was deleted.

4 changes: 2 additions & 2 deletions Dataflow/src/V1beta3/AutoscalingSettings.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Dataflow/src/V1beta3/BigQueryIODetails.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Dataflow/src/V1beta3/BigTableIODetails.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dataflow/src/V1beta3/CheckActiveJobsRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dataflow/src/V1beta3/CheckActiveJobsResponse.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions Dataflow/src/V1beta3/Client/FlexTemplatesServiceClient.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2023 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,7 +36,6 @@
use Google\Cloud\Dataflow\V1beta3\LaunchFlexTemplateRequest;
use Google\Cloud\Dataflow\V1beta3\LaunchFlexTemplateResponse;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: Provides a service for Flex templates. This feature is not ready yet.
Expand Down Expand Up @@ -148,9 +147,6 @@ private static function getClientDefaults()
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down Expand Up @@ -198,8 +194,10 @@ public function __call($method, $args)
*
* @experimental
*/
public function launchFlexTemplate(LaunchFlexTemplateRequest $request, array $callOptions = []): LaunchFlexTemplateResponse
{
public function launchFlexTemplate(
LaunchFlexTemplateRequest $request,
array $callOptions = []
): LaunchFlexTemplateResponse {
return $this->startApiCall('LaunchFlexTemplate', $request, $callOptions)->wait();
}
}
6 changes: 1 addition & 5 deletions Dataflow/src/V1beta3/Client/JobsV1Beta3Client.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2023 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -44,7 +44,6 @@
use Google\Cloud\Dataflow\V1beta3\SnapshotJobRequest;
use Google\Cloud\Dataflow\V1beta3\UpdateJobRequest;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: Provides a method to create and modify Google Cloud Dataflow jobs.
Expand Down Expand Up @@ -163,9 +162,6 @@ private static function getClientDefaults()
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
6 changes: 1 addition & 5 deletions Dataflow/src/V1beta3/Client/MessagesV1Beta3Client.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2023 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,7 +36,6 @@
use Google\Auth\FetchAuthTokenInterface;
use Google\Cloud\Dataflow\V1beta3\ListJobMessagesRequest;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: The Dataflow Messages API is used for monitoring the progress of
Expand Down Expand Up @@ -149,9 +148,6 @@ private static function getClientDefaults()
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
18 changes: 9 additions & 9 deletions Dataflow/src/V1beta3/Client/MetricsV1Beta3Client.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2023 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,7 +39,6 @@
use Google\Cloud\Dataflow\V1beta3\GetStageExecutionDetailsRequest;
use Google\Cloud\Dataflow\V1beta3\JobMetrics;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: The Dataflow Metrics API lets you monitor the progress of Dataflow
Expand Down Expand Up @@ -154,9 +153,6 @@ private static function getClientDefaults()
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down Expand Up @@ -206,8 +202,10 @@ public function __call($method, $args)
*
* @experimental
*/
public function getJobExecutionDetails(GetJobExecutionDetailsRequest $request, array $callOptions = []): PagedListResponse
{
public function getJobExecutionDetails(
GetJobExecutionDetailsRequest $request,
array $callOptions = []
): PagedListResponse {
return $this->startApiCall('GetJobExecutionDetails', $request, $callOptions);
}

Expand Down Expand Up @@ -272,8 +270,10 @@ public function getJobMetrics(GetJobMetricsRequest $request, array $callOptions
*
* @experimental
*/
public function getStageExecutionDetails(GetStageExecutionDetailsRequest $request, array $callOptions = []): PagedListResponse
{
public function getStageExecutionDetails(
GetStageExecutionDetailsRequest $request,
array $callOptions = []
): PagedListResponse {
return $this->startApiCall('GetStageExecutionDetails', $request, $callOptions);
}
}
6 changes: 1 addition & 5 deletions Dataflow/src/V1beta3/Client/SnapshotsV1Beta3Client.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright 2023 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,7 +40,6 @@
use Google\Cloud\Dataflow\V1beta3\ListSnapshotsResponse;
use Google\Cloud\Dataflow\V1beta3\Snapshot;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: Provides methods to manage snapshots of Google Cloud Dataflow jobs.
Expand Down Expand Up @@ -154,9 +153,6 @@ private static function getClientDefaults()
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down
Loading
Loading