feat: 拉通 Workbench 纯 Kafka 实时链路

This commit is contained in:
root
2026-07-10 10:22:28 +02:00
parent d5230cb923
commit 8ad5976a07
59 changed files with 4700 additions and 498 deletions
+15 -4
View File
@@ -9,11 +9,13 @@ import {
parseArgs
} from "./dev-runtime-migration.mjs";
import {
CLOUD_CORE_MIGRATION_ID,
CLOUD_CORE_MIGRATIONS,
CLOUD_RUNTIME_DURABLE_MIGRATION_ID,
CLOUD_RUNTIME_DURABLE_ADAPTER_SCHEMA_VERSION,
CLOUD_RUNTIME_DURABLE_ADAPTER_SCHEMA_VERSION as CLOUD_CORE_SCHEMA_VERSION,
CLOUD_TRANSACTIONAL_REALTIME_MIGRATION_ID as CLOUD_RUNTIME_DURABLE_MIGRATION_ID,
CLOUD_TRANSACTIONAL_REALTIME_SCHEMA_VERSION as CLOUD_RUNTIME_DURABLE_ADAPTER_SCHEMA_VERSION,
CLOUD_RUNTIME_DURABLE_MIGRATION_TABLE,
CLOUD_RUNTIME_DURABLE_TABLE_COLUMNS
CLOUD_TRANSACTIONAL_REALTIME_REQUIRED_TABLE_COLUMNS as CLOUD_RUNTIME_DURABLE_TABLE_COLUMNS
} from "../../internal/db/schema.ts";
const execFileAsync = promisify(execFile);
@@ -124,6 +126,7 @@ test("live dry-run separates migration ledger blocker from auth and schema", asy
assert.equal(report.gates.readiness.status, "not_checked");
assert.equal(report.blockers[0].scope, "runtime-migration-ledger");
assert.equal(report.runtime.migration.missing, true);
assert.equal(report.runtime.migration.requiredMigrationId, CLOUD_RUNTIME_DURABLE_MIGRATION_ID);
});
test("live dry-run separates SSL negotiation blocker from auth and schema", async () => {
@@ -312,6 +315,8 @@ test("apply mode records ledger and verifies durable runtime readiness", async (
assert.equal(report.gates.readiness.status, "ready");
assert.equal(report.runtime.migration.appliedMigrationId, CLOUD_RUNTIME_DURABLE_MIGRATION_ID);
assert.equal(report.runtime.migration.appliedSchemaVersion, CLOUD_RUNTIME_DURABLE_ADAPTER_SCHEMA_VERSION);
assert.ok(queryClient.calls.some((call) => call.params[0] === CLOUD_CORE_MIGRATION_ID));
assert.ok(queryClient.calls.some((call) => call.params[0] === CLOUD_RUNTIME_DURABLE_MIGRATION_ID));
assert.deepEqual(report.applyBoundary.writeScope, [
...CLOUD_CORE_MIGRATIONS.map((migration) => `DEV Postgres schema objects declared by ${migration.path}`),
...CLOUD_CORE_MIGRATIONS.map((migration) => `DEV ${CLOUD_RUNTIME_DURABLE_MIGRATION_TABLE} ledger row ${migration.id}`)
@@ -455,8 +460,14 @@ function createFakeQueryClient({ migrationReady, countErrorCode = null, migratio
return { rows: schemaRows() };
}
if (sql.startsWith("SELECT id, schema_version FROM hwlab_schema_migrations")) {
const requestedMigrationId = params[0];
if (requestedMigrationId === CLOUD_CORE_MIGRATION_ID) {
return {
rows: [{ id: CLOUD_CORE_MIGRATION_ID, schema_version: CLOUD_CORE_SCHEMA_VERSION }]
};
}
return {
rows: state.migrationReady
rows: requestedMigrationId === CLOUD_RUNTIME_DURABLE_MIGRATION_ID && state.migrationReady
? [
{
id: CLOUD_RUNTIME_DURABLE_MIGRATION_ID,