Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having an uber pom for better build #9

Merged
merged 3 commits into from
Jan 15, 2025
Merged

Having an uber pom for better build #9

merged 3 commits into from
Jan 15, 2025

Conversation

bageshwar
Copy link
Collaborator

@bageshwar bageshwar commented Jan 15, 2025

Fixes #7

Summary by CodeRabbit

Release Notes

  • New Features

    • Added logging mechanism to configuration management.
    • Enhanced project structure with multi-module Maven setup.
  • Dependency Updates

    • Updated pibify-maven-plugin version to 1.6.
    • Updated pibify-core dependency to version 1.6.
    • Added vertx-core dependency to Maven plugin.
  • Code Improvements

    • Added @Pibify annotations to model classes.
    • Refined error handling with logging instead of exceptions.
    • Updated project naming conventions for better clarity.
  • Test Environments

    • Updated configurations for Dropwizard, Lombok, and Vertx test environments.
    • Modified group ID and project name for improved structure in Dropwizard test environment.
  • Workflow Updates

    • Updated Java CI workflow to use JDK 17.

Copy link

coderabbitai bot commented Jan 15, 2025

Walkthrough

This pull request introduces a comprehensive restructuring of the Pibify project's build configuration and module management. The changes include creating a parent POM file, updating module configurations, modifying the Dropwizard test environment, and adding Pibify annotations to the Product class. The modifications aim to standardize the project structure, improve build consistency, and enhance the configuration management across different test environments.

Changes

File Change Summary
pom.xml Created parent POM defining project metadata, modules, and protobuf-java version
test-environments/dropwizard/test-dropwizard/pom.xml Updated groupId and name, standardized project identification
test-environments/dropwizard/test-dropwizard/src/main/java/com/flipkart/pibify/PibifyDemoApplication.java Replaced PibifyHandlerCache with AbstractPibifyHandlerCache
test-environments/lombok/pom.xml Updated plugin and core dependency versions to 1.6
test-environments/vertx/pom.xml Updated plugin version, added vertx-core dependency
test-environments/vertx/src/main/java/com/flipkart/pibify/Product.java Added @Pibify annotations to class fields
pibify-core/src/main/java/com/flipkart/pibify/core/PibifyConfiguration.java Added logging mechanism, replaced exception with warning log

Assessment against linked issues

Objective Addressed Explanation
Create parent POM (7)
Sub-module structure (7)
Improve build configuration (7)

Possibly related PRs

Poem

🐰 In Maven's grand design we dance,
Modules aligned with each new glance,
Pibify grows, structured and bright,
Logging whispers, builds take flight!
A rabbit's code, both clean and light 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7c3068 and 9291704.

📒 Files selected for processing (1)
  • .github/workflows/maven.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/maven.yml

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (5)
test-environments/dropwizard/test-dropwizard/pom.xml (2)

Line range hint 91-102: Consolidate duplicate maven-compiler-plugin configurations.

The maven-compiler-plugin is declared twice with different configurations. This can lead to confusion and potential conflicts.

Consolidate the configurations into a single declaration:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.13.0</version>
    <configuration>
        <source>8</source>
        <target>8</target>
    </configuration>
    <executions>
        <execution>
            <id>compile-generated-pibify-sources</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>compile</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Also applies to: 156-171


Use Dropwizard version 4.0.1 instead of 4.0.10

The specified version 4.0.10 appears to be a future version that hasn't been released yet. The latest stable version of Dropwizard is 4.0.1. Update the version in:

  • <dropwizard.version> property
  • dropwizard-core dependency version in the pibify-maven-plugin configuration
🔗 Analysis chain

Line range hint 37-37: Verify Dropwizard version compatibility.

The specified Dropwizard version 4.0.10 appears incorrect as it doesn't align with Dropwizard's version history (latest stable is 2.x).

Run this script to check available Dropwizard versions:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check latest Dropwizard versions from Maven Central
curl -s "https://search.maven.org/solrsearch/select?q=g:io.dropwizard+AND+a:dropwizard-core&rows=5&wt=json" | jq -r '.response.docs[].v' | sort -V

Length of output: 153


Script:

#!/bin/bash
# Find all pom.xml files and search for Dropwizard version references
fd pom.xml --exec grep -l "dropwizard" {} \; | xargs cat

# Search for Dropwizard imports in source files
rg "import.*dropwizard" -A 2

Length of output: 11246

test-environments/lombok/pom.xml (1)

Invalid jackson-databind version specified

