Skip to content

Conversation

@fangpenlin
Copy link
Contributor

@fangpenlin fangpenlin commented Oct 16, 2025

This PR carries zero functional changes. I just add google-java-format docker compose format and then ran it for all current java files. The project is still very small so that the cost to run it is low right now. It would be much easier to maintain down the road, we can write code without thinking much about the style and let the formatter do its job.

@fangpenlin
Copy link
Contributor Author

Well, a bit update. As I said it carries no functional update, the only exception is that ch.qos.logback somehow broken the CI test build. So I bump them to the latest version for solving the problem.

@fangpenlin fangpenlin marked this pull request as ready for review October 16, 2025 01:28
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

This PR introduces Google Java Format to establish consistent code formatting across the entire Java SDK project. The changes are purely cosmetic, applying standardized formatting rules including 2-space indentation (down from 4-space), proper import ordering, consistent line breaks, and trailing newlines. A new Docker Compose service is added to enable automated formatting via docker-compose run format, which downloads and runs Google Java Format v1.30.0 on all Java files. The PR also includes minor dependency updates to align logback versions (both core and classic updated to 1.5.19) and adds documentation in README.md explaining the new formatting standards.

The formatting changes affect 29 Java files across the codebase, touching models, clients, utilities, and test files. All functional logic remains identical - this is exclusively a code style standardization effort implemented while the project is small to minimize future maintenance overhead and allow developers to focus on functionality rather than manual formatting.

Important Files Changed

Changed Files
Filename Score Overview
compose.yaml 3/5 Adds Docker service for Google Java Format with potential security risk from downloading external JARs
pom.xml 4/5 Updates logback dependency versions from mixed versions to aligned 1.5.19, despite PR claiming zero changes
src/main/java/com/infisical/sdk/util/InfisicalException.java 4/5 Formatting changes only, but pre-existing design issues with exception handling remain
src/main/java/com/infisical/sdk/resources/SecretsClient.java 4/5 Pure formatting changes with clean implementation of secret management operations
README.md 5/5 Adds clear documentation for code formatting standards and usage instructions
src/main/java/com/infisical/sdk/InfisicalSdk.java 5/5 Main SDK class reformatted with consistent indentation and cleaned up imports
src/main/java/com/infisical/sdk/api/ApiClient.java 5/5 HTTP client formatting standardized with no functional changes
src/main/java/com/infisical/sdk/api/QueryBuilder.java 5/5 Simple utility class reformatted with consistent 2-space indentation
src/main/java/com/infisical/sdk/config/SdkConfig.java 5/5 Configuration class with added trailing newline only
src/main/java/com/infisical/sdk/resources/FoldersClient.java 5/5 Folder operations client with cleaned imports and consistent formatting
src/main/java/com/infisical/sdk/util/Helper.java 5/5 Utility methods reformatted with standardized spacing and indentation
src/main/java/com/infisical/sdk/util/ObjectToMapConverter.java 5/5 Reflection-based converter with consistent formatting applied
src/main/java/com/infisical/sdk/models/*.java (15 files) 5/5 All model classes reformatted with consistent 2-space indentation and proper spacing
src/test/java/com/infisical/sdk/InfisicalSdkTest.java 5/5 Test class with improved formatting and organized imports
src/test/java/com/infisical/sdk/auth/AwsAuthProviderTest.java 5/5 Test file with authorization header string properly split across lines
src/test/java/com/infisical/sdk/util/EnvironmentVariables.java 5/5 Test utility with removed unused imports and improved conditional formatting
src/test/java/com/infisical/sdk/util/RandomUtil.java 5/5 Random string generator with formatting improvements only

Confidence score: 4/5

  • This PR is generally safe to merge as it primarily contains formatting changes with minimal functional risk
  • Score reflects mostly cosmetic changes but deducted due to dependency updates in pom.xml (despite PR claiming zero changes), potential security risk in compose.yaml downloading external JARs without verification, and pre-existing issues in InfisicalException.java that weren't addressed
  • Pay close attention to compose.yaml for security implications and pom.xml for the unexpected dependency version changes

Sequence Diagram

sequenceDiagram
    participant Developer
    participant GoogleJavaFormat
    participant DockerCompose
    participant FileSystem

    Developer->>DockerCompose: "docker-compose run format"
    DockerCompose->>GoogleJavaFormat: "Download google-java-format-1.30.0-all-deps.jar"
    GoogleJavaFormat-->>DockerCompose: "JAR downloaded to /tmp/"
    DockerCompose->>FileSystem: "find . -type f -name \"*.java\""
    FileSystem-->>DockerCompose: "List of Java files"
    DockerCompose->>GoogleJavaFormat: "java -jar google-java-format.jar --replace [files]"
    GoogleJavaFormat->>FileSystem: "Format and replace Java files"
    Note over GoogleJavaFormat,FileSystem: All Java files formatted with Google style
    GoogleJavaFormat-->>DockerCompose: "Formatting complete"
    DockerCompose-->>Developer: "Code formatting finished"
Loading

Additional Comments (1)

  1. src/main/java/com/infisical/sdk/config/SdkConfig.java, line 24 (link)

    logic: Error message says "Token must be provided" but should reference "Site URL" since this validation is for the siteUrl field

34 files reviewed, 6 comments

Edit Code Review Agent Settings | Greptile

<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.5.13</version>
<version>1.5.19</version>
Copy link

@PrathameshBhagat PrathameshBhagat Oct 16, 2025

Choose a reason for hiding this comment

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

Just mentioning, #12.

Updating logback classic and core will resolve this issue too.

@PrathameshBhagat
Copy link

PrathameshBhagat commented Oct 16, 2025

@DanielHougaard can you please have a look at this PR too ? #13, have created a video of it as well.

@fangpenlin fangpenlin merged commit 97f544c into main Oct 16, 2025
2 checks passed
@fangpenlin fangpenlin deleted the google-code-format branch October 16, 2025 23:30
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.

4 participants