Skip to content

Commit

Permalink
chore!: promote BinaryAuthorization to V1 (#7392)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Jun 13, 2024
1 parent ed5264f commit 3a7a27d
Show file tree
Hide file tree
Showing 91 changed files with 223 additions and 7,345 deletions.
2 changes: 1 addition & 1 deletion .repo-metadata-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
"BinaryAuthorization": {
"language": "php",
"distribution_name": "google/cloud-binary-authorization",
"release_level": "preview",
"release_level": "stable",
"client_documentation": "https://cloud.google.com/php/docs/reference/cloud-binary-authorization/latest",
"library_type": "GAPIC_AUTO",
"api_shortname": "binaryauthorization"
Expand Down
2 changes: 1 addition & 1 deletion BinaryAuthorization/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
deep-copy-regex:
- source: /google/cloud/binaryauthorization/(v1|v1beta1)/.*-php/(.*)
- source: /google/cloud/binaryauthorization/(v1)/.*-php/(.*)
dest: /owl-bot-staging/BinaryAuthorization/$1/$2
api-name: BinaryAuthorization
5 changes: 2 additions & 3 deletions BinaryAuthorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki

### Version

This component is considered beta. As such, it should be expected to be mostly
stable and we're working towards a release candidate. We will address issues
and requests with a higher priority.
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in
any minor or patch releases. We will address issues and requests with the highest priority.

### Next Steps

Expand Down
53 changes: 22 additions & 31 deletions BinaryAuthorization/owlbot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2023 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,34 +32,25 @@

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([
'npm',
'exec',
'--yes',
'--package=@prettier/plugin-php@^0.16',
'--',
'prettier',
'**/Client/*',
'--write',
'--parser=php',
'--single-quote',
'--print-width=120'])
4 changes: 2 additions & 2 deletions BinaryAuthorization/src/V1/AdmissionRule.php

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

2 changes: 0 additions & 2 deletions BinaryAuthorization/src/V1/AdmissionRule/EnforcementMode.php

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

2 changes: 0 additions & 2 deletions BinaryAuthorization/src/V1/AdmissionRule/EvaluationMode.php

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

2 changes: 1 addition & 1 deletion BinaryAuthorization/src/V1/AdmissionWhitelistPattern.php

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

6 changes: 3 additions & 3 deletions BinaryAuthorization/src/V1/Attestor.php

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

4 changes: 2 additions & 2 deletions BinaryAuthorization/src/V1/AttestorPublicKey.php

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

165 changes: 0 additions & 165 deletions BinaryAuthorization/src/V1/BinauthzManagementServiceV1GrpcClient.php

This file was deleted.

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 @@ -94,9 +94,7 @@ final class BinauthzManagementServiceV1Client
private const CODEGEN_NAME = 'gapic';

/** The default scopes required by the service. */
public static $serviceScopes = [
'https://www.googleapis.com/auth/cloud-platform',
];
public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform'];

private static function getClientDefaults()
{
Expand All @@ -111,7 +109,8 @@ private static function getClientDefaults()
],
'transportConfig' => [
'rest' => [
'restClientConfigPath' => __DIR__ . '/../resources/binauthz_management_service_v1_rest_client_config.php',
'restClientConfigPath' =>
__DIR__ . '/../resources/binauthz_management_service_v1_rest_client_config.php',
],
],
];
Expand Down
6 changes: 2 additions & 4 deletions BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.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 @@ -74,9 +74,7 @@ final class SystemPolicyV1Client
private const CODEGEN_NAME = 'gapic';

/** The default scopes required by the service. */
public static $serviceScopes = [
'https://www.googleapis.com/auth/cloud-platform',
];
public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform'];

private static function getClientDefaults()
{
Expand Down
Loading

0 comments on commit 3a7a27d

Please sign in to comment.