chore: migrate to owlbot (#242)
diff --git a/java-iam/.github/.OwlBot.lock.yaml b/java-iam/.github/.OwlBot.lock.yaml
new file mode 100644
index 0000000..954edcd
--- /dev/null
+++ b/java-iam/.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/java-iam/.github/.OwlBot.yaml b/java-iam/.github/.OwlBot.yaml
new file mode 100644
index 0000000..fe6bd64
--- /dev/null
+++ b/java-iam/.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/java-iam/.repo-metadata.json b/java-iam/.repo-metadata.json
index 378cb16..d482883 100644
--- a/java-iam/.repo-metadata.json
+++ b/java-iam/.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/java-iam/owlbot.py b/java-iam/owlbot.py
new file mode 100644
index 0000000..a53d819
--- /dev/null
+++ b/java-iam/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/java-iam/proto-google-iam-v1/clirr-ignored-differences.xml b/java-iam/proto-google-iam-v1/clirr-ignored-differences.xml
new file mode 100644
index 0000000..ca6f8c1
--- /dev/null
+++ b/java-iam/proto-google-iam-v1/clirr-ignored-differences.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
+<differences>
+ <difference>
+ <differenceType>7012</differenceType>
+ <className>com/google/iam/v1/*OrBuilder</className>
+ <method>* get*(*)</method>
+ </difference>
+ <difference>
+ <differenceType>7012</differenceType>
+ <className>com/google/iam/v1/*OrBuilder</className>
+ <method>boolean contains*(*)</method>
+ </difference>
+ <difference>
+ <differenceType>7012</differenceType>
+ <className>com/google/iam/v1/*OrBuilder</className>
+ <method>boolean has*(*)</method>
+ </difference> <difference>
+ <differenceType>7012</differenceType>
+ <className>com/google/iam/v1/logging/*OrBuilder</className>
+ <method>* get*(*)</method>
+ </difference>
+ <difference>
+ <differenceType>7012</differenceType>
+ <className>com/google/iam/v1/logging/*OrBuilder</className>
+ <method>boolean contains*(*)</method>
+ </difference>
+ <difference>
+ <differenceType>7012</differenceType>
+ <className>com/google/iam/v1/logging/*OrBuilder</className>
+ <method>boolean has*(*)</method>
+ </difference>
+</differences>
diff --git a/java-iam/proto-google-iam-v1/pom.xml b/java-iam/proto-google-iam-v1/pom.xml
index c3af2bc..e29cac4 100644
--- a/java-iam/proto-google-iam-v1/pom.xml
+++ b/java-iam/proto-google-iam-v1/pom.xml
@@ -1,6 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<?xml version='1.0' encoding='UTF-8'?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-iam-v1</artifactId>
@@ -31,4 +30,4 @@
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
diff --git a/java-iam/synth.py b/java-iam/synth.py
deleted file mode 100644
index c1d069e..0000000
--- a/java-iam/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/java-iam/versions.txt b/java-iam/versions.txt
index ca261ac..0dd49f8 100644
--- a/java-iam/versions.txt
+++ b/java-iam/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