Skip to content

Commit 84bc89c

Browse files
committed
chore: address PR review feedback for java-shared-config CI, triggers, and Cloud Build
1 parent 4d475b6 commit 84bc89c

12 files changed

Lines changed: 206 additions & 64 deletions

.github/workflows/ci.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,6 @@ jobs:
221221
- 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml'
222222
java-shared-config:
223223
- 'java-shared-config/**'
224-
- 'google-auth-library-java/**/*.java'
225-
- 'google-auth-library-java/**/pom.xml'
226-
- 'sdk-platform-java/**/*.java'
227-
- 'sdk-platform-java/java-shared-dependencies/**/pom.xml'
228-
- 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml'
229224
split-units:
230225
runs-on: ubuntu-latest
231226
needs: changes

.github/workflows/java-shared-config-downstream-dependencies.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ jobs:
4242
- run: java -version
4343
- run: sudo apt-get update -y
4444
- run: sudo apt-get install libxml2-utils
45+
- name: Pre-build dependencies
46+
run: |
47+
LIB_DIR="${{matrix.repo}}"
48+
LIB_NAME="google-cloud-${LIB_DIR#java-}"
49+
mvn install -pl ${LIB_DIR}/${LIB_NAME} -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
4550
- run: .kokoro/client-library-check.sh ${{matrix.repo}} dependencies
4651

4752
flatten-plugin-check:
@@ -57,7 +62,8 @@ jobs:
5762
- run: java -version
5863
- run: sudo apt-get update -y
5964
- run: sudo apt-get install libxml2-utils
65+
- name: Pre-build dependencies
66+
run: mvn install -pl java-storage/google-cloud-storage -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
6067
- run: .kokoro/client-library-check.sh java-storage flatten-plugin
6168
env:
62-
REPO_TAG: v2.9.3
63-
EXPECTED_DEPENDENCIES_LIST: java-storage-v2.9.3-expected-flattened-dependencies.txt
69+
EXPECTED_DEPENDENCIES_LIST: java-storage-expected-flattened-dependencies.txt

.github/workflows/java-shared-config-downstream-maven-plugins.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ jobs:
4141
- javadoc-with-doclet # test javadoc generation with doclet
4242
steps:
4343
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
44+
- uses: actions/setup-java@v4
45+
with:
46+
distribution: zulu
47+
java-version: 11
48+
- name: Pre-build dependencies
49+
run: |
50+
LIB_DIR="${{matrix.repo}}"
51+
LIB_NAME="google-cloud-${LIB_DIR#java-}"
52+
mvn install -pl ${LIB_DIR}/${LIB_NAME} -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
4453
- uses: actions/setup-java@v4
4554
with:
4655
distribution: zulu
@@ -73,6 +82,11 @@ jobs:
7382
- run: java -version
7483
- run: sudo apt-get update -y
7584
- run: sudo apt-get install libxml2-utils
85+
- name: Pre-build dependencies
86+
run: |
87+
LIB_DIR="${{matrix.repo}}"
88+
LIB_NAME="google-cloud-${LIB_DIR#java-}"
89+
mvn install -pl ${LIB_DIR}/${LIB_NAME} -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
7690
- run: .kokoro/client-library-check.sh ${{matrix.repo}} ${{matrix.job-type}}
7791
javadoc-with-doclet:
7892
needs: filter
@@ -104,4 +118,9 @@ jobs:
104118
- run: java -version
105119
- run: sudo apt-get update -y
106120
- run: sudo apt-get install libxml2-utils
121+
- name: Pre-build dependencies
122+
run: |
123+
LIB_DIR="${{matrix.repo}}"
124+
LIB_NAME="google-cloud-${LIB_DIR#java-}"
125+
mvn install -pl ${LIB_DIR}/${LIB_NAME} -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
107126
- run: .kokoro/client-library-check-doclet.sh ${{matrix.repo}}

.kokoro/client-library-check-doclet.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,9 @@ git --no-pager diff
120120
echo "--------"
121121
mvn install "-DskipTests=true" "-Dmaven.javadoc.skip=true" "-Dgcloud.download.skip=true" "-Dcheckstyle.skip=true" -B -V -q --no-transfer-progress
122122
popd
123+
popd
123124

