Skip to content

Conversation

@galesky-a
Copy link
Contributor

Description

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @galesky-a, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new, reusable GitHub Action designed to standardize Java code formatting across the repository. By creating a composite action that runs mvn spotless:apply, it provides a consistent and easily integrable solution for maintaining code style, which can be incorporated into various CI workflows. This enhances code quality and reduces manual formatting efforts.

Highlights

  • New GitHub Action for Java Formatting: Introduces a new composite GitHub Action located at .github/actions/format/action.yml. This action is designed to apply Java code formatting using mvn spotless:apply.
  • Reusable Formatting Step: The new action is a reusable component that sets up JDK 20, caches Maven dependencies, and executes the Spotless formatter, making it easy to integrate consistent formatting into various CI workflows.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new composite GitHub Action for formatting Java code using mvn spotless:apply. My review focuses on improving the action's robustness and maintainability by aligning the Java version with the project's configuration, simplifying the caching mechanism using setup-java's built-in features, and updating to a non-deprecated Java distribution. These changes will make the action more reliable and easier to maintain.

Comment on lines +10 to +22
- name: Set up JDK 20 for formatting
uses: actions/setup-java@v4
with:
java-version: '20'
distribution: 'adopt'

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles(format('{0}/**/pom.xml', inputs.path)) }}
restore-keys: |
${{ runner.os }}-m2-
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This section can be simplified and improved.

  1. JDK Version: The pom.xml for this repository specifies Java 11. It's best practice to align the JDK version in the CI with the project's version to avoid potential inconsistencies.
  2. Maven Caching: The actions/setup-java action has built-in caching for Maven, which is simpler and the recommended approach. This removes the need for a separate actions/cache step. By using cache-dependency-path, we can scope the cache to the specific pom.xml files relevant to the path, just like in the original implementation.
  3. Java Distribution: The adopt distribution is deprecated in actions/setup-java@v4. It's recommended to use temurin instead.

You can combine setting up Java and caching into a single, updated step.

    - name: Set up JDK 11 for formatting
      uses: actions/setup-java@v4
      with:
        java-version: '11'
        distribution: 'temurin'
        cache: 'maven'
        cache-dependency-path: '${{ inputs.path }}/**/pom.xml'

@galesky-a galesky-a closed this Jan 9, 2026
@galesky-a galesky-a deleted the fix/java-format-in-ci branch January 9, 2026 15:02
@galesky-a galesky-a restored the fix/java-format-in-ci branch January 9, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants