Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b4151db
build(deps): update dependency com.google.cloud:google-cloud-shared-c…
renovate-bot Mar 27, 2025
26ad207
chore: update groupId of formatter to `com.spotify.fmt`
diegomarquezp Mar 28, 2025
2808286
chore: format with google-java-format 1.25.2
diegomarquezp Mar 28, 2025
58f59e9
chore(ci): run lint check job on java 17
diegomarquezp Mar 28, 2025
d854040
chore(ci): skip fmt check in java 11 mvn tasks
diegomarquezp Mar 28, 2025
4f46aa2
feat(hermetic-build): use java 17 in Docker image
diegomarquezp Mar 28, 2025
c824163
chore: generate libraries at Fri Mar 28 20:33:10 UTC 2025
cloud-java-bot Mar 28, 2025
e454b1e
Revert "chore: generate libraries at Fri Mar 28 20:33:10 UTC 2025"
diegomarquezp Mar 28, 2025
1443660
temporarily prevent cloud java bot updates
diegomarquezp Mar 28, 2025
3dedf0c
chore: format java-showcase
diegomarquezp Mar 28, 2025
1973ef5
chore: format showcase test files
diegomarquezp Mar 28, 2025
1d55f6c
chore: update shared dependencies to java 17
diegomarquezp Mar 28, 2025
da1a26f
chore: formatter dependency is managed by java-shared-config
diegomarquezp Mar 28, 2025
11ce72a
Merge branch 'update-sharedconfig-and-lint' of https://github.com/goo…
diegomarquezp Mar 28, 2025
d5527da
chore: skip fmt check in Airlock docker image
diegomarquezp Mar 28, 2025
134a4a2
chore: infer the google-java-format version in the Airlock Docker image
diegomarquezp Mar 28, 2025
76c1846
chore: use java 17 in java8 compatibility check
diegomarquezp Mar 28, 2025
7147c8e
chore: format showcase files
diegomarquezp Mar 28, 2025
5292d7a
chore: update contribution guidelines to use spotify group ID
diegomarquezp Mar 31, 2025
36d9ee4
chore: update fmt plugin in gapic showcase
diegomarquezp Mar 31, 2025
57e530f
chore: revert format changes temporarily for review
diegomarquezp Mar 31, 2025
e975139
Revert "chore: revert format changes temporarily for review"
diegomarquezp Apr 1, 2025
6b5c220
restore hermetic generation workflow
diegomarquezp Apr 1, 2025
23681cc
Revert "restore hermetic generation workflow"
diegomarquezp Apr 1, 2025
a3e10d0
chore: generate libraries at Tue Apr 1 18:42:50 UTC 2025
cloud-java-bot Apr 1, 2025
0023fab
sync dockerfiles
diegomarquezp Apr 2, 2025
454a933
Merge remote-tracking branch 'origin' into update-sharedconfig-and-lint
diegomarquezp Apr 2, 2025
0942ea3
Merge remote-tracking branch 'refs/remotes/origin/update-sharedconfig…
diegomarquezp Apr 2, 2025
5bfdf7f
update Dockerfile
diegomarquezp Apr 2, 2025
403bedf
do not transfer problematic file
diegomarquezp Apr 2, 2025
808c115
no cache
diegomarquezp Apr 2, 2025
a18245b
update golden and generator in cloudbuild job
diegomarquezp Apr 2, 2025
2bd03cb
fix jar copy
diegomarquezp Apr 2, 2025
14f689e
remove redundant switch
diegomarquezp Apr 2, 2025
ea4d580
restore library generation
diegomarquezp Apr 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.15.0'
_JAVA_SHARED_CONFIG_VERSION: '1.15.1'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.15.0'
_JAVA_SHARED_CONFIG_VERSION: '1.15.1'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
Expand Down
2 changes: 1 addition & 1 deletion .cloudbuild/graalvm/cloudbuild-test-a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.45.2-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.15.0'
_JAVA_SHARED_CONFIG_VERSION: '1.15.1'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
Expand Down
2 changes: 1 addition & 1 deletion .cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.15.0'
_JAVA_SHARED_CONFIG_VERSION: '1.15.1'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.15.0'
_JAVA_SHARED_CONFIG_VERSION: '1.15.1'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
Expand Down
2 changes: 1 addition & 1 deletion .cloudbuild/graalvm/cloudbuild-test-b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.45.2-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.15.0'
_JAVA_SHARED_CONFIG_VERSION: '1.15.1'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
Expand Down
2 changes: 1 addition & 1 deletion .cloudbuild/graalvm/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.45.2-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.15.0'
_JAVA_SHARED_CONFIG_VERSION: '1.15.1'
steps:
# GraalVM A build
- name: gcr.io/cloud-builders/docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ steps:
- name: gcr.io/cloud-builders/docker
args: [
"build",
"--no-cache",
"-t", "${_TEST_IMAGE}",
"-f", ".cloudbuild/library_generation/library_generation_airlock.Dockerfile",
"."
Expand Down Expand Up @@ -48,7 +49,6 @@ steps:
cd /workspace
git clone https://github.com/googleapis/google-cloud-java
cd google-cloud-java
git switch 113a378d5aad5018876ec0a8cbfd4d6a4f746809
git checkout chore/test-hermetic-build
mkdir ../golden
cd ../golden
Expand All @@ -68,10 +68,10 @@ steps:
- |
mvn dependency:copy \
-B -ntp \
-Dartifact=com.google.api:gapic-generator-java:2.38.1 \
-Dartifact=com.google.api:gapic-generator-java:2.55.1 \
-DoutputDirectory=/workspace
cd /workspace
mv gapic-generator-java-2.38.1.jar gapic-generator-java.jar
mv gapic-generator-java-2.55.1.jar gapic-generator-java.jar
id: prepare-generator-jar
waitFor: [ "-" ]

Expand Down
7 changes: 4 additions & 3 deletions .cloudbuild/library_generation/library_generation.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# install gapic-generator-java in a separate layer so we don't overload the image
# with the transferred source code and jars

FROM docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine@sha256:456f60c1643cf70e3c1d630884387fbfa207ad5975d17b0323cc36030dc13c40 AS ggj-build

FROM docker.io/library/maven:3.9.9-eclipse-temurin-17-alpine@sha256:969014ee8852c9910ff5ef09de17541c2587819364b79d7dc044634dfb8a3388 AS ggj-build

WORKDIR /sdk-platform-java
COPY . .
Expand All @@ -35,7 +36,7 @@ RUN cp "/root/.m2/repository/com/google/api/gapic-generator-java/${DOCKER_GAPIC_

FROM docker.io/library/alpine:3.21.2@sha256:56fa17d2a7e7f168a043a2712e63aed1f8543aeafdcee47c58dcffe38ed51099 as glibc-compat

RUN apk add git sudo
RUN apk update && apk add git sudo
# This SHA is the latest known-to-work version of this binary compatibility tool
ARG GLIB_MUS_SHA=e94aca542e3ab08b42aa0b0d6e72478b935bb8e8
WORKDIR /home
Expand All @@ -62,7 +63,7 @@ ENV HOME=/home
ENV OS_ARCHITECTURE="linux-x86_64"

# install OS tools
RUN apk update && apk add unzip curl rsync openjdk11 jq bash nodejs npm git
RUN apk update && apk add unzip curl rsync openjdk17 jq bash nodejs npm git

SHELL [ "/bin/bash", "-c" ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ COPY . .
ENV DOCKER_GAPIC_GENERATOR_VERSION="2.55.2-SNAPSHOT"
# {x-version-update-end}

RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
# Download the java formatter
RUN mvn -pl gapic-generator-java-pom-parent help:evaluate -Dexpression='google-java-format.version' -q -DforceStdout > /java-formatter-version
RUN cat /java-formatter-version
RUN V=$(cat /java-formatter-version) && curl -o "/google-java-format.jar" "https://maven-central.storage-download.googleapis.com/maven2/com/google/googlejavaformat/google-java-format/${V}/google-java-format-${V}-all-deps.jar"

# Skipping the fmt check until 3.9.9-eclipse-temurin-17-alpine:969014ee8852 is available in Airlock.
RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip
RUN cp "/root/.m2/repository/com/google/api/gapic-generator-java/${DOCKER_GAPIC_GENERATOR_VERSION}/gapic-generator-java-${DOCKER_GAPIC_GENERATOR_VERSION}.jar" \
"./gapic-generator-java.jar"

Expand Down Expand Up @@ -52,15 +58,14 @@ RUN sh compile-x86_64-alpine-linux.sh
# 3.12.7-alpine3.20
FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/python@sha256:b83d5ec7274bee17d2f4bd0bfbb082f156241e4513f0a37c70500e1763b1d90d as final

ARG OWLBOT_CLI_COMMITTISH=8b7d94b4a8ad0345aeefd6a7ec9c5afcbeb8e2d7
ARG OWLBOT_CLI_COMMITTISH=3a68a9c0de318784b3aefadcc502a6521b3f1bc5
ARG PROTOC_VERSION=25.5
ARG GRPC_VERSION=1.69.0
ARG JAVA_FORMAT_VERSION=1.7
ARG GRPC_VERSION=1.70.0
ENV HOME=/home
ENV OS_ARCHITECTURE="linux-x86_64"

# install OS tools
RUN apk update && apk add unzip curl rsync openjdk11 jq bash nodejs npm git
RUN apk update && apk add unzip curl rsync openjdk17 jq bash nodejs npm git

SHELL [ "/bin/bash", "-c" ]

Expand All @@ -78,6 +83,7 @@ COPY --from=glibc-compat /lib/libc.* /lib/
COPY --from=glibc-compat /usr/lib/libgcc* /usr/lib/
COPY --from=glibc-compat /usr/lib/libstdc* /usr/lib/
COPY --from=glibc-compat /usr/lib/libobstack* /usr/lib/
COPY --from=glibc-compat /lib/libm.so.6 /usr/lib/


# copy source code
Expand All @@ -99,14 +105,6 @@ RUN source /src/library_generation/utils/utilities.sh \
# similar to protoc, we indicate grpc is available in the container via env vars
ENV DOCKER_GRPC_LOCATION="/grpc/protoc-gen-grpc-java.exe"

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

RUN python -m pip install --upgrade pip

# install main scripts as a python package
Expand All @@ -126,12 +124,19 @@ RUN owl-bot copy-code --version
RUN chmod o+rx $(which owl-bot)
RUN apk del -r npm && apk cache clean

# download the Java formatter
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 \
"${HOME}"/.library_generation/google-java-format.jar
# copy the Java formatter
COPY --from=ggj-build "/google-java-format.jar" "${HOME}"/.library_generation/google-java-format.jar
RUN chmod 755 "${HOME}"/.library_generation/google-java-format.jar
ENV JAVA_FORMATTER_LOCATION="${HOME}/.library_generation/google-java-format.jar"

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

# allow users to access the script folders
RUN chmod -R o+rx /src

Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- run: bazelisk version
- name: Install Maven modules
run: |
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip
- name: Integration Tests
run: |
bazelisk --batch test //test/integration/...
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
- name: Install all modules using Java 11
shell: bash
run: |
mvn -V -B -ntp clean install -DskipTests
mvn -V -B -ntp clean install -DskipTests -Dfmt.skip
- uses: actions/setup-java@v3
with:
java-version: 8
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: temurin
cache: maven
- run: java -version
Expand All @@ -211,7 +211,7 @@ jobs:
- name: Compatibility check
# package jar so that gapic-generator-java module can use
# testlib modules of gax
run: mvn package clirr:check -DskipTests
run: mvn package clirr:check -DskipTests -Dfmt.skip

showcase:
runs-on: ubuntu-22.04
Expand All @@ -227,8 +227,9 @@ jobs:
- run: mvn -version
- name: Install Maven modules
run: |
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip
- name: Java Linter
if: matrix.java >= 17
working-directory: java-showcase
run: |
mvn -B -ntp fmt:check
Expand Down Expand Up @@ -329,7 +330,7 @@ jobs:
cache: maven
- name: Install Maven modules to local Maven repository
run: |
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip
- name: Validate gapic-generator-java-bom
uses: googleapis/java-cloud-bom/tests/validate-bom@47ad868794c5d38ee7eb95d69371a7a79f84d890
with:
Expand All @@ -352,7 +353,7 @@ jobs:
working-directory: java-shared-dependencies/unmanaged-dependency-check
- name: Install Maven modules
run: |
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip
- name: Unmanaged dependency check
uses: ./java-shared-dependencies/unmanaged-dependency-check
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/java_compatibility_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: temurin
cache: maven
- name: Install Maven modules to local Maven repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shared_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
java-version: 17
- run: java -version
- name: Install maven modules
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 @@ -118,7 +118,7 @@
</configuration>
</plugin>
<plugin>
<groupId>com.coveo</groupId>
<groupId>com.spotify.fmt</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,8 @@ void collectionWildcardMatchingInvalid() {
Assertions.assertThrows(
ValidationException.class,
() -> PathTemplate.create("v1/publishers/{publisher}/books/-"));
};
}
;

@Test
void complexResourceIdPubSubDeletedTopic() {
Expand Down
3 changes: 1 addition & 2 deletions coverage-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@
</executions>
</plugin>
<plugin>
<groupId>com.coveo</groupId>
<groupId>com.spotify.fmt</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.9</version>
</plugin>
</plugins>
</build>
Expand Down
2 changes: 1 addition & 1 deletion gapic-generator-java-pom-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-shared-config</artifactId>
<version>1.15.0</version>
<version>1.15.1</version>
<relativePath/>
</parent>

Expand Down
3 changes: 1 addition & 2 deletions gapic-generator-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@
</plugin>

<plugin>
<groupId>com.coveo</groupId>
<groupId>com.spotify.fmt</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.9.1</version>
</plugin>

<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@
public abstract class ClassDefinition implements AstNode {
// Optional.
public abstract ImmutableList<CommentStatement> fileHeader();

// Required for samples classes.
@Nullable
public abstract RegionTag regionTag();

// Required.
public abstract ScopeNode scope();

// Required.
public abstract IdentifierNode classIdentifier();

// Required for outer classes.
@Nullable
public abstract String packageString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ private static Builder builder() {
abstract static class Builder {
// Private setter.
abstract Builder setInitializationExpr(Expr initializationExpr);

// Private setter.
abstract Builder setTerminationExpr(Expr terminationExpr);

// Private setter.
abstract Builder setUpdateExpr(Expr incrementExpr);

// Private setter.
abstract Builder setBody(List<Statement> body);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public abstract static class Builder {
String returnDescription = null;
List<String> paramsList = new ArrayList<>();
List<String> componentsList = new ArrayList<>();

// Private accessor, set complete and consolidated comment.
abstract Builder setComment(String comment);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public static LineComment withComment(String comment) {
@AutoValue.Builder
public abstract static class Builder {
public abstract Builder setComment(String comment);

// Private accessor.
abstract String comment();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public abstract class MethodDefinition implements AstNode {

// Required.
public abstract ScopeNode scope();

// Required.
public abstract TypeNode returnType();

// Required.
public abstract IdentifierNode methodIdentifier();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public abstract class TryCatchStatement implements Statement {

// Optional only if the sample code bit is set (i.e. this is sample code).
public abstract List<VariableExpr> catchVariableExprs();

// Optional only if the sample code bit is set (i.e. this is sample code).
public abstract List<List<Statement>> catchBlocks();

Expand Down
Loading
Loading