Skip to content

Commit acff6ec

Browse files
committed
Merge branch 'main' into chore/java-comp-check
2 parents 592aa12 + 25d3101 commit acff6ec

File tree

869 files changed

+48969
-25602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

869 files changed

+48969
-25602
lines changed

.cloudbuild/library_generation/library_generation.Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,6 @@ RUN source /src/library_generation/utils/utilities.sh \
9898
# similar to protoc, we indicate grpc is available in the container via env vars
9999
ENV DOCKER_GRPC_LOCATION="/grpc/protoc-gen-grpc-java.exe"
100100

101-
# Here we transfer gapic-generator-java from the previous stage.
102-
# Note that the destination is a well-known location that will be assumed at runtime
103-
# We hard-code the location string to avoid making it configurable (via ARG) as
104-
# well as to avoid it making it overridable at runtime (via ENV).
105-
COPY --from=ggj-build "/sdk-platform-java/gapic-generator-java.jar" "${HOME}/.library_generation/gapic-generator-java.jar"
106-
RUN chmod 755 "${HOME}/.library_generation/gapic-generator-java.jar"
107-
ENV GAPIC_GENERATOR_LOCATION="${HOME}/.library_generation/gapic-generator-java.jar"
108-
109101
RUN python -m pip install --upgrade pip
110102

111103
# install main scripts as a python package
@@ -125,6 +117,14 @@ RUN owl-bot copy-code --version
125117
RUN chmod o+rx $(which owl-bot)
126118
RUN apk del -r npm && apk cache clean
127119

120+
# Here we transfer gapic-generator-java from the previous stage.
121+
# Note that the destination is a well-known location that will be assumed at runtime
122+
# We hard-code the location string to avoid making it configurable (via ARG) as
123+
# well as to avoid it making it overridable at runtime (via ENV).
124+
COPY --from=ggj-build "/sdk-platform-java/gapic-generator-java.jar" "${HOME}/.library_generation/gapic-generator-java.jar"
125+
RUN chmod 755 "${HOME}/.library_generation/gapic-generator-java.jar"
126+
ENV GAPIC_GENERATOR_LOCATION="${HOME}/.library_generation/gapic-generator-java.jar"
127+
128128
# download the Java formatter
129129
ADD https://maven-central.storage-download.googleapis.com/maven2/com/google/googlejavaformat/google-java-format/${JAVA_FORMAT_VERSION}/google-java-format-${JAVA_FORMAT_VERSION}-all-deps.jar \
130130
"${HOME}"/.library_generation/google-java-format.jar

.github/release-please.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ bumpMinorPreMajor: true
33
handleGHRelease: true
44
primaryBranch: main
55
manifest: true
6-
extraFiles: ["WORKSPACE", ".cloudbuild/graalvm/cloudbuild.yaml", ".cloudbuild/graalvm/cloudbuild-test-a.yaml", ".cloudbuild/graalvm/cloudbuild-test-b.yaml", ".cloudbuild/library_generation/cloudbuild-library-generation-release.yaml", "generation_config.yaml"]
6+
extraFiles:
7+
- WORKSPACE
8+
- .cloudbuild/graalvm/cloudbuild.yaml
9+
- .cloudbuild/graalvm/cloudbuild-test-a.yaml
10+
- .cloudbuild/graalvm/cloudbuild-test-b.yaml
11+
- .cloudbuild/library_generation/cloudbuild-library-generation-release.yaml
12+
- generation_config.yaml
713
branches:
814
- branch: 2.23.x
915
releaseType: java-backport
@@ -13,3 +19,8 @@ branches:
1319
releaseType: java-backport
1420
manifest: true
1521
handleGHRelease: true
22+
- releaseType: java-backport
23+
bumpMinorPreMajor: true
24+
handleGHRelease: true
25+
manifest: true
26+
branch: 2.54.x

