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: readonly fix in owlbot #5430

Merged
merged 2 commits into from
Aug 2, 2022
Merged
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
19 changes: 16 additions & 3 deletions Datastore/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

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


php.owlbot_main(
src=src,
dest=dest,
copy_excludes=[
src / "src/V1/TransactionOptions/ReadOnly.php"
]
)

# document and utilize apiEndpoint instead of serviceAddress
s.replace(
Expand Down Expand Up @@ -68,6 +72,15 @@
search,
replace)

# remove ReadOnly class_alias code
s.replace(
"src/V*/**/PBReadOnly.php",
r"^// Adding a class alias for backwards compatibility with the \"readonly\" keyword.$"
+ "\n"
+ r"^class_alias\(PBReadOnly::class, __NAMESPACE__ . '\\ReadOnly'\);$"
+ "\n",
'')

### [START] protoc backwards compatibility fixes

# roll back to private properties.
Expand Down
10 changes: 10 additions & 0 deletions Firestore/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
copy_excludes=[
src / '*/src/V1/FirestoreClient.php',
src / '*/src/Admin/V1/FirestoreAdminClient.php',
src / "*/src/V1/TransactionOptions/ReadOnly.php",
]
)

Expand Down Expand Up @@ -115,6 +116,15 @@
r'@group admin',
'@group firestore-admin')

# remove ReadOnly class_alias code
s.replace(
"src/V*/**/PBReadOnly.php",
r"^// Adding a class alias for backwards compatibility with the \"readonly\" keyword.$"
+ "\n"
+ r"^class_alias\(PBReadOnly::class, __NAMESPACE__ . '\\ReadOnly'\);$"
+ "\n",
'')

### [START] protoc backwards compatibility fixes

# roll back to private properties.
Expand Down
14 changes: 11 additions & 3 deletions Spanner/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@
src=src,
dest=dest,
copy_excludes=[
src / "*/src/V1/SpannerClient.php"
src / "*/src/V1/SpannerClient.php",
src / "*/src/V1/TransactionOptions/ReadOnly.php",
]
)



# Spanner Database Admin also lives here
admin_library = Path(f"../{php.STAGING_DIR}/Spanner/v1/Admin/Database/v1").resolve()

Expand Down Expand Up @@ -108,6 +107,15 @@
'@group instance',
'@group spanner-admin-instance')

# remove ReadOnly class_alias code
s.replace(
"src/V*/**/PBReadOnly.php",
r"^// Adding a class alias for backwards compatibility with the \"readonly\" keyword.$"
+ "\n"
+ r"^class_alias\(PBReadOnly::class, __NAMESPACE__ . '\\ReadOnly'\);$"
+ "\n",
'')

## START fixing commit() breaking change

# move $mutations back into commit() signature
Expand Down