Open
feat: #441 契约快照登记 repos vcs-health reset 命令 #90
grape_botAdd on 1 day ago
feat: #441 契约快照登记 repos vcs-health reset 命令 #90
Open
grape_botAdd on 1 day ago
Merged fromfeat/issue-441intomain
grape_bot
grape_botCollaborators
1 day ago

概述

为 Issue #441 在随包契约快照登记 POST /api/repos/{owner}/{repo}/vcs-health/reset(operationId repos_vcs-health_reset),registry 按 operationId 自动生成 grape repos vcs-health reset,无 CLI 源码改动(契约驱动 R7)。

改动

  • grape_cli/data/openapi.json:新增该 operation(post、owner/repo path 参数、session_only 作用域、无 requestBody);minified 风格保持,其余部分字节零 diff
  • grape_cli/data/examples.json:帮助示例(--dry-run 先预览 + --json-out)
  • test/data/commands-snapshot.txt:全量命令树快照新增一行 repos vcs-health reset
  • test/test_vcs_health_reset.py:注册 / 命令树 / 成功 / 403 / 404 / 超时 / dry-run / 非重试,共 11 用例
  • README.md / README.zh.md:契约命令示例;顺带清理 README 中残留的合并冲突标记(<<<<<<< HEAD,属基线遗留)
  • CHANGELOG.md:Unreleased / Added 记账
  • docs/issue-441/:spec / plan / task

测试

  • python3 -m pytest -q → 392 passed(清空平台注入的 GRAPE_* 环境变量后;受注入环境影响时 5 条既有用例失败,与本改动无关)
  • 离线命令面:GRAPE_BASE_URL=<不可达> grape commands vcs → repos vcs-health reset
  • 真实进程信号契约(本地桩服务):200 → {"ok": true, "reset": true} exit 0;403 → 非零退出 + 保留服务端 message;404 → 非零退出 + message;超时 → exit 1 + 超时说明;--dry-run → 零写请求、预览脱敏
  • --dry-run / --json-out / 非幂等(不进 _IDEMPOTENT_RETRY_OPS,502 只请求 1 次)均有用例覆盖

依赖(跨仓)

当前部署契约 2.3.0a1(401 endpoints)与生产 {base}/static/openapi.json 均未导出该路径,POST /api/repos/{owner}/{repo}/vcs-health/reset 未命中路由(405)。在线 grape refresh 后可见该命令需服务端仓库(grape-dev/grape)导出该 operation;本 PR 完成 CLI 侧契约快照登记、命令生成与写命令信号契约。

关联

  • Issue #441
likedislike
Merge blocked
grape_botgrape_botCollaborators
1 day ago Associated issue: 请CLI补充相关接口
grape_botgrape_botCollaborators
1 day ago Pushed 1 commits:8ad965bc-docs(#441): task 清单收尾状态(PR !90 / 评论 / A2A)
吕军涛吕军涛Collaborators
22 hours ago Changed the target branch from ldw into main