Skip to content

Commit 0d84458

Browse files
authored
chore!: migrate DataLabeling to new surface (#7944)
1 parent 69e40a8 commit 0d84458

145 files changed

Lines changed: 830 additions & 6954 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DataLabeling/.OwlBot.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
deep-copy-regex:
2-
- source: /google/cloud/datalabeling/v1beta1/.*-php/(.*)
3-
dest: /owl-bot-staging/DataLabeling/v1beta1/$1
2+
- source: /google/cloud/datalabeling/(v1beta1)/.*-php/(.*)
3+
dest: /owl-bot-staging/DataLabeling/$1/$2
44
api-name: DataLabeling

DataLabeling/owlbot.py

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Google LLC
1+
# Copyright 2024 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -32,34 +32,25 @@
3232

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

35-
# Change the wording for the deprecation warning.
35+
# remove class_alias code
3636
s.replace(
37-
'src/*/*_*.php',
38-
r'will be removed in the next major release',
39-
'will be removed in a future release')
40-
41-
### [START] protoc backwards compatibility fixes
42-
43-
# roll back to private properties.
44-
s.replace(
45-
"src/**/V*/**/*.php",
46-
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
47-
r"""Generated from protobuf field \1
48-
*/
49-
private $""")
50-
51-
# Replace "Unwrapped" with "Value" for method names.
52-
s.replace(
53-
"src/**/V*/**/*.php",
54-
r"public function ([s|g]\w{3,})Unwrapped",
55-
r"public function \1Value"
56-
)
57-
58-
### [END] protoc backwards compatibility fixes
59-
60-
# fix relative cloud.google.com links
61-
s.replace(
62-
"src/**/V*/**/*.php",
63-
r"(.{0,})\]\((/.{0,})\)",
64-
r"\1](https://cloud.google.com\2)"
65-
)
37+
"src/V*/**/*.php",
38+
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
39+
+ "\n"
40+
+ r"^class_alias\(.*\);$"
41+
+ "\n",
42+
'')
43+
44+
# format generated clients
45+
subprocess.run([
46+
'npm',
47+
'exec',
48+
'--yes',
49+
'--package=@prettier/plugin-php@^0.16',
50+
'--',
51+
'prettier',
52+
'**/Client/*',
53+
'--write',
54+
'--parser=php',
55+
'--single-quote',
56+
'--print-width=120'])

DataLabeling/src/V1beta1/AnnotatedDataset.php

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DataLabeling/src/V1beta1/AnnotatedDatasetMetadata.php

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DataLabeling/src/V1beta1/Annotation.php

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DataLabeling/src/V1beta1/AnnotationMetadata.php

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DataLabeling/src/V1beta1/AnnotationSpec.php

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DataLabeling/src/V1beta1/AnnotationSpecSet.php

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DataLabeling/src/V1beta1/Attempt.php

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DataLabeling/src/V1beta1/BigQuerySource.php

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)