feat(zookeeper): replace Java agent with native Go implementation

This commit is contained in:
t8y2
2026-08-14 13:34:20 +08:00
parent 2d47c94992
commit 56fde5b20b
26 changed files with 2306 additions and 1928 deletions
+6 -1
View File
@@ -59,15 +59,20 @@ const nativeDriverDirectories = {
vastbase: "vastbase-go",
rabbitmq: "rabbitmq",
rocketmq: "rocketmq",
zookeeper: "zookeeper",
tdengine: "tdengine",
};
const nativeDriverModules = new Set(["cassandra", "duckdb", "hive", "oracle", "xugu", "kingbase", "iotdb", "neo4j", "vastbase", "rabbitmq", "rocketmq", "tdengine"]);
const nativeDriverModules = new Set(["cassandra", "duckdb", "hive", "oracle", "xugu", "kingbase", "iotdb", "neo4j", "vastbase", "rabbitmq", "rocketmq", "zookeeper", "tdengine"]);
const nativeDriverSharedPaths = {
hive: [
"agents/go-common/go-gssapi",
"agents/go-common/gohive",
"agents/go-common/gosasl",
],
zookeeper: [
"agents/go-common/go-gssapi",
"agents/go-common/gosasl",
],
};
function resolveAgentModule(moduleName, { legacyStandaloneModules, moduleExists, readModuleFile }) {
@@ -71,6 +71,25 @@ test("bumps the native RocketMQ agent from its Go directory", () => {
assert.deepEqual(result.nativeModules, ["rocketmq"]);
});
test("bumps ZooKeeper from native and shared SASL source directories", () => {
for (const changedFile of [
"agents/drivers/zookeeper/main.go",
"agents/go-common/gosasl/sasl.go",
"agents/go-common/go-gssapi/krb5/krb5.go",
]) {
const result = evaluateAgentVersionBump({
versions: { zookeeper: "0.1.0" },
changedFiles: [changedFile],
moduleExists: (path) => path === "agents/drivers/zookeeper",
readModuleFile: () => "",
});
assert.equal(result.versions.zookeeper, "0.1.1");
assert.deepEqual(result.javaModules, []);
assert.deepEqual(result.nativeModules, ["zookeeper"]);
}
});
test("bumps the native Vastbase agent from its independent Go directory", () => {
const result = evaluateAgentVersionBump({
versions: { vastbase: "0.1.37" },
@@ -15,7 +15,7 @@ import { basename, join } from "node:path";
import { tmpdir } from "node:os";
const REGISTRY_ASSET = "agent-registry.json";
const NATIVE_MODULES = new Set(["duckdb", "oracle", "xugu", "kingbase", "iotdb", "neo4j", "vastbase", "rabbitmq", "rocketmq", "tdengine"]);
const NATIVE_MODULES = new Set(["duckdb", "oracle", "xugu", "kingbase", "iotdb", "neo4j", "vastbase", "rabbitmq", "rocketmq", "zookeeper", "tdengine"]);
const PLATFORMS = [
"macos-aarch64",
"macos-x64",