Skip to content

fix(pack): SOLID — 过期 RP 清理 + assemble-rp --modules-json - #44

Merged
Tanya7z merged 1 commit into
mainfrom
cursor/bc-cba70ac6-bdd2-4cb5-85a9-044f249c12ab-9a20
Jul 23, 2026
Merged

fix(pack): SOLID — 过期 RP 清理 + assemble-rp --modules-json#44
Tanya7z merged 1 commit into
mainfrom
cursor/bc-cba70ac6-bdd2-4cb5-85a9-044f249c12ab-9a20

Conversation

@cursor

@cursor cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

审查 main@52eb1f7(module pack lifecycle + resource pack)合入后的 SOLID/正确性问题,直接提交补丁。

ootb CI 绿,但功能与架构债需修:

BLOCKER

  • deploy 不卸过期 RP/BP:模块不再提供 RP 或 UUID 轮换时,world_*_packs.json 仍保留旧条目,世界内 RP 目录也不删 → --clear-rp + disable-pack 清理

MAJOR

  • OCP/DRYbuildPacks 用临时目录镜像整树绕开 assemble-rp 只扫 --modules-dir → 新增 --modules-json 显式 map
  • DRY/DIPresolveBdsContext / readManifestHeader / worldPackListHas 重复 pack-manager 逻辑 → 委托 read-level / read-manifest / has-pack CLI
  • LSPenabledByDefault 缺省 false 与 db-server !== false 契约不一致 → 对齐

MINOR

  • 移除 writePermissionsJsonvoid copyDirAsync 死代码

Tests

bds-tools/pack-manager-lifecycle.test.mjs — modules-json / clear-rp / has-pack / read-manifest(6/6 pass)

Review principles

DRY · OCP · DIP · LSP · Law of Demeter

Test plan

  • npm run build -w @sfmc-bds/sdk -w @sfmc-bds/bds-tools -w @sfmc-bds/cli
  • npm test -w @sfmc-bds/bds-tools
  • 有 BDS 环境时:装载含 RP 模块 → 禁用全部 RP 模块 → sfmc pack deploy → 确认 world_resource_packs.json 无旧 uuid 且 resource_packs/sfmc-modules-rp 已删
Open in Web View Automation 

审查 main@52eb1f7 pack-lifecycle 合入后的问题并直接补丁:

- BLOCKER: deploy 时 disable 过期 BP/RP 清单项,并以 --clear-rp 删除世界内残留 RP 目录
- MAJOR OCP/DRY: assemble-rp 支持 --modules-json 显式 map,去掉 sfmc 侧整树临时镜像
- MAJOR DRY/DIP: level/manifest/has-pack 委托 pack-manager CLI(单一权威)
- MAJOR LSP: enabledByDefault 与 db-server 对齐(!== false)
- MINOR: 移除 writePermissionsJson 中死代码 void copyDirAsync
- 回归测试: pack-manager-lifecycle.test.mjs (modules-json / clear-rp / has-pack)

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
@Tanya7z
Tanya7z marked this pull request as ready for review July 23, 2026 07:21
@Tanya7z
Tanya7z merged commit 5eff389 into main Jul 23, 2026
1 check passed
@Tanya7z

Tanya7z commented Jul 23, 2026

Copy link
Copy Markdown
Member

thanks

@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants