Repository navigation
ci: 加宿主版本兼容腿,把 peer 声明的 0.1.x 两段真跑一遍 - #348
Conversation
peerDependencies 声明覆盖三段(0.1.0-rc.6+ / 0.1.5-rc.0+ / 0.2.0-rc.0+),但 CI 只用 lockfile 里那一版(当前 0.2 线)——「声明支持却从没人验证」正是 #344 的由来。 新增 test-host-legacy,把 0.1.0-rc.8 与 0.1.7-rc.2 各跑一遍全量测试。 为什么另开作业、而不是给 test 加一个 matrix 维度:test 的四个作业名 (test (os, node))是分支保护的 required status checks,加维度会让名字变成 test (os, node, host)、原名消失 → 所有 PR 立刻卡死无法合并。另开作业完全不碰那 四个必需检查;若要让这条腿也阻断合并,去 Settings → Branches 把 test-host-legacy (*) 加进 required 即可。 实现要点: - 换掉四个宿主 devDeps 后必须删掉 lockfile 重新解析:带着 0.2 的锁降级会被 peer 链拦死(dsh-tools 的 peer 要求同版本的 dsh-agent,而锁里是 0.2.x)。因此这条腿 的树是全新解析的,它只回答宿主 API 面是否兼容;依赖版本一致性仍由 test 腿的 npm ci 负责。 - 解析与安装分成两步(先 --package-lock-only 再 npm ci):解析失败与下载失败能 区分开,且安装结果严格等于解析出的锁。 - 新增断言步骤:目标版本没真正装上就响亮失败,避免出现「其实测的是别的版本」的 假绿。 - 全新解析会把运行时闭包也换成当前最新,而 runtime-manifest.json 由 lockfile 生成 → 先重建清单再跑测试,否则那条「清单与 lockfile 一致」的用例必红,且与 本腿要问的问题无关。 - 只跑 ubuntu + node 24 单分片:这条腿问的是宿主 API 面,与 OS / Node 无关(那些 由 test 腿的四个分片覆盖),单分片足够且最省。 - 顺带同步 AGENTS.md 闸门清单里对 CI 矩阵的描述。
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 33 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Repository: slow-stack/mneme/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: slow-stack/mneme/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughCI 新增 Changes宿主兼容性测试
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Merge Risk: ⚪ Minimal · up to 此次变更新增旧版宿主兼容性测试,不改变现有必需检查或运行时行为。未发现需要阻止合并的具体问题;正常 CI 检查通过后可合并。 Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The compatibility tests run separately from the existing checks and introduce no new repository permissions or secret references. Fresh dependency resolution adds limited supply-chain exposure within CI, but generated files remain isolated from production and other test jobs. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
问题
peerDependencies声明覆盖三段宿主版本:但 CI 只用 lockfile 里那一版(当前 0.2 线)。也就是说 0.1.x 那两段一直是「声明支持却没人验证」——这正是 #344 的由头,只不过 #344 修的是开发依赖那一侧,peer 里的 0.1.x 分支还悬着。
改动
新增
test-host-legacy作业,把 0.1.x 的两段各真跑一遍全量测试:0.1.0-rc.80.1.7-rc.20.1.7-rc.1属同一段)关键设计决定:为什么另开作业,而不是给
test加一个 matrix 维度test的四个作业名(test (ubuntu-latest, 22)等)是分支保护的 required status checks。给 matrix 加一个维度,作业名会变成test (ubuntu-latest, 22, 0.1.0-rc.8)——原名消失,所有 PR 立刻被卡住无法合并。所以新作业完全另起名字,一个必需检查都不碰。这条腿目前不阻断合并;想让它阻断,去 Settings → Branches 把
test-host-legacy (*)加进 required 即可(一个点击,不需要改代码)。其它实现要点
dsh-tools的 peer 要求同版本的dsh-agent,而锁里是 0.2.x)。因此这条腿的树是全新解析的——它只回答宿主 API 面是否兼容,不回答依赖版本一致性(那由test腿的npm ci负责)。--package-lock-only再npm ci):解析失败与下载失败能区分开,且安装结果严格等于解析出的锁。runtime-manifest.json由 lockfile 生成 → 先重建清单再跑测试,否则那条清单一致性用例必红,且与本腿要问的问题无关。AGENTS.md闸门清单里对 CI 矩阵的描述。验证
0.1.0-rc.8全量测试0.1.7-rc.2依赖解析0.1.7-rc.20.1.7-rc.2安装 + 全量测试ECONNRESET打断(非兼容性问题),交由本 PR 的 CI 实跑验证pyyaml解析通过,作业结构如预期这条腿的耗时比
test单分片长(要重新解析整棵依赖树,本地实测解析约 3–4 分钟),换来的是 peer 声明不再只是纸面承诺。Summary by CodeRabbit