fix(ci): 修复 ootb workflow 连续失败——check-catalog ESM 语法、db-server 入口路径、缺失 configs#10
Closed
cursor[bot] wants to merge 1 commit into
Closed
fix(ci): 修复 ootb workflow 连续失败——check-catalog ESM 语法、db-server 入口路径、缺失 configs#10cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…失 configs - tools/check-catalog.js: 改回 CommonJS require(仓库根 package.json 未 声明 type:module,ESM import 语法在固定 Node 22.5.x 的 CI 上直接抛 SyntaxError) - tools/check-ootb.js、tools/sim-new-user.js、tools/test-db-api.js: spawn 的 db-server 入口从不存在的 db-server/index.js 改为构建产物 db-server/dist/index.js(导致 db-server 不可达 / sim-new-user 超时) - configs-default/db_config.json: modulesDir 从 "../modules"(相对 PROJECT_ROOT 解析到仓库外)改为 "modules" - .github/workflows/ootb.yml: build 之后新增 Seed configs/ 步骤,从 configs-default/ 拷贝缺失的 json(configs/ 被 gitignore,CI checkout 后为空) - .gitignore: 补充 qq-bridge/dist/、sfmc/dist/(build 产物,此前未忽略) 本地验证: npm install && npm run build --workspaces --if-present 后 node tools/check-ootb.js 从 2 PASS / 4 FAIL 变为 6 PASS / 0 FAIL。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
This was referenced Jul 21, 2026
Member
|
Superseded by #12. |
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.
背景
本次 automation 由
main分支 push(feat(tps): v2 migration,commit8d11fa9)触发的ootbworkflow 失败事件唤起。审查最近多次ootbworkflow 运行日志(gh run view --log-failed),发现从 2/6 项检查通过、4 项失败,根因均可在仓库现有代码/配置中定位,与AGENTS.md记录的已知 gotcha 一致。根因与修复
tools/check-catalog.js用 ESMimport语法,仓库为 CJS — 根package.json未声明"type": "module",CI 固定 Node 22.5.x 上直接SyntaxError: Cannot use import statement outside a module。改回和其余tools/*.js一致的require()写法。db-server入口路径写错 —tools/check-ootb.js、tools/sim-new-user.js、tools/test-db-api.js都spawn了不存在的db-server/index.js;真正的构建产物是db-server/dist/index.js(见db-server/package.json的main)。旧路径导致 spawn 静默失败,db-server 不可达与sim-new-user超时。三处均已改为db-server/dist/index.js。configs-default/db_config.json的modulesDir: "../modules"— 该值相对PROJECT_ROOT(=SFMC_ROOT) 解析,会跳出仓库根目录导致模块 API 返回空 catalog;改为"modules"。tools/test-db-api.js里内联的同名配置也同步修正。configs/从未被填充 —configs/被.gitignore,CI checkout 后为空,导致check-ootb第一项「必备仓库文件齐全」缺失configs/db_config.json等三个文件。在Build all workspaces之后新增一步,从configs-default/拷贝缺失的 json 文件。.gitignore补充qq-bridge/dist/、sfmc/dist/— 这两个 workspace 的构建产物之前未被忽略。验证
本地执行:
修复前:
[ootb] 通过 2 / 失败 4(必备仓库文件齐全 / check-catalog / db-server 启动 / sim-new-user 全部失败)。修复后:
[ootb] 通过 6 / 失败 0。未改动任何既有正确功能逻辑,仅修正 CI/工具脚本中的路径与语法错误。
备注
仓库里已有若干个近期由同一 automation 针对相同根因开出的草稿 PR(#5、#6、#7、#8、#9),说明该 CI 失败在
main上尚未被合并修复,每次新 push 都会重新触发失败。建议合并其中一个后关闭其余重复 PR。