Repository navigation
fix(artifact): 修通 linux-x64 首装 → 自举 → 首页可用 - #42
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
在真实 linux-x64(QEMU 容器 + systemd)里跑
install-artifact.sh全段,验证「首装 → 自举 → 首页可用」。链路一开始跑不通,逐个暴露出 5 个真实缺陷——每一个都只在目标机暴露,构建机和单测都看不出来。修的 5 个 bug
linux-x64—RELEASE.json写的是契约名linux/amd64,导致每一份合法产物都装不上。改成case同时接受两种写法。/root启动 — 守护进程继承安装者的 cwd,之后 spawn 子进程全是spawn /usr/local/bin/node EACCES;进程表看起来建好了,实际一个都没起来。现在先cd "${RELEASE_DIR}"再pm2 start。targetVersion恒为unknown—resolveTargetVersion只向上找 1/2 层,RELEASE.json实际在dist/server.js上三层,runner 因此找不到迁移包。抽成apps/api/src/bootstrap/release-version.ts并加 5 例测试钉住层级。packages/{plugins,themes}— 内核把这两棵目录当「随内核发布的本地来源」。缺主题 → 首页 404;缺插件 → 市场plugins: []。构建脚本现在把它们打进产物(只带dist/、frontend/、assets/、package.json、theme.css|json),并把插件/主题的裸导入并入依赖闭包;一个内置插件都没找到时直接构建失败。<data>/plugins/,ESM 向上查找到不了版本目录的node_modules,全部Skipping invalid plugin: Cannot find package 'zod'。新增ensurePluginModuleResolution():在数据目录建<data>/node_modules -> <root>/current/node_modules符号链接(不复制,避免第二份 zod;指向current所以升级自动跟随)。附带修
collect-runtime-deps.mjs的copyPackage:跳过包内node_modules/.bin,否则 pnpm 的绝对路径链接解包后全部失效,还会把 typescript/vitest 拖进产物。复验证据(容器内,真实 systemd)
systemctl is-system-running=degraded(systemd 是 PID 1,可正常enable --now)sha256 47f23581…install-artifact.sh全段通过(含 systemd 单元enable --now+pm2 startup)POST /setup/provision真实预检(PG 版本/DDL、Redis 读写、S3 私有前缀读写删)→202queued → migrating → starting → needs_admin,migrationSucceeded=true、runtimeReady=trueactivated,default主题已播种,GET /= 200测试
apps/api/tests/unit/bootstrap-release-version.test.ts(5 例)apps/api/tests/unit/plugin-module-resolution.test.ts(3 例)tests/unit全量:887 passed。另有 3 个文件因并发跑 vitest 抢建同名测试库报pg_database_datname_index冲突,单独重跑 17/17 全过。已知边界(未在本 PR 处理)
catalog/cms/invoice三个包仍带 finder,需要先设计「声明式数据整形」层。scripts/build-frontend.mjs:276的 eslintno-useless-assignment是既有问题。max_memory_restart(512M)会因内存峰值反复重启 API,是模拟环境性能特征,已在文档标注。