diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml new file mode 100644 index 00000000..954edcdc --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,3 @@ +docker: + digest: sha256:4e961d006ec9e44501273788f3cbe1e060c4666742ba190f60d6a05bcdf3ac8f + image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 00000000..fe6bd642 --- /dev/null +++ b/.github/.OwlBot.yaml @@ -0,0 +1,31 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +docker: + image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest" + +deep-remove-regex: +- "/grpc-google-.*/src" +- "/proto-google-.*/src" + +deep-preserve-regex: +- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" +- "/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging" +- "/proto-google-iam-v1/src/main/proto/google/iam/v1" + +deep-copy-regex: +- source: "/google/iam/v1/google-iam-v1-java/grpc-google-iam-v1-java/src" + dest: "/owl-bot-staging/v1/grpc-google-iam-v1/src" +- source: "/google/iam/v1/google-iam-v1-java/proto-google-iam-v1-java/src" + dest: "/owl-bot-staging/v1/proto-google-iam-v1/src" diff --git a/.repo-metadata.json b/.repo-metadata.json index 378cb16d..d4828830 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -10,5 +10,7 @@ "language": "java", "repo": "googleapis/java-iam", "repo_short": "java-iam", - "distribution_name": "com.google.api.grpc:proto-google-iam-v1" + "distribution_name": "com.google.api.grpc:proto-google-iam-v1", + "excluded_poms": "proto-google-iam-v1-bom", + "excluded_dependencies": "grpc-google-iam-v1" } diff --git a/owlbot.py b/owlbot.py new file mode 100644 index 00000000..a53d819d --- /dev/null +++ b/owlbot.py @@ -0,0 +1,29 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +from synthtool.languages import java + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(excludes=[ + 'README.md', + 'samples/*', + '.github/workflows/samples.yaml', +]) diff --git a/proto-google-iam-v1/clirr-ignored-differences.xml b/proto-google-iam-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..ca6f8c19 --- /dev/null +++ b/proto-google-iam-v1/clirr-ignored-differences.xml @@ -0,0 +1,33 @@ + + + + + 7012 + com/google/iam/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/iam/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/iam/v1/*OrBuilder + boolean has*(*) + + 7012 + com/google/iam/v1/logging/*OrBuilder + * get*(*) + + + 7012 + com/google/iam/v1/logging/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/iam/v1/logging/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-iam-v1/pom.xml b/proto-google-iam-v1/pom.xml index c3af2bc8..e29cac43 100644 --- a/proto-google-iam-v1/pom.xml +++ b/proto-google-iam-v1/pom.xml @@ -1,6 +1,5 @@ - + + 4.0.0 com.google.api.grpc proto-google-iam-v1 @@ -31,4 +30,4 @@ - \ No newline at end of file + diff --git a/synth.py b/synth.py deleted file mode 100644 index c1d069e1..00000000 --- a/synth.py +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import os -from pathlib import Path -import tempfile -from typing import Union - -import synthtool as s -from synthtool.languages import java -from synthtool.sources import git -from synthtool import logger, shell - -versions = ['v1'] - -GOOGLEAPIS_URL = git.make_repo_clone_url("googleapis/googleapis") - -logger.debug("Cloning googleapis.") -googleapis = git.clone(GOOGLEAPIS_URL) - -def bazel_build(target: str, cwd: Union[Path, str]) -> Path: - """Build a bazel target and return the output build directory.""" - old_cwd = os.getcwd() - os.chdir(str(cwd)) - - bazel_run_args = [ - "bazel", - "--max_idle_secs=240", - "build", - target, - ] - - logger.debug(f"Generating code for: {target}.") - shell.run(bazel_run_args) - - output_dir = Path(f"bazel-bin{os.path.sep}{target[2:].split(':')[0]}").resolve() - os.chdir(old_cwd) - - return output_dir - -def build_proto(target): - """Build a proto build target and copy all generate source files.""" - output = bazel_build( - target=target, - cwd=googleapis, - ) - - src_output = Path(tempfile.mkdtemp()) - for proto_jar in output.glob("*-speed-src.jar"): - logger.debug(f"unzipping: {os.path.basename(proto_jar)}") - shell.run(["unzip", "-o", proto_jar, "-d", src_output / "src"]) - - java.fix_proto_headers(src_output) - s.copy(src_output / "src/com", "proto-google-iam-v1/src/main/java/com") - -def build_grpc(target): - """Build a grpc build target and copy all generate source files.""" - output = bazel_build( - target=target, - cwd=googleapis, - ) - - src_output = Path(tempfile.mkdtemp()) - for proto_jar in output.glob("*grpc-src.jar"): - logger.debug(f"unzipping: {os.path.basename(proto_jar)}") - shell.run(["unzip", "-o", proto_jar, "-d", src_output / "src"]) - - java.fix_grpc_headers(src_output, "") - s.copy(src_output / "src/com", "grpc-google-iam-v1/src/main/java/com") - -for version in versions: - build_proto(f"//google/iam/{version}:iam_java_proto") - build_proto(f"//google/iam/{version}/logging:logging_java_proto") - build_grpc(f"//google/iam/{version}:iam_java_grpc") - - java.format_code(f"proto-google-iam-{version}/src") - java.format_code(f"grpc-google-iam-{version}/src") - -java.common_templates(excludes=[ - 'README.md', - 'samples/*', - '.github/workflows/samples.yaml', -]) diff --git a/versions.txt b/versions.txt index ca261ac6..0dd49f84 100644 --- a/versions.txt +++ b/versions.txt @@ -2,3 +2,4 @@ # module:released-version:current-version proto-google-iam-v1:1.1.7:1.1.8-SNAPSHOT +grpc-google-iam-v1:1.1.7:1.1.8-SNAPSHOT