You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(format): update google-java-format to 1.25.2 via java-shared-config update (#3726)
[Context
Doc](https://docs.google.com/document/d/1Fqb4lXZ0FEpkJoSUvUp7Ow-z0fdcLyLE30lDDsGaRY0/edit?resourcekey=0-IueNnA7qMxmyWH6bGE9bsw&tab=t.0#heading=h.pi1uh78box27)
This replaces #3724
in order to manually prepare the repo for this update. The preparation
includes:
- Update google-cloud-shared-config to `1.15.1`.
- Configure pom.xml files to reference the `fmt` plugin using the
`com.spotify.fmt` groupId instead of `com.coveo`. The group ID in [since
2022](https://github.com/spotify/fmt-maven-plugin/blame/main/README.md#L7).
Some pom.xml explicitly referenced the `2.9.1` version, but I removed it
so it's [controlled by
google-cloud-shared-config](https://github.com/googleapis/java-shared-config/blob/bc8f22d02511c0467271698acf340874ed987160/java-shared-config/pom.xml#L172-L174).
- Update our `ci.yaml` to either run the `mvn` tasks using java 17 or
running the task with the `-Dfmt.skip` flag.
- Update `java_compatibility_check.yaml` from java 11 to java 17.
- Update our docker image to use java 17 instead of 11.
- Format the codebase using `mvn fmt:format` (see
36d9ee4
for format changes).
### Review instructions
You will see that the checks are failing because I did not include file
formatting in the latest commit of this PR for the sake of browser
performance. However, I ran the checks in
36d9ee4
with formatted files and they were all green except for the integration
test, which is failing because I haven't updated the golden branch (see
[this branch
comparison](googleapis/google-cloud-java@chore/test-hermetic-build...chore/test-hermetic-build-update-sharedconfig-and-lint)
for upcoming changes), which I plan to do before merging this PR.
#### Before merging:
- [x] Update golden branch
- [x] Restore hermetic_library_generation workflow
- [x] Restore formatted java files
---------
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
27
+
# Download the java formatter
28
+
RUN mvn -pl gapic-generator-java-pom-parent help:evaluate -Dexpression='google-java-format.version' -q -DforceStdout > /java-formatter-version
29
+
RUN cat /java-formatter-version
30
+
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"
31
+
32
+
# Skipping the fmt check until 3.9.9-eclipse-temurin-17-alpine:969014ee8852 is available in Airlock.
33
+
RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip
28
34
RUN cp "/root/.m2/repository/com/google/api/gapic-generator-java/${DOCKER_GAPIC_GENERATOR_VERSION}/gapic-generator-java-${DOCKER_GAPIC_GENERATOR_VERSION}.jar" \
29
35
"./gapic-generator-java.jar"
30
36
@@ -52,15 +58,14 @@ RUN sh compile-x86_64-alpine-linux.sh
52
58
# 3.12.7-alpine3.20
53
59
FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/python@sha256:b83d5ec7274bee17d2f4bd0bfbb082f156241e4513f0a37c70500e1763b1d90d as final
0 commit comments