124125
# Check javadoc generation with the doclet
125-
rm -rf "${REPO}"
126-
git clone "https://github.com/googleapis/${REPO}.git" --depth=1
127-
128126
pushd ${REPO}
129127
replace_sdk_platform_java_config_version "${SDK_PLATFORM_JAVA_CONFIG_VERSION}"
130128

@@ -145,3 +143,8 @@ if [ "${RETURN_CODE}" == 0 ]; then
145143
else
146144
echo "Javadoc generation FAILED with doclet"
147145
fi
146+
147+
popd
148+
git checkout -- ${REPO}
149+
150+
exit ${RETURN_CODE}

.kokoro/client-library-check.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ popd
122122
popd
123123

124124
# Check this BOM against a few java client libraries
125-
# java-bigquery
126-
rm -rf "${REPO}"
127-
if [ -z "${REPO_TAG}" ]; then
128-
git clone "https://github.com/googleapis/${REPO}.git" --depth=1
129-
else
130-
git clone "https://github.com/googleapis/${REPO}.git" --depth=1 --branch "${REPO_TAG}"
131-
fi
132-
133125
pushd ${REPO}
134126

135127
# If using an older version of java-storage, continue replacing java-shared-config version otherwise replace
@@ -174,5 +166,8 @@ flatten-plugin)
174166
;;
175167
esac
176168

169+
popd
170+
git checkout -- ${REPO}
171+
177172
echo "exiting with ${RETURN_CODE}"
178173
exit ${RETURN_CODE}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
com.fasterxml.jackson.core:jackson-annotations:jar:2.18.3:compile
2+
com.fasterxml.jackson.core:jackson-core:jar:2.18.3:compile
3+
com.fasterxml.jackson.core:jackson-databind:jar:2.18.3:compile
4+
com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.18.3:compile
5+
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.18.3:compile
6+
com.fasterxml.woodstox:woodstox-core:jar:7.0.0:compile
7+
com.google.android:annotations:jar:4.1.1.4:runtime
8+
com.google.api-client:google-api-client:jar:2.7.2:compile
9+
com.google.api.grpc:gapic-google-cloud-storage-v2:jar:2.70.0-SNAPSHOT:compile
10+
com.google.api.grpc:grpc-google-cloud-storage-v2:jar:2.70.0-SNAPSHOT:compile
11+
com.google.api.grpc:proto-google-cloud-monitoring-v3:jar:3.52.0:compile
12+
com.google.api.grpc:proto-google-cloud-storage-v2:jar:2.70.0-SNAPSHOT:compile
13+
com.google.api.grpc:proto-google-common-protos:jar:2.73.0-SNAPSHOT:compile
14+
com.google.api.grpc:proto-google-iam-v1:jar:1.68.0-SNAPSHOT:compile
15+
com.google.api:api-common:jar:2.65.0-SNAPSHOT:compile
16+
com.google.api:gax-grpc:jar:2.82.0-SNAPSHOT:compile
17+
com.google.api:gax-httpjson:jar:2.82.0-SNAPSHOT:compile
18+
com.google.api:gax:jar:2.82.0-SNAPSHOT:compile
19+
com.google.apis:google-api-services-storage:jar:v1-rev20260204-2.0.0:compile
20+
com.google.auth:google-auth-library-credentials:jar:1.49.0-SNAPSHOT:compile
21+
com.google.auth:google-auth-library-oauth2-http:jar:1.49.0-SNAPSHOT:compile
22+
com.google.auto.value:auto-value-annotations:jar:1.11.0:compile
23+
com.google.cloud.opentelemetry:detector-resources-support:jar:0.33.0:runtime
24+
com.google.cloud.opentelemetry:exporter-metrics:jar:0.33.0:compile
25+
com.google.cloud.opentelemetry:shared-resourcemapping:jar:0.33.0:runtime
26+
com.google.cloud:google-cloud-core-grpc:jar:2.72.0-SNAPSHOT:compile
27+
com.google.cloud:google-cloud-core-http:jar:2.72.0-SNAPSHOT:compile
28+
com.google.cloud:google-cloud-core:jar:2.72.0-SNAPSHOT:compile
29+
com.google.cloud:google-cloud-monitoring:jar:3.52.0:compile
30+
com.google.code.findbugs:jsr305:jar:3.0.2:compile
31+
com.google.code.gson:gson:jar:2.13.2:compile
32+
com.google.errorprone:error_prone_annotations:jar:2.48.0:compile
33+
com.google.guava:failureaccess:jar:1.0.3:compile
34+
com.google.guava:guava:jar:33.5.0-jre:compile
35+
com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
36+
com.google.http-client:google-http-client-apache-v2:jar:2.1.0:compile
37+
com.google.http-client:google-http-client-appengine:jar:2.1.0:compile
38+
com.google.http-client:google-http-client-gson:jar:2.1.0:compile
39+
com.google.http-client:google-http-client-jackson2:jar:2.1.0:compile
40+
com.google.http-client:google-http-client:jar:2.1.0:compile
41+
com.google.j2objc:j2objc-annotations:jar:3.1:compile
42+
com.google.oauth-client:google-oauth-client:jar:1.39.0:compile
43+
com.google.protobuf:protobuf-java-util:jar:4.33.2:compile
44+
com.google.protobuf:protobuf-java:jar:4.33.2:compile
45+
com.google.re2j:re2j:jar:1.8:runtime
46+
commons-codec:commons-codec:jar:1.18.0:compile
47+
io.grpc:grpc-alts:jar:1.81.0:compile
48+
io.grpc:grpc-api:jar:1.81.0:compile
49+
io.grpc:grpc-auth:jar:1.81.0:compile
50+
io.grpc:grpc-context:jar:1.81.0:compile
51+
io.grpc:grpc-core:jar:1.81.0:compile
52+
io.grpc:grpc-googleapis:jar:1.81.0:runtime
53+
io.grpc:grpc-grpclb:jar:1.81.0:compile
54+
io.grpc:grpc-inprocess:jar:1.81.0:compile
55+
io.grpc:grpc-netty-shaded:jar:1.81.0:runtime
56+
io.grpc:grpc-opentelemetry:jar:1.81.0:compile
57+
io.grpc:grpc-protobuf-lite:jar:1.81.0:runtime
58+
io.grpc:grpc-protobuf:jar:1.81.0:compile
59+
io.grpc:grpc-rls:jar:1.81.0:runtime
60+
io.grpc:grpc-services:jar:1.81.0:runtime
61+
io.grpc:grpc-stub:jar:1.81.0:compile
62+
io.grpc:grpc-util:jar:1.81.0:runtime
63+
io.grpc:grpc-xds:jar:1.81.0:runtime
64+
io.opencensus:opencensus-api:jar:0.31.1:compile
65+
io.opencensus:opencensus-contrib-http-util:jar:0.31.1:compile
66+
io.opentelemetry.contrib:opentelemetry-gcp-resources:jar:1.37.0-alpha:compile
67+
io.opentelemetry.semconv:opentelemetry-semconv:jar:1.29.0-alpha:compile
68+
io.opentelemetry:opentelemetry-api:jar:1.62.0:compile
69+
io.opentelemetry:opentelemetry-common:jar:1.62.0:compile
70+
io.opentelemetry:opentelemetry-context:jar:1.62.0:compile
71+
io.opentelemetry:opentelemetry-sdk-common:jar:1.62.0:compile
72+
io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:jar:1.62.0:compile
73+
io.opentelemetry:opentelemetry-sdk-logs:jar:1.62.0:compile
74+
io.opentelemetry:opentelemetry-sdk-metrics:jar:1.62.0:compile
75+
io.opentelemetry:opentelemetry-sdk-trace:jar:1.62.0:compile
76+
io.opentelemetry:opentelemetry-sdk:jar:1.62.0:compile
77+
io.perfmark:perfmark-api:jar:0.27.0:runtime
78+
org.apache.httpcomponents:httpclient:jar:4.5.14:compile
79+
org.apache.httpcomponents:httpcore:jar:4.4.16:compile
80+
org.checkerframework:checker-qual:jar:3.49.0:compile
81+
org.codehaus.mojo:animal-sniffer-annotations:jar:1.27:compile
82+
org.codehaus.woodstox:stax2-api:jar:4.2.2:compile
83+
org.conscrypt:conscrypt-openjdk-uber:jar:2.5.2:compile
84+
org.jspecify:jspecify:jar:1.0.0:compile
85+
org.slf4j:slf4j-api:jar:2.0.16:compile
86+
org.threeten:threetenbp:jar:1.7.0:compile

