fix(config): DRY ensure API + 加固 schema 播种 ootb - #69
Merged
Tanya7z merged 1 commit intoJul 24, 2026
Conversation
- SDK 抽出 ensureSchemaConfig/loadEnsuredConfig/ensureCoreConfigs,消除各服务重复 withConfigSchema+ensure - 修正 PermissionsConfig 为数组根(与 schema LSP 一致);简化 configSchemaRef 死分支 - bds/qq/db/sfmc 改走共享 helper;remote 加载剥离 $schema - 新增 tools/seed-configs.mjs,ootb 不再拉起 db-server 仅为写 JSON;check-ootb 缺配置改为 fail Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
审查报告(main@fdc936e schema 推送 → 本补丁)
CI ootb 已通过;以下为 SOLID 维度可验证问题,已在本 PR 落地修复。
MAJOR
-
DRY — 各服务重复
ensureJsonConfig+withConfigSchema({...DEFAULT})
→ SDKensureSchemaConfig/loadEnsuredConfig/ensureCoreConfigs -
DRY —
bds-tools手动删 meta 后再stripConfigMeta
→ 统一loadEnsuredConfig -
LSP —
PermissionsConfig对象形态 vs schema/磁盘数组根
→ 类型改为数组 -
LSP —
remote/loadConfig渗入$schema
→ 加载路径剥离元数据 -
DIP — ootb 为写 JSON 拉起完整 db-server(失败仅 WARN)
→tools/seed-configs.mjs直接调 SDK ensure -
检查空洞 —
check-ootb缺 configs 仍 pass
→ seed 后缺核心文件改为 fail
MINOR
- OCP —
configSchemaRef三分支同值 → 已简化 - 未改:
pack-updateDEFAULTS 仍在 sfmc(扩 scope 风险)
验证
check-ootb 14/0;相关 workspace typecheck 通过。
Sent by Cursor Automation: SFMC-Review
Tanya7z
marked this pull request as ready for review
July 24, 2026 13:21
Contributor
Author
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.


背景
main@
fdc936e(chore:新增并补齐配置文件schema)将configs-default改为 SDK DEFAULT +$schema。方向正确,但引入了可验证的 SOLID 债,且 ootb 对缺失 configs 变成「缺了也 pass」。审查结论(针对 fdc936e)
ensureJsonConfig+withConfigSchema({...DEFAULT})bds-tools先手动 delete meta 再stripConfigMetaPermissionsConfig写成对象,schema/磁盘实为数组根remote/loadConfig把$schema渗入业务配置check-ootb缺 configs 仍pass(检查被掏空)configSchemaRef三分支同值死代码CI:
ootb@fdc936e 已 success;本 PR 加固播种路径,避免回归。本 PR 修复
ensureSchemaConfig/loadEnsuredConfig/ensureCoreConfigs;修正PermissionsConfig;简化configSchemaReftools/seed-configs.mjs+ ootb.yml 不再为写 JSON 启 HTTPcheck-ootb:seed 后缺核心配置改为 fail验证
npm run typecheck(sdk / db-server / bds-tools / qq-bridge / cli)SFMC_ROOT=... node tools/seed-configs.mjsnpm run check-ootb→ 14/0剩余债(未改,避免扩 scope)
pack-updateDEFAULTS 仍在 sfmc,未进 SDK registry