Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ jobs:
- name: Package Java engine
working-directory: java
run: ./mvnw -B -DskipTests package
- name: Prepare verified DM JDBC driver pack
run: ./scripts/prepare-dm-driver-pack.sh
- name: Verify managed DM driver loading
env:
CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar"
DM_TEST_DRIVER_PACK_DIR: "${{ github.workspace }}/target/driver-packs"
run: >-
cargo test -p chat2db-core --features java-integration
--test java_dm_driver_pack --locked
- name: Verify Rust-owned DM SPI without Community
env:
CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar"
DM_TEST_DRIVER_PACK_DIR: "${{ github.workspace }}/target/driver-packs"
run: >-
cargo test -p chat2db-core --features java-integration
--test java_dm_product --locked
- name: Verify Rust-Java process protocol
env:
CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar"
Expand Down Expand Up @@ -351,7 +367,7 @@ jobs:
env:
CHAT2DB_JAVA_ENGINE_JAR: "${{ github.workspace }}/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar"
CHAT2DB_COMMUNITY_CLASSPATH_DIR: "${{ github.workspace }}/target/community-h2-classpath"
MYSQL_TEST_DRIVER_PACK_DIR: "${{ github.workspace }}/target/mysql-driver-packs"
MYSQL_TEST_DRIVER_PACK_DIR: "${{ github.workspace }}/target/driver-packs"
MYSQL_TEST_HOST: 127.0.0.1
MYSQL_TEST_PORT: "3306"
MYSQL_TEST_USER: root
Expand Down
34 changes: 26 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
.PHONY: verify rust rust-process-tests java ipc-integration jdbc-h2-integration \
community-h2-classpath community-h2-reproducibility community-java-h2-integration \
community-h2-integration \
community-product-h2-integration product-h2-integration mysql-driver-pack h2-driver-pack \
community-product-h2-integration product-h2-integration mysql-driver-pack h2-driver-pack dm-driver-pack \
dm-driver-pack-integration dm-product-integration \
native-mysql-integration native-mysql-direct-integration native-mysql-ssh-integration \
community-product-mysql-integration \
frontend-deps frontend-source frontend desktop generate-contracts check-contracts \
macos-runtime macos-package-java macos-package macos-package-verify
macos-runtime macos-driver-packs macos-package-java macos-package macos-package-verify

JAVA_ENGINE_JAR := $(CURDIR)/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar
H2_DRIVER_JAR := $(CURDIR)/java/compat-runtime/target/test-drivers/h2-2.3.232.jar
COMMUNITY_CLASSPATH_DIR := $(CURDIR)/target/community-h2-classpath
MYSQL_DRIVER_PACK_DIR := $(CURDIR)/target/mysql-driver-packs
DRIVER_PACK_DIR := $(CURDIR)/target/driver-packs
MYSQL_TEST_HOST ?= 127.0.0.1
MYSQL_TEST_PORT ?= 3306
MYSQL_TEST_JDBC_PARAMETERS ?= sslMode=DISABLED&allowPublicKeyRetrieval=true&serverTimezone=UTC&zeroDateTimeBehavior=CONVERT_TO_NULL&tinyInt1isBit=false

verify: rust rust-process-tests java ipc-integration jdbc-h2-integration \
community-java-h2-integration community-h2-integration \
community-product-h2-integration product-h2-integration frontend desktop
community-product-h2-integration product-h2-integration \
dm-driver-pack-integration dm-product-integration frontend desktop

rust:
cargo fmt --all --check
Expand Down Expand Up @@ -60,10 +62,23 @@ product-h2-integration: java
CHAT2DB_JAVA_ENGINE_JAR="$(JAVA_ENGINE_JAR)" CHAT2DB_H2_DRIVER_JAR="$(H2_DRIVER_JAR)" cargo test -p chat2db-core --features java-integration --test java_h2_product --locked

mysql-driver-pack:
./scripts/prepare-mysql-driver-pack.sh "$(MYSQL_DRIVER_PACK_DIR)"
./scripts/prepare-mysql-driver-pack.sh "$(DRIVER_PACK_DIR)"

h2-driver-pack:
./scripts/prepare-h2-driver-pack.sh "$(MYSQL_DRIVER_PACK_DIR)"
./scripts/prepare-h2-driver-pack.sh "$(DRIVER_PACK_DIR)"

dm-driver-pack:
./scripts/prepare-dm-driver-pack.sh "$(DRIVER_PACK_DIR)"

dm-driver-pack-integration: java dm-driver-pack
CHAT2DB_JAVA_ENGINE_JAR="$(JAVA_ENGINE_JAR)" \
DM_TEST_DRIVER_PACK_DIR="$(DRIVER_PACK_DIR)" \
cargo test -p chat2db-core --features java-integration --test java_dm_driver_pack --locked

dm-product-integration: java dm-driver-pack
CHAT2DB_JAVA_ENGINE_JAR="$(JAVA_ENGINE_JAR)" \
DM_TEST_DRIVER_PACK_DIR="$(DRIVER_PACK_DIR)" \
cargo test -p chat2db-core --features java-integration --test java_dm_product --locked

native-mysql-integration: native-mysql-direct-integration native-mysql-ssh-integration