.kokoro/java-storage-v2.9.3-expected-flattened-dependencies.txt

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
# Copyright 2023 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
set -x
18+
19+
function modify_shared_config() {
20+
xmllint --shell pom.xml <<EOF
21+
setns x=http://maven.apache.org/POM/4.0.0
22+
cd .//x:artifactId[text()="google-cloud-shared-config"]
23+
cd ../x:version
24+
set ${SHARED_CONFIG_VERSION}
25+
save pom.xml
26+
EOF
27+
}
28+
29+
## Get the directory of the build script and install all modules in the monorepo
30+
scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
31+
## cd to the parent directory, i.e. the root of the git repo
32+
cd "${scriptDir}/../.."
33+
34+
# Build and install the entire monorepo to local cache (including the under-test java-shared-config)
35+
mvn -B -ntp install -Dcheckstyle.skip -Dfmt.skip -DskipTests
36+
37+
# Get the version of java-shared-config under test
38+
VERSION_POM=java-shared-config/java-shared-config/pom.xml
39+
SHARED_CONFIG_VERSION=$(sed -e 's/xmlns=".*"//' ${VERSION_POM} | xmllint --xpath '/project/version/text()' -)
40+
41+
# Use GCP Maven Mirror (as in original script)
42+
mkdir -p "${HOME}/.m2"
43+
cp java-shared-config/settings.xml "${HOME}/.m2"
44+
45+
# Update the shared-config version in the local java-showcase parent
46+
pushd java-showcase
47+
modify_shared_config
48+
popd
49+
50+
# Parse showcase version from the local directory
51+
pushd java-showcase/gapic-showcase
52+
SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)
53+
popd
54+
55+
# Start showcase server
56+
mkdir -p /usr/src/showcase
57+
curl --location https://github.com/googleapis/gapic-showcase/releases/download/v"${SHOWCASE_VERSION}"/gapic-showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz --output /usr/src/showcase/showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz
58+
pushd /usr/src/showcase/
59+
tar -xf showcase-*
60+
./gapic-showcase run &
61+
popd
62+
63+
# Run showcase tests with `native` profile in java-showcase
64+
pushd java-showcase
65+
mvn test -Pnative,showcase -Denforcer.skip=true -ntp -B
66+
RETURN_CODE=$?
67+
popd
68+
69+
# Revert local showcase modifications
70+
git checkout -- java-showcase/pom.xml
71+
72+
exit $RETURN_CODE

java-shared-config/.cloudbuild/cloudbuild-test-a.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ steps:
2020
# GraalVM A build
2121
- name: gcr.io/cloud-builders/docker
2222
args: ["build", "-t", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--file", "graalvm-a.Dockerfile", "."]
23-
dir: .cloudbuild
23+
dir: java-shared-config/.cloudbuild
2424
id: graalvm-a-build
2525
waitFor: ["-"]
2626
- name: gcr.io/gcp-runtimes/structure_test
2727
args:
28-
["-i", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-a.yaml", "-v"]
28+
["-i", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", "java-shared-config/.cloudbuild/graalvm-a.yaml", "-v"]
2929
waitFor: ["graalvm-a-build"]
3030
- name: us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}
3131
entrypoint: bash

java-shared-config/.cloudbuild/cloudbuild-test-b.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ steps:
2020
# GraalVM B build
2121
- name: gcr.io/cloud-builders/docker
2222
args: ["build", "-t", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--file", "graalvm-b.Dockerfile", "."]
23-
dir: .cloudbuild
23+
dir: java-shared-config/.cloudbuild
2424
id: graalvm-b-build
2525
waitFor: ["-"]
2626
- name: gcr.io/gcp-runtimes/structure_test
2727
args:
28-
["-i", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/graalvm-b.yaml", "-v"]
28+
["-i", "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--config", "java-shared-config/.cloudbuild/graalvm-b.yaml", "-v"]
2929
waitFor: ["graalvm-b-build"]
3030
- name: us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}
3131
entrypoint: bash

0 commit comments

Comments
 (0)