fix: prevent stale Copilot rules from reverting team updates - #857
Open
Yong-yuan-X wants to merge 1 commit into
Open
Yong-yuan-X wants to merge 1 commit into
Yong-yuan-X wants to merge 1 commit into
Conversation
jeff-r2026
self-requested a review
September 27, 2026 17:37
|
审查发现
测试记录
|
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.
Problem
Copilot 用户 pull 规则 v1 后,如果队友将团队规则更新为 v2,而用户未修改本地规则就执行
teamai push --all,旧副本会被误判为modified,产生将 v2 回退为 v1 的推送提交。推送前同步未处理 Copilot 自动生成的
applyTofrontmatter,导致旧版本比较失败;用户作用域还未使用 Copilot 对应的配置根目录。Changes
.instructions.md格式刷新。COPILOT_HOME。skill-data/core文档。Testing
npm.cmd run build:通过。npx.cmd tsc --noEmit:通过。npm.cmd run lint:通过。npx.cmd vitest run pre-push-sync.test.ts pre-push-sync-skill-copy.test.ts copilot-adapter.test.ts -t '^(?!.*read-only skill)':54 项通过,排除 1 项原有权限测试。npx.cmd vitest run --config vitest.e2e.config.ts src/__tests__/e2e/copilot-pre-push-sync.test.ts:1 项通过。真实 CLI 回归使用构建产物和本地 Git bare 仓库,未 mock Git 操作:
push --all,确认本地规则更新为 v2、applyTo正确、没有生成回退分支,远端 main 保持 v2。push --dry-run,确认真实编辑仍被列为modified,且内容未被覆盖。Limitations
COPILOT_HOME)均有单元测试覆盖。其他 provider / agent 组合尚未在本地验证;未验证托管平台自动创建 PR 的流程。