Expand Down Expand Up @@ -151,7 +166,7 @@ community-product-mysql-integration: java community-h2-classpath mysql-driver-pa
@test -n "$(MYSQL_TEST_PASSWORD)" || (echo "MYSQL_TEST_PASSWORD is required" >&2; exit 1)
@CHAT2DB_JAVA_ENGINE_JAR="$(JAVA_ENGINE_JAR)" \
CHAT2DB_COMMUNITY_CLASSPATH_DIR="$(COMMUNITY_CLASSPATH_DIR)" \
MYSQL_TEST_DRIVER_PACK_DIR="$(MYSQL_DRIVER_PACK_DIR)" \
MYSQL_TEST_DRIVER_PACK_DIR="$(DRIVER_PACK_DIR)" \
MYSQL_TEST_HOST="$(MYSQL_TEST_HOST)" \
MYSQL_TEST_PORT="$(MYSQL_TEST_PORT)" \
MYSQL_TEST_USER="$(MYSQL_TEST_USER)" \
Expand Down Expand Up @@ -182,10 +197,13 @@ desktop: frontend
macos-runtime:
./scripts/build-macos-runtime.sh

macos-driver-packs:
./scripts/prepare-macos-driver-packs.sh

macos-package-java: community-h2-classpath
$(MAKE) java

macos-package: macos-package-java mysql-driver-pack h2-driver-pack frontend macos-runtime
macos-package: macos-package-java macos-driver-packs frontend macos-runtime
./scripts/build-macos-package.sh

macos-package-verify:
Expand Down
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,40 @@ Connector/J is downloaded from Maven Central only after its pinned byte length
and SHA-256 are verified; it remains an external driver pack and is never
embedded in the Java engine.

Prepare and verify the pinned DM JDBC driver pack without requiring a running
DM server:

```bash
make dm-driver-pack-integration
```

The gate starts the project-owned Java 17 JDBC engine and loads only
`dm.jdbc.driver.DmDriver` from the managed pack. DM capability routing,
metadata SQL, validation, result mapping, and bounded table-preview SQL belong
to the Rust `DmDriver` registered in the unified native-driver SPI. The Java
engine is only the generic JDBC transport for the official vendor JAR; it does
not load or invoke the Chat2DB Community DM or Oracle plugins.

A separate product gate proves that the Rust-owned DM SPI works without any
Community classpath or Community database plugin configured:

```bash
make dm-product-integration
```

A live product path is also exercised by this target when `DM_TEST_HOST`, `DM_TEST_PORT`,
`DM_TEST_USER`, and `DM_TEST_PASSWORD` are all set; use `DM_TEST_REQUIRED=1` to
make their absence an error. `DM_TEST_JDBC_URL` can override the default
`jdbc:dm://<host>:<port>` URL. The live test covers connection, database,
schema, table, and column discovery, bounded preview/query execution, and
fixture cleanup. Without an endpoint, the gate still verifies the Driver Pack
and Rust SPI identity without loading a Community classpath.

The public macOS package does not bundle the proprietary DM JDBC JAR because
the JAR contains no verifiable redistribution grant. For local testing, prepare
the pinned pack explicitly and point Web or Desktop at it with
`CHAT2DB_DRIVER_PACK_DIR`.

Those targets require a clean submodule at the fixed commit, build through the
checked-in Maven Wrapper and a repository-local Maven cache, derive archive
timestamps from the commit, exclude the H2 JDBC driver, and deterministically
Expand All @@ -302,7 +336,7 @@ enabled:
make java community-h2-classpath mysql-driver-pack frontend
CHAT2DB_JAVA_ENGINE_JAR="$PWD/java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar" \
CHAT2DB_COMMUNITY_CLASSPATH_DIR="$PWD/target/community-h2-classpath" \
CHAT2DB_DRIVER_PACK_DIR="$PWD/target/mysql-driver-packs" \
CHAT2DB_DRIVER_PACK_DIR="$PWD/target/driver-packs" \
CHAT2DB_VAULT_MASTER_KEY="$(openssl rand -base64 32)" \
cargo run -p chat2db-web
```
Expand Down
2 changes: 1 addition & 1 deletion apps/chat2db-desktop/tauri.package.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"../../target/macos-runtime": "chat2db/java",
"../../java/compat-runtime/target/chat2db-compat-runtime-0.1.0-SNAPSHOT.jar": "chat2db/engine/chat2db-compat-runtime.jar",
"../../target/community-h2-classpath": "chat2db/community-classpath",
"../../target/mysql-driver-packs": "chat2db/driver-packs",
"../../target/macos-driver-packs": "chat2db/driver-packs",
"../../LICENSE": "chat2db/licenses/Chat2DB-Rust-LICENSE.txt",
"../../third_party/chat2db-community/LICENSE": "chat2db/licenses/Chat2DB-Community-LICENSE.txt",
"../../packaging/macos/THIRD_PARTY_NOTICES.md": "chat2db/licenses/THIRD_PARTY_NOTICES.md"
Expand Down
10 changes: 10 additions & 0 deletions crates/chat2db-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ name = "java_community_mysql_product"
path = "tests/java_community_mysql_product.rs"
required-features = ["java-integration"]

[[test]]
name = "java_dm_driver_pack"
path = "tests/java_dm_driver_pack.rs"
required-features = ["java-integration"]

[[test]]
name = "java_dm_product"
path = "tests/java_dm_product.rs"
required-features = ["java-integration"]

[features]
default = []
java-integration = []
Expand Down
Loading
Loading