bos upgrade re-clobbers child-restored root package.json scripts — default test script also silently exits 1 on repos without plugins/
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- github, typescript
- 领域
- build-system, tooling
调研方向
Start by tracing the bos upgrade reconciliation source that writes the root package.json scripts, then compare its test and typecheck loops and the v2.0.0-rc.27 template. Reproduce with a child repo that has no plugins/ directory and custom packages/* scripts. Done means upgrades preserve or clearly report child edits, and the default test script succeeds without plugins while retaining package coverage.
由索引模型根据 Issue 内容生成。
描述
bos upgrade resets child-restored root package.json scripts — and its reconcile source's default test script silently exits 1 on repos without plugins/
Child evidence (activity.nearbuilders.org, v2.0.0-rc.27)
Two separate defects, both observed on the managed v1→v2 upgrade branch (#82, merged as NEARBuilders/activity.nearbuilders.org#82 / #89):
1. Upgrade reconcile overwrites child customizations in root scripts
C1 restored packages/* coverage in the root scripts (the child publishes @nearbuilders/activity-client from packages/client):
test: … pnpm --dir ui … run test && for dir in packages/*; do if [ -f "$dir/package.json" ]; then pnpm --dir "$dir" --if-present run test || exit 1; fi; done
typecheck: … pnpm --dir ui … && pnpm --dir api … && for dir in packages/*; do if [ -f "$dir/package.json" ]; then pnpm --dir "$dir" --if-present run typecheck || exit 1; fi; done
A later bos upgrade (rc.24 → rc.27, commit ac3ff53) reset both scripts to the framework reconcile versions:
test: … && for d in plugins/*; do [ -f "$d/package.json" ] && pnpm --dir "$d" --if-present run test; done
typecheck: … if [ -d plugins ]; then for dir in plugins/*; do …; fi; fi
packages/*coverage was silently dropped from both the test and typecheck gates.- The
testreset made CI go red: the repo has noplugins/directory, the glob stays literal,[ -f "plugins/*/package.json" ]returns false → the unguarded&&chain is the last command → the script exits 1 with zero output (theTestjob failed 56 ms after the UI suite passed, no failing test to find).
.bos/sync-backup/2026-10-29T04-17-…/package.json did capture the pre-upgrade copy (good), but nothing surfaced that the child's customizations were being reset — the red CI was how we found out. The child re-restored the scripts in NEARBuilders/activity.nearbuilders.org#89's parent commit (909c2b2) and this has now happened twice in the same migration (restored, re-clobbered, re-restored).
2. The reconcile source's default test script fails for plugin-less children
The reset version differs from the upstream template (v2.0.0-rc.27 template root test is pnpm run test:ui && test:api && test:e2e && test:framework), so the plugins/* loop comes from the upgrade's reconcile source — and it has a robustness bug the typecheck sibling doesn't share: typecheck guards with if [ -d plugins ], the test loop is unguarded. Any child without plugins/ would get a silently red test script from the framework's own machinery.
Expected behavior
bos upgradereconciliation should patch rather than reset child-modified sections of files it reconciles (or, minimally, report exactly which child customizations were dropped, not just create a.bos/sync-backupcopy). Related but distinct: #650 (v1→v1 one-shot drops) and #659 (stale overrides shadowing the catalog — that one's the same upgrade run pointing the #546 skew gate at the wrong fix).- The framework's default root
testscript should be exit-0-safe for repos withoutplugins/(same guard astypecheck), and ideally include apackages/*loop (or generate one from workspace globs) so published children keep their test/typecheck coverage after upgrades.
Repro
- Child repo: everything-dev v2 app, restore
packages/*loops in roottest/typecheck(or any repo with noplugins/dir). - Run
bos upgradeto a newer rc. - Root scripts are reset to the
plugins/*variants;pnpm run testnow exits 1 silently after the ui suite finishes (see NEARBuilders/activity.nearbuilders.org CI run 40817136914,CI / Test: api 155 ✓, ui 109 ✓, thenELIFECYCLE Test failed).
Child fix commits for reference: 909c2b2 (re-restore) and 96c3be5/44b40a5 (#89, overrides realignment also surfaced by the same upgrade run).
- 主要语言
- TypeScript
- 星标
- 5
- 派生
- 3
- 平均合并
- 9 小时 16 分钟
- 30 天内合并 PR
- 160
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NEARBuilders/everything-dev 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
NEARBuilders/everything-dev#686 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
NEARBuilders/everything-dev#678 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
NEARBuilders/everything-dev#628 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
NEARBuilders/everything-dev#400 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 15/100
NEARBuilders/everything-dev#685 ·
维护者通常 1 天内回复
查看 NEARBuilders/everything-dev 的全部 Issue
相似的 Issue
-
triage
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
🎙️ task - drop the raw `./node_modules/.bin/rhachet roles boot` line from bhuild's feedback template未关闭
难度 2/5 1-3 小时 新手友好度 62/100
ehmpathy/rhachet-roles-bhuild#639 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 70/100
redhat-developer/rhdh-plugin-export-overlays#4650 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 13 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
omdsh-dev/DSH-better-sidebar#1098 ·
维护者通常 2 天内回复