-
Notifications
You must be signed in to change notification settings - Fork 9
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
use modernway to configure multi datasources #1527
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>3.3.6</version> | ||
<version>3.4.0</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Based on the curl results from checking Spring Boot versions, I can see that Spring Boot 3.4.0 is currently at RC1 (Release Candidate 1) stage, with the latest version being 3.4.0-RC1. This confirms that 3.4.0 mentioned in the pom.xml is indeed a pre-release version. Using Spring Boot 3.4.0 is not recommended for production use The version 3.4.0 specified in pom.xml is a pre-release version that is still in development. For production use, you should use the latest stable version from the 3.3.x line. 🔗 Analysis chainCaution: Using Spring Boot milestone version The upgrade to Spring Boot 3.4.0 uses a milestone release which may not be suitable for production use. Consider using the latest stable version (3.3.x) instead. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check latest stable Spring Boot version and milestone status
curl -s https://repo.spring.io/milestone/org/springframework/boot/spring-boot/maven-metadata.xml | grep -A 2 "<version>3"
# Verify compatibility with current dependencies
rg -l "import org.springframework" | while read -r file; do
echo "=== $file ==="
rg "import org.springframework" "$file"
done
Length of output: 200000 |
||
<relativePath/> <!-- lookup parent from repository --> | ||
</parent> | ||
<groupId>com.example.multitenancy</groupId> | ||
|
@@ -19,7 +19,7 @@ | |
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
|
||
<java.version>21</java.version> | ||
<springdoc-openapi.version>2.6.0</springdoc-openapi.version> | ||
<springdoc-openapi.version>2.7.0-RC1</springdoc-openapi.version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Consider upgrading springdoc-openapi to stable version 2.3.0 The project uses Spring Boot 3.4.0, and springdoc-openapi 2.7.0-RC1 is not recommended for production use. The latest stable version that's compatible with Spring Boot 3.x is 2.3.0. The OpenAPI annotations are actively used in multiple controllers across the codebase, making this a critical dependency.
🔗 Analysis chainReview RC version of springdoc-openapi Using springdoc-openapi 2.7.0-RC1 (release candidate) in production could be risky. Consider:
Let me gather more information about the Spring Boot version used in the project to verify compatibility. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check latest stable springdoc-openapi version
curl -s "https://search.maven.org/solrsearch/select?q=g:org.springdoc+AND+a:springdoc-openapi-starter-webmvc-ui&rows=5&wt=json" | jq -r '.response.docs[].v' | sort -V
# Find OpenAPI usage in codebase
rg -l "@Operation|@ApiResponse|@Tag" | while read -r file; do
echo "=== $file ==="
rg "@Operation|@ApiResponse|@Tag" "$file"
done
Length of output: 2462 Script: #!/bin/bash
# Check Spring Boot version in pom.xml
rg -A 5 "<parent>" jpa/multitenancy/multidatasource-multitenancy/pom.xml
# Check if there are any springdoc-openapi related issues in the codebase
rg -l "springdoc.*exception|openapi.*error"
# Check if there are any springdoc-openapi configuration properties
rg "springdoc\." -g "application*.{properties,yml,yaml}"
Length of output: 614 |
||
|
||
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory> | ||
<spotless.version>2.43.0</spotless.version> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.23.xsd"> | ||
https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.29.xsd"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Schema version inconsistency detected across changelog files The changelog files in the project use different schema versions ranging from 3.1.x to 4.29.x. This inconsistency should be addressed:
Since the project uses Spring Boot 3.4.0 which includes a recent version of Liquibase core, it's recommended to standardize all changelog files to use the same recent schema version (4.29) to maintain consistency and leverage newer features. 🔗 Analysis chainVerify Liquibase version compatibility The schema location has been updated to version 4.29. Let's ensure this matches the Liquibase dependency version in the project. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check Liquibase version in pom.xml
echo "Checking Liquibase version in pom.xml..."
rg -A 1 "liquibase.*version" pom.xml
# Check for other changelog files that might need similar updates
echo -e "\nChecking other changelog files that might need updates..."
fd changelog.*xml$ | xargs grep -l "dbchangelog-4"
Length of output: 603 Script: #!/bin/bash
# Let's check the content of other changelog files to see their schema versions
echo "Checking schema versions in changelog files..."
for file in $(fd 'changelog.*xml$'); do
echo -e "\n=== $file ==="
grep -A 1 "dbchangelog.*xsd" "$file"
done
# Let's also check the parent pom.xml and other pom files for Liquibase version
echo -e "\n=== Checking Liquibase version in all pom files ==="
fd pom.xml$ | xargs grep -A 1 "liquibase.*version"
Length of output: 3961 Script: #!/bin/bash
# Let's check the parent pom files for Liquibase version property
echo "Checking for Liquibase version property in pom files..."
fd pom.xml$ | xargs grep -B 2 -A 2 "<liquibase\.version>"
# Also check for Liquibase plugin version in the specific project
echo -e "\nChecking Liquibase plugin version in the multitenancy project..."
cat jpa/multitenancy/multidatasource-multitenancy/pom.xml
Length of output: 15980 |
||
|
||
<changeSet author="raja" id="createSequence-customers-sequence" runOnChange="true"> | ||
<preConditions onFail="MARK_RAN"> | ||
|
@@ -31,7 +31,7 @@ | |
<column name="text" type="varchar(1024)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
<column name="version" type="tinyint"/> | ||
<column name="version" type="tinyint" defaultValue="0"/> | ||
<column name="tenant" type="VARCHAR(255)"> | ||
<constraints nullable="false" primaryKey="true"/> | ||
</column> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.example.multitenancy; | ||
|
||
import com.example.multitenancy.common.ContainersConfiguration; | ||
import com.example.multitenancy.utils.AppConstants; | ||
import org.springframework.boot.SpringApplication; | ||
|
||
class MultiDataSourceMultiTenancyApplicationTest { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.from(MultiDataSourceMultiTenancyApplication::main) | ||
.with(ContainersConfiguration.class) | ||
.withAdditionalProfiles(AppConstants.PROFILE_TEST) | ||
.run(args); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Align test configuration with other test configurations in the file.
The test configuration is missing standard attributes and doesn't follow the naming pattern used by other test configurations.
Apply this diff to align with other test configurations:
📝 Committable suggestion