The version 2.17.2 appears to be invalid as it's not available in Maven Central. The latest available version as of January 2025 is 2.18.2.

  • Update jackson-databind version in test-environments/lombok/pom.xml to use a valid version (e.g., 2.18.2)
🔗 Analysis chain

Line range hint 106-110: Verify jackson-databind version validity and security.

The specified version 2.17.2 appears to be from the future relative to the current date (January 2025).

Run this script to check available versions and security advisories:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check Maven Central for latest jackson-databind version
echo "Checking jackson-databind versions..."
curl -s https://search.maven.org/solrsearch/select?q=g:%22com.fasterxml.jackson.core%22+AND+a:%22jackson-databind%22&rows=5&wt=json | jq '.response.docs[].v'

# Check for security advisories
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: MAVEN, package: "com.fasterxml.jackson.core:jackson-databind") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Length of output: 2646


Script:

#!/bin/bash
# Check if jackson-databind dependency exists in the pom.xml
echo "Checking for jackson-databind in pom.xml..."
cat test-environments/lombok/pom.xml | grep -A 4 "jackson-databind"

Length of output: 331

test-environments/dropwizard/test-dropwizard/src/main/java/com/flipkart/pibify/PibifyDemoApplication.java (2)

Line range hint 76-89: Replace System.out.println with proper logging

Using System.out.println for logging is not suitable for production. Consider using the Dropwizard logging framework.

+private static final Logger logger = LoggerFactory.getLogger(ParityCheckerListener.class);

 @Override
 public void parityCheckSucceeded(Object primary, Object pibified, Object requestContext) {
-    System.out.println("Parity check succeeded");
+    logger.info("Parity check succeeded");
 }

 @Override
 public void parityCheckFailed(Object primary, Object pibified, Object requestContext, AssertionError ae) {
-    System.out.println("Parity check failed");
+    logger.error("Parity check failed", ae);
 }

 @Override
 public void parityCheckError(Object primary, Object pibified, Object requestContext, Throwable e) {
-    System.out.println("Parity check error");
+    logger.error("Parity check error", e);
 }

Line range hint 1-89: Fix Java version mismatch in pom.xml

The pipeline failure indicates a Java version mismatch. Dropwizard requires Java 11 (class version 55.0) but the project is configured for Java 8 (class version 52.0).

Update the maven-compiler-plugin configuration in pom.xml:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
-        <source>1.8</source>
-        <target>1.8</target>
+        <source>11</source>
+        <target>11</target>
    </configuration>
</plugin>
🧹 Nitpick comments (11)
test-environments/dropwizard/test-dropwizard/pom.xml (2)

Line range hint 108-143: Review dependency version management in pibify-maven-plugin.

The plugin declares explicit versions for dependencies that are already managed by dropwizard-dependencies BOM. This can lead to version conflicts.

Consider removing explicit versions and inheriting them from the BOM:

<dependencies>
    <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-core</artifactId>
-       <version>4.0.10</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
-       <version>2.17.2</version>
    </dependency>
    <!-- Similar changes for other dependencies -->
</dependencies>

Line range hint 175-189: Clean up reporting configuration.

The reporting section needs attention:

  1. Remove commented out configuration
  2. Specify version for maven-javadoc-plugin

Apply these changes:

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <configuration>
-               <!--                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>-->
                <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
+           <version>3.6.3</version>
        </plugin>
    </plugins>
</reporting>
test-environments/lombok/pom.xml (3)

Line range hint 32-42: Consider consolidating compiler plugin configurations.

There are two separate configurations for the maven-compiler-plugin. Consider consolidating them into a single configuration with multiple executions.

Here's a suggested refactor:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
+               <executions>
+                   <execution>
+                       <id>default-compile</id>
+                       <goals>
+                           <goal>compile</goal>
+                       </goals>
+                   </execution>
+                   <execution>
+                       <id>compile-generated-pibify-sources</id>
+                       <phase>prepare-package</phase>
+                       <goals>
+                           <goal>compile</goal>
+                       </goals>
+                   </execution>
+               </executions>
            </plugin>
-           <plugin>
-               <groupId>org.apache.maven.plugins</groupId>
-               <artifactId>maven-compiler-plugin</artifactId>
-               <version>${maven-compiler-plugin.version}</version>
-               <executions>
-                   <execution>
-                       <id>compile-generated-pibify-sources</id>
-                       <phase>prepare-package</phase>
-                       <goals>
-                           <goal>compile</goal>
-                       </goals>
-                   </execution>
-               </executions>
-           </plugin>

Also applies to: 83-96


Line range hint 2-4: Update copyright year.

