Skip to content

Commit eeba775

Browse files
committed
changes to owlbot.py
1 parent 8c27502 commit eeba775

1 file changed

Lines changed: 4 additions & 45 deletions

File tree

Spanner/owlbot.py

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -70,56 +70,15 @@
7070
# copy GPBMetadata file to metadata
7171
s.move(admin_library / f'proto/src/GPBMetadata/Google/Spanner', f'metadata/', merge=php._merge)
7272

73-
74-
# Fix test namespaces
75-
s.replace(
76-
'tests/Unit/Admin/Database/*/*.php',
77-
r'namespace Google\\Cloud\\Spanner\\Admin\\Database\\Tests\\Unit',
78-
r'namespace Google\\Cloud\\Spanner\\Tests\\Unit\\Admin\\Database')
73+
# remove class_alias code
7974
s.replace(
80-
'tests/Unit/Admin/Instance/*/*.php',
81-
r'namespace Google\\Cloud\\Spanner\\Admin\\Instance\\Tests\\Unit',
82-
r'namespace Google\\Cloud\\Spanner\\Tests\\Unit\\Admin\\Instance')
83-
84-
# fix test group
85-
s.replace(
86-
'tests/**/Admin/Database/V1/*Test.php',
87-
'@group database',
88-
'@group spanner-admin-database')
89-
90-
s.replace(
91-
'tests/**/Admin/Instance/V1/*Test.php',
92-
'@group instance',
93-
'@group spanner-admin-instance')
94-
95-
# remove ReadOnly class_alias code
96-
s.replace(
97-
"src/V*/**/PBReadOnly.php",
98-
r"^// Adding a class alias for backwards compatibility with the \"readonly\" keyword.$"
75+
"src/V*/**/*.php",
76+
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
9977
+ "\n"
100-
+ r"^class_alias\(PBReadOnly::class, __NAMESPACE__ . '\\ReadOnly'\);$"
78+
+ r"^class_alias\(.*\);$"
10179
+ "\n",
10280
'')
10381

104-
### [START] protoc backwards compatibility fixes
105-
106-
# roll back to private properties.
107-
s.replace(
108-
"src/**/V*/**/*.php",
109-
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
110-
r"""Generated from protobuf field \1
111-
*/
112-
private $""")
113-
114-
# Replace "Unwrapped" with "Value" for method names.
115-
s.replace(
116-
"src/**/V*/**/*.php",
117-
r"public function ([s|g]\w{3,})Unwrapped",
118-
r"public function \1Value"
119-
)
120-
121-
### [END] protoc backwards compatibility fixes
122-
12382
# fix relative cloud.google.com links
12483
s.replace(
12584
"src/**/V*/**/*.php",

0 commit comments

Comments
 (0)