fix(skills): preserve update tracking metadata - #1824
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughInstallSkill and InstallAllSkills in the Updater now attempt the larksuite/cli source first, falling back to the open.feishu.cn source only if the primary attempt fails. Two new tests validate this preferred order and the fallback behavior when the primary source call fails. ChangesSkills install source order
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 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 |
背景
lark-cli update同步官方 skills 时优先通过https://open.feishu.cnwell-known 源安装。该路径会让skills的 lock metadata 记录为 well-known,导致后续npx skills update -g -y将 Lark skills 标记为Well-known skill并跳过自动检查。Fixes #1125
核心改动
larksuite/cli,让通用skills update能保留 repo tracking metadata。https://open.feishu.cn作为安装失败时的 fallback,不影响原有可用性。验证
GOCACHE=$PWD/.cache/go-build GOPROXY=https://goproxy.cn,direct go test ./internal/selfupdate -run 'TestInstallSkillsPreferRepoSourceForUpdateTracking|TestInstallSkillsFallBackToWellKnownSource|TestSkillsCommandsUseExpectedArgs' -count=1:通过GOCACHE=$PWD/.cache/go-build GOPROXY=https://goproxy.cn,direct go test ./internal/selfupdate ./internal/skillscheck -count=1:通过GOCACHE=$PWD/.cache/go-build GOPROXY=https://goproxy.cn,direct go test ./cmd/update -run '^(TestUpdatePnpm_JSON|TestUpdatePnpm_Human|TestUpdatePnpm_InstallError_JSON)$' -count=1 -timeout=30s:通过GOCACHE=$PWD/.cache/go-build GOPROXY=https://goproxy.cn,direct go build -o ./lark-cli .:通过git diff --check:通过gofmt -l internal/selfupdate/updater.go internal/selfupdate/updater_test.go:通过,无输出rg -n '^(<<<<<<< .+|=======$|>>>>>>> .+)$' --glob '!vendor/**' --glob '!node_modules/**' .:通过,无冲突标记未运行:
go test ./cmd/update -count=1:本地会命中需要真实npx skills add ...的长路径;已改跑本次 update skills sync 相关的 mock 单测。风险与回滚
风险较低,改动只调整 skills 安装源优先级。若
larksuite/cli源不可用,仍会 fallback 到https://open.feishu.cn。回滚此提交即可恢复原顺序。Summary by CodeRabbit