.github/scripts/action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ inputs:
3030
image_tag:
3131
description: the tag of hermetic build image
3232
required: false
33+
showcase_mode:
34+
description: true if we need to download the showcase api definitions
35+
required: false
3336
token:
3437
description: Personal Access Token
3538
required: true
@@ -72,9 +75,11 @@ runs:
7275
bash hermetic_library_generation.sh \
7376
--target_branch "${BASE_REF}" \
7477
--current_branch "${HEAD_REF}" \
78+
--showcase_mode "${SHOWCASE_MODE}" \
7579
--image_tag "${IMAGE_TAG}"
7680
env:
7781
BASE_REF: ${{ inputs.base_ref }}
7882
HEAD_REF: ${{ inputs.head_ref }}
7983
IMAGE_TAG: ${{ inputs.image_tag }}
84+
SHOWCASE_MODE: ${{ inputs.showcase_mode }}
8085
GH_TOKEN: ${{ inputs.token }}

.github/scripts/hermetic_library_generation.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -e
2+
set -ex
33
# This script should be run at the root of the repository.
44
# This script is used to, when a pull request changes the generation
55
# configuration (generation_config.yaml by default) or Dockerfile:
@@ -25,6 +25,8 @@ set -e
2525
# 3. [optional] image_tag, the tag of gcr.io/cloud-devrel-public-resources/java-library-generation.
2626
# 4. [optional] generation_config, the path to the generation configuration,
2727
# the default value is generation_config.yaml in the repository root.
28+
# 5. [optional] showcase_mode, true if we wish to download the showcase api
29+
# definitions, which are necessary for generating the showcase library.
2830
while [[ $# -gt 0 ]]; do
2931
key="$1"
3032
case "${key}" in
@@ -44,6 +46,10 @@ case "${key}" in
4446
generation_config="$2"
4547
shift
4648
;;
49+
--showcase_mode)
50+
showcase_mode="$2"
51+
shift
52+
;;
4753
*)
4854
echo "Invalid option: [$1]"
4955
exit 1
@@ -62,6 +68,10 @@ if [ -z "${current_branch}" ]; then
6268
exit 1
6369
fi
6470

71+
if [ -z "${download_showcase}" ]; then
72+
download_showcase="false"
73+
fi
74+
6575
if [ -z "${generation_config}" ]; then
6676
generation_config=generation_config.yaml
6777
echo "Use default generation config: ${generation_config}"
@@ -89,6 +99,12 @@ pushd "${api_def_dir}"
8999
git checkout "${googleapis_commitish}"
90100
popd
91101

102+
# we also setup showcase
103+
if [[ "${showcase_mode}" == "true" ]]; then
104+
source java-showcase/scripts/showcase_utilities.sh
105+
append_showcase_to_api_defs "${api_def_dir}"
106+
fi
107+
92108
# get changed library list.
93109
changed_libraries=$(python hermetic_build/common/cli/get_changed_libraries.py create \
94110
--baseline-generation-config-path="${baseline_generation_config}" \
@@ -98,7 +114,6 @@ echo "Changed libraries are: ${changed_libraries:-"No changed library"}."
98114
# run hermetic code generation docker image.
99115
docker run \
100116
--rm \
101-
--quiet \
102117
-u "$(id -u):$(id -g)" \
103118
-v "$(pwd):${workspace_name}" \
104119
-v "${api_def_dir}:${workspace_name}/googleapis" \

.github/snippet-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ alwaysCreateStatusCheck: false
33
ignoreFiles:
44
- src/test/**
55
- test/**
6-
- showcase/**
6+
- java-showcase/**
77
- library_generation/owlbot/templates/java_library/samples/install-without-bom/pom.xml
88
- library_generation/owlbot/synthtool/gcp/snippets.py

.github/sync-repo-settings.yaml

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@ branchProtectionRules:
1616
- compatibility
1717
- graalvm-presubmit-sdk-platform-java-a (java-graalvm-ci-prod)
1818
- graalvm-presubmit-sdk-platform-java-b (java-graalvm-ci-prod)
19-
- graalvm-presubmit-sdk-platform-java-a-downstream-kms (java-graalvm-ci-prod)
20-
- graalvm-presubmit-sdk-platform-java-b-downstream-kms (java-graalvm-ci-prod)
21-
- graalvm-presubmit-sdk-platform-java-a-downstream-kmsinventory (java-graalvm-ci-prod)
22-
- graalvm-presubmit-sdk-platform-java-b-downstream-kmsinventory (java-graalvm-ci-prod)
19+
- >-
20+
graalvm-presubmit-sdk-platform-java-a-downstream-kms
21+
(java-graalvm-ci-prod)
22+
- >-
23+
graalvm-presubmit-sdk-platform-java-b-downstream-kms
24+
(java-graalvm-ci-prod)
25+
- >-
26+
graalvm-presubmit-sdk-platform-java-a-downstream-kmsinventory
27+
(java-graalvm-ci-prod)
28+
- >-
29+
graalvm-presubmit-sdk-platform-java-b-downstream-kmsinventory
30+
(java-graalvm-ci-prod)
2331
- library_generation
2432
- library-generation-integration-test (java-hermetic-build-prod)
2533
- library-generation-lint-python
@@ -73,6 +81,42 @@ branchProtectionRules:
7381
- library-generation-lint-shell
7482
- library-generation-lint-python
7583
- should-run-library-generation-tests
84+
- pattern: 2.54.x
85+
isAdminEnforced: true
86+
requiredApprovingReviewCount: 1
87+
requiresCodeOwnerReviews: true
88+
requiresStrictStatusChecks: false
89+
requiredStatusCheckContexts:
90+
- build(8) except for gapic-generator-java
91+
- build(8) for gapic-generator-java
92+
- build (11)
93+
- build (17)
94+
- cla/google
95+
- compatibility
96+
- graalvm-presubmit-sdk-platform-java-a (java-graalvm-ci-prod)
97+
- graalvm-presubmit-sdk-platform-java-b (java-graalvm-ci-prod)
98+
- >-
99+
graalvm-presubmit-sdk-platform-java-a-downstream-kms
100+
(java-graalvm-ci-prod)
101+
- >-
102+
graalvm-presubmit-sdk-platform-java-b-downstream-kms
103+
(java-graalvm-ci-prod)
104+
- >-
105+
graalvm-presubmit-sdk-platform-java-a-downstream-kmsinventory
106+
(java-graalvm-ci-prod)
107+
- >-
108+
graalvm-presubmit-sdk-platform-java-b-downstream-kmsinventory
109+
(java-graalvm-ci-prod)
110+
- library_generation
111+
- library-generation-integration-test (java-hermetic-build-prod)
112+
- library-generation-lint-python
113+
- library-generation-lint-shell
114+
- library-generation-unit-tests
115+
- lint
116+
- should-run-library-generation-tests
117+
- showcase-native
118+
- showcase (11)
119+
- showcase (17)
76120
permissionRules:
77121
- team: cloud-java-team-teamsync
78122
permission: admin

.github/workflows/ci.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,18 +229,18 @@ jobs:
229229
run: |
230230
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
231231
- name: Java Linter
232-
working-directory: showcase
232+
working-directory: java-showcase
233233
run: |
234234
mvn -B -ntp fmt:check
235235
- name: Showcase golden tests
236-
working-directory: showcase
236+
working-directory: java-showcase
237237
run: |
238238
mvn test \
239239
-P enable-golden-tests \
240240
--batch-mode \
241241
--no-transfer-progress
242242
- name: Parse showcase version
243-
working-directory: showcase/gapic-showcase
243+
working-directory: java-showcase/gapic-showcase
244244
run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV"
245245
- name: Install showcase server
246246
run: |
@@ -252,15 +252,15 @@ jobs:
252252
./gapic-showcase run &
253253
cd -
254254
- name: Showcase integration tests
255-
working-directory: showcase
255+
working-directory: java-showcase
256256
run: |
257257
mvn verify \
258258
-P enable-integration-tests \
259259
--batch-mode \
260260
--no-transfer-progress
261261
# The `slf4j2_logback` profile brings logging dependency and compiles logging tests, require env var to be set
262262
- name: Showcase integration tests - Logging SLF4J 2.x
263-
working-directory: showcase
263+
working-directory: java-showcase
264264
run: |
265265
mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j2_logback' \
266266
--batch-mode \
@@ -270,7 +270,7 @@ jobs:
270270
GOOGLE_SDK_JAVA_LOGGING: true
271271
# The `slf4j1_logback` profile brings logging dependency and compiles logging tests, require env var to be set
272272
- name: Showcase integration tests - Logging SLF4J 1.x
273-
working-directory: showcase
273+
working-directory: java-showcase
274274
run: |
275275
mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j1_logback' \
276276
--batch-mode \
@@ -281,7 +281,7 @@ jobs:
281281
# The `disabledLogging` profile tests logging disabled when logging dependency present,
282282
# do not set env var for this step
283283
- name: Showcase integration tests - Logging disabed
284-
working-directory: showcase
284+
working-directory: java-showcase
285285
run: |
286286
mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,disabledLogging' \
287287
--batch-mode \
@@ -303,7 +303,7 @@ jobs:
303303
- name: Install sdk-platform-java and showcase to local maven repository
304304
run: |
305305
mvn install -B -ntp -T 1C -DskipTests
306-
cd showcase
306+
cd java-showcase
307307
mvn install -B -ntp -T 1C -DskipTests
308308
SHOWCASE_CLIENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
309309
echo "SHOWCASE_CLIENT_VERSION=$SHOWCASE_CLIENT_VERSION" >> "$GITHUB_ENV"
@@ -313,7 +313,7 @@ jobs:
313313
run: mvn install -B -ntp -T 1C -DskipTests
314314
# Showcase golden test ensures that src changes are already reflected in the PR.
315315
- name: Clirr check
316-
working-directory: showcase
316+
working-directory: java-showcase
317317
run: |
318318
mvn versions:set -B -ntp -DnewVersion=local
319319
mvn clirr:check -B -ntp -Dclirr.skip=false -DcomparisonVersion=$SHOWCASE_CLIENT_VERSION

.github/workflows/hermetic_library_generation.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,4 @@ jobs:
6262
head_ref: ${{ github.head_ref }}
6363
image_tag: ${{ env.GENERATOR_VERSION }}
6464
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
65+
showcase_mode: true

.github/workflows/sonar.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
- name: Install modules to local maven
3434
run: |
3535
mvn install -T 1C -DskipTests -ntp -B
36-
cd showcase
36+
cd java-showcase
3737
mvn install -T 1C -DskipTests -ntp -B
3838
- name: Parse showcase version
39-
working-directory: showcase/gapic-showcase
39+
working-directory: java-showcase/gapic-showcase
4040
run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV"
4141
- name: Install showcase server
4242
run: |

.kokoro/presubmit/common_test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cd target
2222
function test_find_all_poms_with_versioned_dependency {
2323
mkdir -p test_find_all_poms_with_dependency
2424
pushd test_find_all_poms_with_dependency
25-
cp ../../showcase/gapic-showcase/pom.xml pom.xml
25+
cp ../../java-showcase/gapic-showcase/pom.xml pom.xml
2626

2727
find_all_poms_with_versioned_dependency 'truth'
2828
if [ "${#POMS[@]}" != 1 ]; then
@@ -45,7 +45,7 @@ function test_find_all_poms_with_versioned_dependency {
4545
function test_update_pom_dependency {
4646
mkdir -p test_update_pom_dependency
4747
pushd test_update_pom_dependency
48-
cp ../../showcase/gapic-showcase/pom.xml pom.xml
48+
cp ../../java-showcase/gapic-showcase/pom.xml pom.xml
4949

5050
update_pom_dependency . truth "99.88.77"
5151

@@ -66,7 +66,7 @@ EOF
6666
function test_parse_pom_version {
6767
mkdir -p test_parse_pom_version
6868
pushd test_parse_pom_version
69-
cp ../../showcase/gapic-showcase/pom.xml pom.xml
69+
cp ../../java-showcase/gapic-showcase/pom.xml pom.xml
7070

7171
VERSION=$(parse_pom_version .)
7272
if [ "$VERSION" != "0.0.1-SNAPSHOT" ]; then

0 commit comments

Comments
 (0)