The copyright year is set to 2025, which is the current year. Consider using a range (e.g., 2023-2025) if this is not a new file.


Line range hint 29-31: Consider using properties for dependency versions.

For better maintainability, consider extracting dependency versions into properties, similar to how maven-compiler-plugin.version is managed.

Here's a suggested addition to the properties section:

     <properties>
         <maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
+        <lombok.version>1.18.22</lombok.version>
+        <jackson.version>2.17.2</jackson.version>
+        <pibify.version>1.6</pibify.version>
     </properties>

Then update the dependencies to use these properties:

         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
-            <version>1.18.22</version>
+            <version>${lombok.version}</version>
         </dependency>
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
-            <version>2.17.2</version>
+            <version>${jackson.version}</version>
             <scope>test</scope>
         </dependency>

Also applies to: 101-120

test-environments/vertx/src/main/java/com/flipkart/pibify/Product.java (3)

Line range hint 1-15: Update copyright year to current year (2025 → 2024)

The copyright notice shows a future year.

- *Copyright [2025] [Original Author]
+ *Copyright [2024] [Original Author]

24-28: Complete the class documentation

The class documentation is incomplete and missing its purpose description.

 /**
- * This class is used for
+ * This class represents a product entity with identifiable attributes like id, name, weight, and price.
+ * Each field is annotated with @Pibify for serialization/deserialization ordering.
  * Author bageshwar.pn
  * Date 02/10/24
  */

30-40: Consider adding validation constraints

The fields are properly annotated with @Pibify for ordering, but consider adding validation constraints (e.g., @NotNull, @min, @max) to ensure data integrity.

 @Pibify(1)
+@NotNull
 String id;

 @Pibify(2)
+@NotNull
 String name;

 @Pibify(3)
+@Min(0)
 int weight;

 @Pibify(4)
+@Min(0)
 double price;
pibify-core/src/main/java/com/flipkart/pibify/core/PibifyConfiguration.java (2)

Line range hint 1-15: Update copyright year to current year (2025 → 2024)

The copyright notice shows a future year.

- *Copyright [2025] [Original Author]
+ *Copyright [2024] [Original Author]

30-32: Consider using SLF4J for logging

Using java.util.logging directly creates a dependency on the JDK logging framework. Consider using SLF4J for better logging flexibility.

-import java.util.logging.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

-private static final Logger logger = Logger.getLogger(PibifyConfiguration.class.getName());
+private static final Logger logger = LoggerFactory.getLogger(PibifyConfiguration.class);
test-environments/dropwizard/test-dropwizard/src/main/java/com/flipkart/pibify/PibifyDemoApplication.java (1)

Line range hint 1-15: Update copyright year to current year (2025 → 2024)

The copyright notice shows a future year.

- *Copyright [2025] [Original Author]
+ *Copyright [2024] [Original Author]
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7899cfa and d7dee83.

