Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
chore: migrate to owlbot (#772)
Browse files Browse the repository at this point in the history
* chore: migrate to owlbot

* Update pom.xml

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
Neenu1995 and gcf-owl-bot[bot] committed Dec 3, 2021
1 parent 9013953 commit f389b84
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 88 deletions.
3 changes: 3 additions & 0 deletions .github/.OwlBot.lock.yaml
@@ -0,0 +1,3 @@
docker:
digest: sha256:4e961d006ec9e44501273788f3cbe1e060c4666742ba190f60d6a05bcdf3ac8f
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
36 changes: 36 additions & 0 deletions .github/.OwlBot.yaml
@@ -0,0 +1,36 @@
# 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-cloud-containeranalysis-v1/src"
- "/google-cloud-containeranalysis/src/.*/java/com/google/cloud/devtools/containeranalysis/v1"
- "/proto-google-cloud-containeranalysis-v1/src"

# TODO: remove resource name classes in next major update
deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/google-cloud-containeranalysis/src/.*/java/com/google/cloud/devtools/containeranalysis/v1beta1"
- "/proto-google-cloud-containeranalysis-v.*/src/main/java/com/google/containeranalysis/v.*/.*Name.*.java"
- "/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/GrafeasUtils.java"
- "/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/ITGrafeasInteropTest.java"

deep-copy-regex:
- source: "/google/devtools/containeranalysis/v1/.*-java/proto-google-.*/src"
dest: "/owl-bot-staging/v1/proto-google-cloud-containeranalysis-v1/src"
- source: "/google/devtools/containeranalysis/v1/.*-java/grpc-google-.*/src"
dest: "/owl-bot-staging/v1/grpc-google-cloud-containeranalysis-v1/src"
- source: "/google/devtools/containeranalysis/v1/.*-java/gapic-google-.*/src"
dest: "/owl-bot-staging/v1/google-cloud-containeranalysis/src"
15 changes: 7 additions & 8 deletions README.md
Expand Up @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>22.0.0</version>
<version>24.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -41,28 +41,28 @@ If you are using Maven without BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-containeranalysis</artifactId>
<version>2.1.3</version>
<version>2.2.4</version>
</dependency>

```

If you are using Gradle 5.x or later, add this to your dependencies

```Groovy
implementation platform('com.google.cloud:libraries-bom:22.0.0')
implementation platform('com.google.cloud:libraries-bom:24.0.0')
implementation 'com.google.cloud:google-cloud-containeranalysis'
```
If you are using Gradle without BOM, add this to your dependencies

```Groovy
implementation 'com.google.cloud:google-cloud-containeranalysis:2.1.3'
implementation 'com.google.cloud:google-cloud-containeranalysis:2.2.5'
```

If you are using SBT, add this to your dependencies

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-containeranalysis" % "2.1.3"
libraryDependencies += "com.google.cloud" % "google-cloud-containeranalysis" % "2.2.5"
```

## Authentication
Expand Down Expand Up @@ -111,7 +111,7 @@ Cloud Container Analysis uses gRPC for the transport layer.

## Supported Java Versions

Java 7 or above is required for using this client.
Java 8 or above is required for using this client.

Google's Java client libraries,
[Google Cloud Client Libraries][cloudlibs]
Expand Down Expand Up @@ -180,7 +180,6 @@ Apache 2.0 - See [LICENSE][license] for more information.

Java Version | Status
------------ | ------
Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1]
Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2]
Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3]
Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4]
Expand All @@ -189,7 +188,7 @@ Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5]
Java is a registered trademark of Oracle and/or its affiliates.

[product-docs]: https://cloud.google.com/container-registry/docs/container-analysis
[javadocs]: https://googleapis.dev/java/google-cloud-containeranalysis/latest/
[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/history
[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-containeranalysis/java7.svg
[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-containeranalysis/java7.html
[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-containeranalysis/java8.svg
Expand Down
21 changes: 10 additions & 11 deletions google-cloud-containeranalysis-bom/pom.xml
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?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.cloud</groupId>
Expand Down Expand Up @@ -49,27 +49,26 @@

<dependencyManagement>
<dependencies>

<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-containeranalysis-v1</artifactId>
<version>2.2.6-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-containeranalysis-v1:current} -->
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-containeranalysis</artifactId>
<version>2.2.6-SNAPSHOT</version><!-- {x-version-update:google-cloud-containeranalysis:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-containeranalysis-v1beta1</artifactId>
<version>0.92.6-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-containeranalysis-v1beta1:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-containeranalysis</artifactId>
<version>2.2.6-SNAPSHOT</version><!-- {x-version-update:google-cloud-containeranalysis:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-containeranalysis-v1</artifactId>
<version>2.2.6-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-containeranalysis-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-containeranalysis-v1</artifactId>
<version>2.2.6-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-containeranalysis-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-containeranalysis-v1beta1</artifactId>
Expand All @@ -89,4 +88,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
4 changes: 2 additions & 2 deletions google-cloud-containeranalysis/pom.xml
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?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.cloud</groupId>
Expand Down Expand Up @@ -138,4 +138,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
46 changes: 46 additions & 0 deletions owlbot.py
@@ -0,0 +1,46 @@
# 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
#
# https://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.

import synthtool as s
from synthtool.languages import java

get_grafeas_code = """
/**
* Returns a new GrafeasClient with the same configured settings.
*
* @throws IOException
*/
public GrafeasClient getGrafeasClient() throws IOException {
return GrafeasClient.create(GrafeasUtils.transformSettings(settings));
}
"""

for library in s.get_staging_dirs():
# put any special-case replacements here
s.replace(
f'owl-bot-staging/v1/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClient.java',
'import com.google.iam.v1.TestIamPermissionsResponse;',
'import com.google.iam.v1.TestIamPermissionsResponse;\nimport io.grafeas.v1.GrafeasClient;'
)

# add getGrafeasClient()
s.replace(
f'owl-bot-staging/v1/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClient.java',
r'(\s+private final ContainerAnalysisStub stub;.*)',
f'\g<1>{get_grafeas_code}'
)
s.move(library)

s.remove_staging_dirs()
java.common_templates()
8 changes: 4 additions & 4 deletions pom.xml
Expand Up @@ -127,12 +127,12 @@
</build>

<modules>
<module>proto-google-cloud-containeranalysis-v1</module>
<module>proto-google-cloud-containeranalysis-v1beta1</module>
<module>google-cloud-containeranalysis</module>
<module>grpc-google-cloud-containeranalysis-v1beta1</module>
<module>grpc-google-cloud-containeranalysis-v1</module>
<module>google-cloud-containeranalysis</module>
<module>google-cloud-containeranalysis-bom</module>
<module>proto-google-cloud-containeranalysis-v1</module>
<module>proto-google-cloud-containeranalysis-v1beta1</module>
<module>google-cloud-containeranalysis-bom</module>
</modules>

<reporting>
Expand Down
@@ -0,0 +1,19 @@
<?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/containeranalysis/v1/*OrBuilder</className>
<method>* get*(*)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/containeranalysis/v1/*OrBuilder</className>
<method>boolean contains*(*)</method>
</difference>
<difference>
<differenceType>7012</differenceType>
<className>com/google/containeranalysis/v1/*OrBuilder</className>
<method>boolean has*(*)</method>
</difference>
</differences>
63 changes: 0 additions & 63 deletions synth.py

This file was deleted.

0 comments on commit f389b84

Please sign in to comment.