升级 SpacetimeDB 到 2.4.1
更新 server-rs SpacetimeDB crate 锁定版本与 Cargo.lock。 刷新 spacetime-client 生成绑定到 2.4.1。 同步 dev 脚本、容器、Jenkins 和运维文档中的 STDB 版本。 补充 dev 脚本版本校验测试,兼容 Cargo 精确版本要求。
This commit is contained in:
@@ -408,7 +408,11 @@ function readWorkspaceSpacetimeVersion() {
|
||||
if (!version) {
|
||||
throw new Error('无法从 server-rs/Cargo.toml 读取 spacetimedb 版本');
|
||||
}
|
||||
return version;
|
||||
return normalizeCargoVersionRequirement(version);
|
||||
}
|
||||
|
||||
function normalizeCargoVersionRequirement(version) {
|
||||
return version.replace(/^=/u, '');
|
||||
}
|
||||
|
||||
function parseSpacetimeToolVersion(output) {
|
||||
@@ -2130,6 +2134,7 @@ export {
|
||||
createWatchConfigs,
|
||||
isSpacetimePublishPermissionError,
|
||||
isDirectModuleExecution,
|
||||
normalizeCargoVersionRequirement,
|
||||
parseSpacetimeToolVersion,
|
||||
parseArgs,
|
||||
resolveDevStackStatePath,
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
createWatchConfigs,
|
||||
isDirectModuleExecution,
|
||||
isSpacetimePublishPermissionError,
|
||||
normalizeCargoVersionRequirement,
|
||||
parseSpacetimeToolVersion,
|
||||
parseArgs,
|
||||
resolveDevStackStatePath,
|
||||
@@ -34,7 +35,7 @@ function workspaceSpacetimeVersionForTest() {
|
||||
if (!match) {
|
||||
throw new Error('无法读取测试用 SpacetimeDB 版本');
|
||||
}
|
||||
return match[1];
|
||||
return normalizeCargoVersionRequirement(match[1]);
|
||||
}
|
||||
|
||||
describe('dev scheduler argument routing', () => {
|
||||
@@ -402,20 +403,25 @@ describe('dev scheduler watch routing', () => {
|
||||
});
|
||||
|
||||
describe('dev scheduler spacetime refresh', () => {
|
||||
test('解析 Cargo 精确版本要求时用于 CLI 校验的版本号不带等号', () => {
|
||||
expect(normalizeCargoVersionRequirement('=2.4.1')).toBe('2.4.1');
|
||||
expect(normalizeCargoVersionRequirement('2.4.1')).toBe('2.4.1');
|
||||
});
|
||||
|
||||
test('解析 spacetime --version 输出里的 tool version', () => {
|
||||
const version = parseSpacetimeToolVersion(`
|
||||
A new version of SpacetimeDB is available: v2.3.0 (current: v2.2.0)
|
||||
spacetimedb tool version 2.3.0; spacetimedb-lib version 2.3.0;
|
||||
A new version of SpacetimeDB is available: v2.4.1 (current: v2.4.0)
|
||||
spacetimedb tool version 2.4.1; spacetimedb-lib version 2.4.1;
|
||||
`);
|
||||
|
||||
expect(version).toBe('2.3.0');
|
||||
expect(version).toBe('2.4.1');
|
||||
});
|
||||
|
||||
test('本机 spacetime 版本和 workspace 锁定版本不一致时直接报清楚', () => {
|
||||
expect(() =>
|
||||
assertSpacetimeToolVersionMatchesWorkspace({
|
||||
toolVersion: '2.1.0',
|
||||
workspaceVersion: '2.3.0',
|
||||
workspaceVersion: '2.4.1',
|
||||
}),
|
||||
).toThrow('procedure 返回值 BSATN 反序列化失败');
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ PREPARE_OTELCOL="${PREPARE_OTELCOL:-${ENABLE_OTELCOL:-true}}"
|
||||
OTELCOL_DOWNLOAD_ROOT="${OTELCOL_DOWNLOAD_ROOT:-https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download}"
|
||||
OTELCOL_ARCHIVE_PATH="${OTELCOL_ARCHIVE_PATH:-}"
|
||||
SPACETIME_INSTALLER_URL="${SPACETIME_INSTALLER_URL:-https://install.spacetimedb.com}"
|
||||
SPACETIME_DOWNLOAD_ROOT="${SPACETIME_DOWNLOAD_ROOT:-https://github.com/clockworklabs/SpacetimeDB/releases/latest/download}"
|
||||
SPACETIME_DOWNLOAD_ROOT="${SPACETIME_DOWNLOAD_ROOT:-https://github.com/clockworklabs/SpacetimeDB/releases/download/v2.4.1}"
|
||||
SPACETIME_TARGET_HOST="${SPACETIME_TARGET_HOST:-x86_64-unknown-linux-gnu}"
|
||||
SPACETIME_ARCHIVE_PATH="${SPACETIME_ARCHIVE_PATH:-}"
|
||||
SPACETIME_INSTALLER_PATH="${SPACETIME_INSTALLER_PATH:-}"
|
||||
|
||||
Reference in New Issue
Block a user