Skip to content

Commit

Permalink
feat: updates from OwlBrent
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Mar 7, 2023
1 parent c07cec6 commit 68cf3ae
Show file tree
Hide file tree
Showing 29 changed files with 1,274 additions and 42 deletions.
3 changes: 1 addition & 2 deletions Build/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
deep-copy-regex:
- source: /google/devtools/cloudbuild/v1/.*-php/(.*)
- source: /google/devtools/build/v1/.*-php/(.*)
dest: /owl-bot-staging/Build/v1/$1
api-name: Build
5 changes: 0 additions & 5 deletions Build/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*.xml.dist export-ignore
/tests export-ignore
/.github export-ignore
/samples export-ignore
/.repo-metadata.json export-ignore
/.OwlBot.yaml export-ignore
/owlbot.py export-ignore
/src/**/gapic_metadata.json export-ignore
7 changes: 3 additions & 4 deletions Build/.repo-metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"distribution_name": "google/cloud-build",
"release_level": "preview",
"client_documentation": "https://cloud.google.com/php/docs/reference/cloud-build/latest",
"library_type": "GAPIC_AUTO",
"api_shortname": "cloudbuild"
"release_level": "beta",
"client_documentation": "http://googleapis.github.io/google-cloud-php/#/docs/cloud-build/latest",
"library_type": "GAPIC_AUTO"
}
2 changes: 1 addition & 1 deletion Build/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ and review pull requests against the main
repository, which contains all of our client libraries. You will also need to
sign a Contributor License Agreement. For more details about how to contribute,
see the
[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md)
[CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/master/CONTRIBUTING.md)
file in the main Google Cloud PHP repository.
4 changes: 2 additions & 2 deletions Build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Latest Stable Version](https://poser.pugx.org/google/cloud-build/v/stable)](https://packagist.org/packages/google/cloud-build) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-build.svg)](https://packagist.org/packages/google/cloud-build)

* [API documentation](https://cloud.google.com/php/docs/reference/cloud-build/latest)
* [API documentation](http://googleapis.github.io/google-cloud-php/#/docs/cloud-build/latest/build/readme)

**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any
support requests, bug reports, or development contributions should be directed to
Expand All @@ -31,7 +31,7 @@ please see our [gRPC installation guide](https://cloud.google.com/php/grpc).

### Authentication

Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information
Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/master/AUTHENTICATION.md) for more information
on authenticating your client. Once authenticated, you'll be ready to start making requests.

### Version
Expand Down
2 changes: 1 addition & 1 deletion Build/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.1.1
8 changes: 4 additions & 4 deletions Build/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"autoload": {
"psr-4": {
"Google\\Cloud\\Build\\": "src",
"GPBMetadata\\Google\\Devtools\\Cloudbuild\\": "metadata",
"GPBMetadata\\Google\\Devtools\\Build\\": "metadata"
"GPBMetadata\\Google\\Devtools\\Cloudbuild\\": "metadata"
}
},
"autoload-dev": {
Expand All @@ -27,8 +26,9 @@
"google/gax": "^1.7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.0|^8.0",
"yoast/phpunit-polyfills": "^1.0"
"phpunit/phpunit": "^4.8|^5.0",
"google/cloud-core": "^1.31",
"phpdocumentor/reflection": "^3.0"
},
"suggest": {
"ext-grpc": "Enables use of gRPC, a universal high-performance RPC framework created by Google.",
Expand Down
46 changes: 31 additions & 15 deletions Build/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,33 @@
# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(
src=src,
dest=dest,
copy_excludes=[
src / "**/[A-Z]*_*.php",
src / "**/*GrpcClient.php",
]
)
php.owlbot_main(src=src, dest=dest)



# document and utilize apiEndpoint instead of serviceAddress
s.replace(
"**/Gapic/*GapicClient.php",
r"'serviceAddress' =>",
r"'apiEndpoint' =>")
s.replace(
"**/Gapic/*GapicClient.php",
r"@type string \$serviceAddress\n\s+\*\s+The address",
r"""@type string $serviceAddress
* **Deprecated**. This option will be removed in a future major release. Please
* utilize the `$apiEndpoint` option instead.
* @type string $apiEndpoint
* The address""")
s.replace(
"**/Gapic/*GapicClient.php",
r"\$transportConfig, and any \$serviceAddress",
r"$transportConfig, and any `$apiEndpoint`")

# remove class_alias code
# Change the wording for the deprecation warning.
s.replace(
"src/V*/**/*.php",
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
+ "\n"
+ r"^class_alias\(.*\);$"
+ "\n",
'')
'src/*/*_*.php',
r'will be removed in the next major release',
'will be removed in a future release')

### [START] protoc backwards compatibility fixes

Expand All @@ -58,6 +68,12 @@
*/
private $""")

# prevent proto messages from being marked final
s.replace(
"src/**/V*/**/*.php",
r"final class",
r"class")

# Replace "Unwrapped" with "Value" for method names.
s.replace(
"src/**/V*/**/*.php",
Expand Down
19 changes: 19 additions & 0 deletions Build/phpunit-snippets.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="./vendor/google/cloud-core/snippet-bootstrap.php"
colors="true"
printerClass="Google\Cloud\Core\Testing\Snippet\Coverage\ResultPrinter">
<testsuites>
<testsuite>
<directory>tests/Snippet</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<directory suffix=".php">src/V[!a-zA-Z]*</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
16 changes: 16 additions & 0 deletions Build/phpunit-system.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./vendor/google/cloud-core/system-bootstrap.php" colors="true">
<testsuites>
<testsuite>
<directory>tests/System</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<directory suffix=".php">src/V[!a-zA-Z]*</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
2 changes: 1 addition & 1 deletion Build/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true">
<testsuites>
<testsuite name="Unit Test Suite">
<testsuite>
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
Expand Down
16 changes: 16 additions & 0 deletions Build/src/V1/Artifacts_ArtifactObjects.php

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

16 changes: 16 additions & 0 deletions Build/src/V1/BuildOptions_LogStreamingOption.php

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

16 changes: 16 additions & 0 deletions Build/src/V1/BuildOptions_LoggingMode.php

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

16 changes: 16 additions & 0 deletions Build/src/V1/BuildOptions_MachineType.php

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

16 changes: 16 additions & 0 deletions Build/src/V1/BuildOptions_SubstitutionOption.php

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

16 changes: 16 additions & 0 deletions Build/src/V1/BuildOptions_VerifyOption.php

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

16 changes: 16 additions & 0 deletions Build/src/V1/Build_Status.php

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

Loading

0 comments on commit 68cf3ae

Please sign in to comment.