📒 Files selected for processing (7)
  • pibify-core/src/main/java/com/flipkart/pibify/core/PibifyConfiguration.java (2 hunks)
  • pom.xml (1 hunks)
  • test-environments/dropwizard/test-dropwizard/pom.xml (1 hunks)
  • test-environments/dropwizard/test-dropwizard/src/main/java/com/flipkart/pibify/PibifyDemoApplication.java (2 hunks)
  • test-environments/lombok/pom.xml (1 hunks)
  • test-environments/vertx/pom.xml (1 hunks)
  • test-environments/vertx/src/main/java/com/flipkart/pibify/Product.java (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • pom.xml
🧰 Additional context used
🪛 GitHub Actions: Java CI with Maven
test-environments/dropwizard/test-dropwizard/src/main/java/com/flipkart/pibify/PibifyDemoApplication.java

[error] 30-30: Class file version mismatch: io.dropwizard.core.Application has version 55.0 but project requires 52.0

🔇 Additional comments (6)
test-environments/dropwizard/test-dropwizard/pom.xml (1)

27-27: LGTM! Improved project identification.

The changes to groupId and name follow Maven best practices:

  • com.pibify follows the reverse domain name convention
  • pibify-test-dropwizard clearly indicates the module's purpose

Also applies to: 32-32

test-environments/vertx/pom.xml (3)

Line range hint 31-144: Consider centralizing dependency management.

The POM file has several dependencies with fixed versions. Consider:

  1. Moving versions to <properties> or a parent POM's <dependencyManagement> section
  2. Regular security audits for dependencies, especially for jackson-databind

Here's how you could refactor the versions:

 <properties>
     <maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
     <pibify-annotation-processor.version>1.1</pibify-annotation-processor.version>
+    <vertx.version>4.5.9</vertx.version>
+    <jackson.version>2.17.2</jackson.version>
+    <junit-jupiter.version>5.9.1</junit-jupiter.version>
 </properties>

Let's check for any security advisories:


49-49: Verify compatibility with the new plugin version.

The plugin version has been updated from 1.3 to 1.6. While this aligns with the pibify-core dependency version, please ensure there are no breaking changes that could affect the build process.

Let's check the changelog and usage across the project:

✅ Verification successful

✓ Version update is consistent across the project

All modules using the pibify-maven-plugin have been updated to version 1.6, maintaining consistency throughout the codebase:

  • test-environments/lombok
  • test-environments/vertx
  • test-environments/pibify-test-vanilla
  • test-environments/dropwizard/test-dropwizard
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any potential incompatibilities or required updates
# 1. Search for plugin usage patterns that might need updates
rg -g "pom.xml" "pibify-maven-plugin"

# 2. Check if all modules are using consistent versions
rg -g "pom.xml" "com\.flipkart\.pibify.*version"

Length of output: 721


Script:

#!/bin/bash
# Check parent POM for version management
echo "=== Parent POM Version Management ==="
rg -A 5 "<dependencyManagement>|<pluginManagement>" pom.xml

# Extract version declarations from each module
echo -e "\n=== Module Version Declarations ==="
for pom in $(rg --files-with-matches "pibify-maven-plugin" -g "pom.xml"); do
    echo "=== $pom ==="
    rg -A 3 "<artifactId>pibify-maven-plugin</artifactId>" "$pom"
done

Length of output: 2727


50-56: Review architectural change in plugin dependency.

The addition of vertx-core as a plugin dependency suggests a significant change in how the plugin interacts with Vert.x. This architectural change warrants careful review:

  1. Why does the plugin now need direct access to Vert.x APIs?
  2. Could this create classloader issues since vertx-core exists both as a plugin and project dependency?

Let's verify the version stability and usage:

✅ Verification successful

Plugin dependency on vertx-core is justified and properly configured.

The vertx-core dependency in the plugin configuration is necessary for source generation and maintains version consistency (4.5.9) across all usages. The architecture is sound with appropriate scope management to prevent runtime conflicts.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any potential version conflicts or inconsistencies
# 1. Search for all vertx-core version references
rg -g "pom.xml" "vertx-core.*version"

# 2. Look for any direct plugin usages of Vert.x APIs
ast-grep --pattern 'import io.vertx.$_'

Length of output: 79


Script:

#!/bin/bash
# Search for vertx-core dependencies with broader patterns
echo "=== Searching for vertx-core dependencies ==="
rg -g "pom.xml" "<artifactId>vertx-core</artifactId>" -C 5

# Search for any Vertx imports or usage in Java/Kotlin files
echo "=== Searching for Vertx imports in source files ==="
rg -t java -t kotlin "import.*io\.vertx" -C 2

# Check plugin configuration files
echo "=== Checking plugin configurations ==="
fd "pom.xml" test-environments/vertx -x cat {}

Length of output: 11985

test-environments/lombok/pom.xml (1)

47-47: Verify pibify component versions across the project.

The version update to 1.6 for pibify-maven-plugin aligns with the PR objective of standardizing versions.

Run this script to verify version consistency across all pom.xml files:

✅ Verification successful

Version consistency verified

All pibify components (maven-plugin and core) consistently use version 1.6 across the entire project.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any inconsistencies in pibify component versions
echo "Checking pibify component versions..."
fd -e xml -x grep -l "com.flipkart.pibify" {} \; | xargs grep -A 1 "<artifactId>pibify-"

Length of output: 2660

test-environments/dropwizard/test-dropwizard/src/main/java/com/flipkart/pibify/PibifyDemoApplication.java (1)

Line range hint 37-37: Address TODO comment for integration tests

The TODO comment indicates missing integration tests. This should be addressed to ensure proper testing coverage.

Would you like me to help create integration tests or create a GitHub issue to track this task?

Comment on lines 68 to 71
if (PibifyConfiguration.INSTANCE != null) {
throw new IllegalStateException("Re-creating pibify configuration");
logger.warning("Re-creating pibify configuration");
}
PibifyConfiguration.INSTANCE = config;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Reconsider replacing exception with warning log

Replacing the exception with a warning log when recreating configuration could lead to silent failures and unexpected behavior. Consider:

  1. Either keeping the exception to prevent reconfiguration
  2. Or implementing a proper reconfiguration mechanism with validation
 if (PibifyConfiguration.INSTANCE != null) {
-    logger.warning("Re-creating pibify configuration");
+    throw new IllegalStateException("Configuration already initialized. Use reset() method for reconfiguration.");
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (PibifyConfiguration.INSTANCE != null) {
throw new IllegalStateException("Re-creating pibify configuration");
logger.warning("Re-creating pibify configuration");
}
PibifyConfiguration.INSTANCE = config;
if (PibifyConfiguration.INSTANCE != null) {
throw new IllegalStateException("Configuration already initialized. Use reset() method for reconfiguration.");
}
PibifyConfiguration.INSTANCE = config;

@@ -55,10 +55,12 @@ public void initialize(final Bootstrap<PibifyDemoConfiguration> bootstrap) {
public void run(final PibifyDemoConfiguration configuration,
final Environment environment) {

environment.jersey().register(new JakartaPibifyMessageBodyWriter(PibifyHandlerCache.getInstance(), new PibifySampler()));
AbstractPibifyHandlerCache handlerCache = AbstractPibifyHandlerCache.getConcreteInstance("com.pibify.pibify.generated.test.dropwizard.PibifyHandlerCache");
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid hardcoding class names as strings

Using hardcoded class name strings can lead to runtime errors if the class name changes. Consider using Class.getName() instead.

-AbstractPibifyHandlerCache handlerCache = AbstractPibifyHandlerCache.getConcreteInstance("com.pibify.pibify.generated.test.dropwizard.PibifyHandlerCache");
+Class<?> handlerCacheClass = Class.forName("com.pibify.pibify.generated.test.dropwizard.PibifyHandlerCache");
+AbstractPibifyHandlerCache handlerCache = AbstractPibifyHandlerCache.getConcreteInstance(handlerCacheClass.getName());

Committable suggestion skipped: line range outside the PR's diff.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7dee83 and c7c3068.

📒 Files selected for processing (1)
  • .github/workflows/maven.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/maven.yml (1)

24-29: Good choice of GitHub Actions configuration!

The workflow uses:

  • Latest actions/setup-java@v4
  • Eclipse Temurin distribution (well-maintained OpenJDK distribution)
  • Maven dependency caching for faster builds

Comment on lines +24 to 28
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

JDK 17 upgrade requires source/target updates in all modules

The codebase is currently standardized on Java 8 across all modules. Upgrading the GitHub Actions environment to JDK 17 while the project is configured to use Java 8 may lead to build issues. You need to:

  • Update <source>8</source> and <target>8</target> to 17 in all module POMs:
    • pibify-core/pom.xml
    • pibify-maven-plugin/pom.xml
    • test-environments/vertx/pom.xml
    • test-environments/lombok/pom.xml
    • test-environments/dropwizard/test-dropwizard/pom.xml
    • test-environments/pibify-test-vanilla/pom.xml
🔗 Analysis chain

Verify JDK 17 compatibility across all modules.

The upgrade from JDK 8 to 17 is a significant change. While moving to a modern Java version is good, we should ensure all modules and dependencies are compatible with JDK 17.

Let's verify the Java version requirements in the new uber pom:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check Java version requirements in pom files
# Look for maven.compiler.source, maven.compiler.target, and java.version properties

# Check root pom
echo "Checking root pom.xml:"
rg -A 2 '<(maven\.compiler\.(source|target)|java\.version)>' pom.xml

# Check all module poms
echo -e "\nChecking module pom files:"
fd pom.xml --exclude target/ --exec rg -A 2 '<(maven\.compiler\.(source|target)|java\.version)>'

Length of output: 293


Script:

#!/bin/bash
# Search for Java version related configurations more broadly
echo "=== Checking Java version configurations in pom files ==="
fd pom.xml --exclude target/ --exec sh -c 'echo "\nFile: {}"; cat {} | grep -A 5 -E "(<properties>|<plugin>.*compiler|<parent>)"'

# Search for any maven compiler plugin configurations
echo -e "\n=== Checking specific compiler configurations ==="
rg -A 10 '<artifactId>maven-compiler-plugin</artifactId>' 

Length of output: 13081

@bageshwar bageshwar merged commit 2dd4472 into main Jan 15, 2025
2 checks passed
@bageshwar bageshwar deleted the uber-pom branch January 15, 2025 12:28
@coderabbitai coderabbitai bot mentioned this pull request Jan 19, 2025
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.

Create parent pom and sub-module structure for hygienic builds
1 participant