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

Commit

Permalink
chore: migrate to owlbot (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neenu1995 committed Nov 1, 2021
1 parent 8130701 commit 81670cf
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 70 deletions.
3 changes: 3 additions & 0 deletions .github/.OwlBot.lock.yaml
@@ -0,0 +1,3 @@
docker:
digest: sha256:a3ac08d167454718ff057b97a1950d3cb5e16fc39fb3f355d90276285a6cac75
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
37 changes: 37 additions & 0 deletions .github/.OwlBot.yaml
@@ -0,0 +1,37 @@
# 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"
- "/google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ITVPCServiceControlTest.java"
- "/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyConditionName.java"
- "/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabelsOuterClass.java"
- "/proto-google-cloud-monitoring-v3/src/main/java/google/monitoring/v3/DroppedLabelsOuterClass.java"


deep-copy-regex:
- source: "/google/monitoring/(v.*)/.*-java/proto-google-.*/src"
dest: "/owl-bot-staging/$1/proto-google-cloud-monitoring-$1/src"
- source: "/google/monitoring/(v.*)/.*-java/grpc-google-.*/src"
dest: "/owl-bot-staging/$1/grpc-google-cloud-monitoring-$1/src"
- source: "/google/monitoring/(v.*)/.*-java/gapic-google-.*/src"
dest: "/owl-bot-staging/$1/google-cloud-monitoring/src"
12 changes: 6 additions & 6 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>23.0.0</version>
<version>24.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -42,28 +42,28 @@ If you are using Maven without BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-monitoring</artifactId>
<version>3.0.5-SNAPSHOT</version>
<version>3.1.1-SNAPSHOT</version>
</dependency>

```

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

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

```Groovy
implementation 'com.google.cloud:google-cloud-monitoring:3.0.7'
implementation 'com.google.cloud:google-cloud-monitoring:3.1.0'
```

If you are using SBT, add this to your dependencies

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-monitoring" % "3.0.7"
libraryDependencies += "com.google.cloud" % "google-cloud-monitoring" % "3.1.0"
```

## Authentication
Expand Down Expand Up @@ -215,7 +215,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/monitoring/docs
[javadocs]: https://googleapis.dev/java/google-cloud-monitoring/latest/
[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-monitoring/latest/history
[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring/java7.svg
[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring/java7.html
[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-monitoring/java8.svg
Expand Down
5 changes: 2 additions & 3 deletions google-cloud-monitoring-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,7 +49,6 @@

<dependencyManagement>
<dependencies>

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-monitoring</artifactId>
Expand Down Expand Up @@ -79,4 +78,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
2 changes: 1 addition & 1 deletion google-cloud-monitoring/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
43 changes: 43 additions & 0 deletions owlbot.py
@@ -0,0 +1,43 @@
# 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

def fix_resource(client, version, name):
s.replace(
[f'owl-bot-staging/{version}/google-cloud-monitoring/**/{version}/{client}.java'],
f'import com.google.monitoring.{version}.{name}',
'import com.google.api.resourcenames.ResourceName',
)

s.replace(
[f'owl-bot-staging/{version}/google-cloud-monitoring/**/{version}/{client}.java'],
name,
'ResourceName',
)
version='v3'
for library in s.get_staging_dirs():
# put any special-case replacements here
fix_resource('AlertPolicyServiceClient', version, 'FolderName')
fix_resource('GroupServiceClient', version, 'FolderName')
fix_resource('MetricServiceClient', version, 'FolderName')
fix_resource('NotificationChannelServiceClient', version, 'FolderName')
fix_resource('ServiceMonitoringServiceClient', version, 'FolderName')
fix_resource('UptimeCheckServiceClient', version, 'FolderName')

s.move(library)

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

<modules>
<module>proto-google-cloud-monitoring-v3</module>
<module>grpc-google-cloud-monitoring-v3</module>
<module>google-cloud-monitoring</module>
<module>grpc-google-cloud-monitoring-v3</module>
<module>proto-google-cloud-monitoring-v3</module>
<module>google-cloud-monitoring-bom</module>
</modules>

Expand Down
56 changes: 0 additions & 56 deletions synth.py

This file was deleted.

4 changes: 2 additions & 2 deletions versions.txt
@@ -1,6 +1,6 @@
# Format:
# module:released-version:current-version

proto-google-cloud-monitoring-v3:3.1.0:3.1.1-SNAPSHOT
google-cloud-monitoring:3.1.0:3.1.1-SNAPSHOT
grpc-google-cloud-monitoring-v3:3.1.0:3.1.1-SNAPSHOT
google-cloud-monitoring:3.1.0:3.1.1-SNAPSHOT
proto-google-cloud-monitoring-v3:3.1.0:3.1.1-SNAPSHOT

0 comments on commit 81670cf

Please sign in to comment.