Skip to content

chore(format): update google-java-format to 1.25.2 via java-shared-config update#3726

Merged
diegomarquezp merged 35 commits intomainfrom
update-sharedconfig-and-lint
Apr 2, 2025
Merged

chore(format): update google-java-format to 1.25.2 via java-shared-config update#3726
diegomarquezp merged 35 commits intomainfrom
update-sharedconfig-and-lint

Conversation

@diegomarquezp
Copy link
Contributor

@diegomarquezp diegomarquezp commented Mar 28, 2025

Context Doc

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. Some pom.xml explicitly referenced the 2.9.1 version, but I removed it so it's controlled by google-cloud-shared-config.
  • 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 for upcoming changes), which I plan to do before merging this PR.

Before merging:

  • Update golden branch
  • Restore hermetic_library_generation workflow
  • Restore formatted java files

@diegomarquezp diegomarquezp marked this pull request as ready for review March 31, 2025 16:03
name: Hermetic library generation upon generation config change through pull requests
on:
pull_request:
# TODO: uncomment this before merging to prevent a formatting regression
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This need to be uncommented now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will uncomment it right after restoring the formatted files. I'll cancel the job once the CIs start.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is library_generation_airlock.Dockerfile used for? What is the difference between it and library_generation.Dockerfile?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a Airlock variant of our Dockerfile. It was introduced in #3472 and it seemingly is a reflection of the original one, but fetching the images from Airlock (this is compatible with Cloud Build).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably have a way to share the common code between the two, or maybe only keep the airlock one if it can be used locally as well. Otherwise these two files can easily get diverged from each other as they evolve. This is a separate future enhancement though.

@diegomarquezp diegomarquezp requested a review from blakeli0 April 1, 2025 17:53
@blakeli0 blakeli0 requested review from suztomo and removed request for blakeli0 April 1, 2025 17:59
@diegomarquezp diegomarquezp reopened this Apr 2, 2025
@diegomarquezp diegomarquezp added the automerge Merge the pull request once unit tests and other checks pass. label Apr 2, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 2, 2025

Quality Gate Failed Quality Gate failed for 'gapic-generator-java-root'

Failed conditions
3.0% Coverage on New Code (required ≥ 80%)
30.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 2, 2025

Quality Gate Failed Quality Gate failed for 'java_showcase_integration_tests'

Failed conditions
61.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@diegomarquezp diegomarquezp merged commit 4eed4d6 into main Apr 2, 2025
50 of 54 checks passed
@diegomarquezp diegomarquezp deleted the update-sharedconfig-and-lint branch April 2, 2025 18:34
lqiu96 pushed a commit that referenced this pull request Jun 10, 2025
…nfig 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>
lqiu96 pushed a commit that referenced this pull request Aug 21, 2025
…nfig 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Merge the pull request once unit tests and other checks pass. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants