Skip to content

Commit

Permalink
Merge branch 'main' into renovate/google-api-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp authored Mar 13, 2024
2 parents 572f1fa + 510a887 commit 2098d01
Show file tree
Hide file tree
Showing 36 changed files with 1,059 additions and 265 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM gcr.io/cloud-devrel-public-resources/python

# install tools
RUN apt-get update && apt-get install -y \
unzip openjdk-17-jdk rsync maven \
unzip openjdk-17-jdk rsync maven jq \
&& apt-get clean

COPY library_generation /src
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ jobs:
run: |
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
- name: Validate gapic-generator-java-bom
uses: googleapis/java-cloud-bom/tests/validate-bom@ac9893c4ba759cda192b11c2e8bac0d5a6bd60a5
uses: googleapis/java-cloud-bom/tests/validate-bom@3f93d58a049cf6089a930c55cc23ff0c0869a12f
with:
bom-path: gapic-generator-java-bom/pom.xml

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/verify_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
java: [ 11 ]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: temurin
cache: maven
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: install pyenv
Expand Down Expand Up @@ -58,14 +58,14 @@ jobs:
os: [ ubuntu-22.04, macos-12 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install utils (macos)
if: matrix.os == 'macos-12'
shell: bash
run: |
brew update --preinstall
brew install coreutils
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: install python dependencies
Expand Down Expand Up @@ -97,11 +97,11 @@ jobs:
- name: Run python unit tests
run: |
set -x
python -m unittest library_generation/test/unit_tests.py
python -m unittest discover -s library_generation/test/ -p "*unit_tests.py"
lint-shell:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/[email protected]
with:
Expand All @@ -111,7 +111,7 @@ jobs:
lint-python:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install python dependencies
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion api-common-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions gapic-generator-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<version>3.5.2</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -467,7 +467,7 @@
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion gax-java/dependencies.properties
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ maven.org_graalvm_sdk=org.graalvm.sdk:graal-sdk:22.3.5
maven.junit_junit=junit:junit:4.13.2
maven.org_mockito_mockito_core=org.mockito:mockito-core:2.28.2
maven.org_hamcrest_hamcrest_core=org.hamcrest:hamcrest-core:1.3
maven.com_google_truth_truth=com.google.truth:truth:1.4.1
maven.com_google_truth_truth=com.google.truth:truth:1.4.2
maven.com_googlecode_java_diff_utils_diffutils=com.googlecode.java-diff-utils:diffutils:1.3.0
maven.net_bytebuddy_byte_buddy=net.bytebuddy:byte-buddy:1.14.11
maven.org_objenesis_objenesis=org.objenesis:objenesis:2.6
2 changes: 1 addition & 1 deletion gax-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
<exclusions>
<exclusion>
<groupId>org.checkerframework</groupId>
Expand Down
11 changes: 11 additions & 0 deletions java-common-protos/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,20 @@ deep-copy-regex:
- source: "/google/cloud/audit/google-cloud-audit-java/proto-google-cloud-audit-java/src"
dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src"

# For geo common protos
- source: "/google/geo/type/google-geo-type-java/proto-google-geo-type-java/src"
dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src"

# For shopping common protos
- source: "/google/shopping/merchant/reports/v1beta/google-cloud-merchant-reports-v1beta-java"
dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src"

# It is only used once in https://github.com/googleapis/googleapis/blob/master/google/chat/v1/BUILD.bazel#L47,
# and technically not a common proto, maybe a violation of AIP-215 if it is not.
# However, it's better to put it here so that we don't have to manually add it to BUILD.bazel file and hermetic build scripts.
- source: "/google/apps/card/v1/google-apps-card-v1-java/proto-google-apps-card-v1-java"
dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src"

- source: "/google/logging/type/google-logging-type-java/proto-google-logging-type-java/src"
dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src"

Expand Down
2 changes: 1 addition & 1 deletion java-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
50 changes: 50 additions & 0 deletions library_generation/cli/generate_monorepo_gapic_bom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright 2024 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 click as click

from library_generation.utils.pom_generator import generate_gapic_bom
from library_generation.utils.pom_generator import generate_root_pom


@click.group(invoke_without_command=False)
@click.pass_context
@click.version_option(message="%(version)s")
def main(ctx):
pass


@main.command()
@click.option(
"--repository-path",
required=True,
type=str,
help="""
Path to which the generated pom.xml goes.
""",
)
@click.option(
"--versions-file",
required=True,
type=str,
help="""
The file containing version of libraries.
Throw FileNotFoundError if the file doesn't exist.
""",
)
def generate(repository_path: str, versions_file: str) -> None:
generate_gapic_bom(repository_path=repository_path, versions_file=versions_file)


if __name__ == "__main__":
main()
39 changes: 39 additions & 0 deletions library_generation/cli/generate_monorepo_root_pom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2024 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 click as click
from library_generation.utils.pom_generator import generate_root_pom


@click.group(invoke_without_command=False)
@click.pass_context
@click.version_option(message="%(version)s")
def main(ctx):
pass


@main.command()
@click.option(
"--repository-path",
required=True,
type=str,
help="""
Path to which the generated pom.xml goes.
""",
)
def generate(repository_path: str) -> None:
generate_root_pom(repository_path=repository_path)


if __name__ == "__main__":
main()
2 changes: 0 additions & 2 deletions library_generation/configuration/owlbot-cli-sha

This file was deleted.

1 change: 0 additions & 1 deletion library_generation/configuration/python-version

This file was deleted.

1 change: 0 additions & 1 deletion library_generation/configuration/synthtool-commitish

This file was deleted.

9 changes: 1 addition & 8 deletions library_generation/generate_library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,6 @@ case "${proto_path}" in
removed_proto="google/rpc/http.proto"
proto_files="${proto_files//${removed_proto}/}"
;;
"google/shopping"*)
# this proto is included in //google/shopping/css/v1:google-cloud-shopping-css-v1-java
# and //google/shopping/merchant/inventories/v1beta:google-cloud-merchant-inventories-v1beta-java
# and //google/shopping/merchant/reports/v1beta:google-cloud-merchant-reports-v1beta-java
proto_files="${proto_files} google/shopping/type/types.proto"
;;
esac
# download gapic-generator-java, protobuf and grpc plugin.
download_tools "${gapic_generator_version}" "${protobuf_version}" "${grpc_version}" "${os_architecture}"
Expand Down Expand Up @@ -284,8 +278,7 @@ case "${proto_path}" in
esac
# copy proto files to proto-*/src/main/proto
for proto_src in ${proto_files}; do
if [[ "${proto_src}" == "google/cloud/common/operation_metadata.proto" ]] ||
[[ "${proto_src}" == "google/shopping/type/types.proto" ]]; then
if [[ "${proto_src}" == "google/cloud/common/operation_metadata.proto" ]]; then
continue
fi
mkdir -p "${temp_destination_path}/proto-${folder_name}/src/main/proto"
Expand Down
Loading

0 comments on commit 2098d01

Please sign in to comment.