已关闭
feat: gc repo branch-protection — 保护分支规则 CRUD(4 个 API 端点) #530
aflyingto创建于 8月11日关闭于 8月11日
aflyingto
8月11日 评论:
8月11日 评论:
验证记录
验证版本: main (aaee4b7)
验证命令: gc repo branch-protection --help + 源码审查
验证结果:
gc repo branch-protection命令不存在- 4 个 API 端点全部就绪:
- GET /protect_branches(返回数组,17 字段:name/push_users/merge_users/developers_can_push 等)
- PUT /branches/setting/new(body: wildcard/pusher/merger)
- PUT /branches/{wildcard}/setting(body: pusher/merger)
- DELETE /branches/{wildcard}/setting
- 现有 类型不含保护规则字段,需定义新 类型
- 方法已实现
结论: 确认功能缺失,4 个 CRUD 端点就绪,可实现。


背景
拆自 gh-parity 专项。gc 当前无保护分支配置功能,API 已就绪。对齐 gh
ruleset能力。API 端点(4 个,均已就绪)
gc repo branch-protection listgc repo branch-protection creategc repo branch-protection updategc repo branch-protection delete请求体字段
wildcard(string):分支通配符(如main、release/*)pusher:可推送者merger:可合入者命令接口
对齐 gh 参考
gh 用 ruleset 管理,GitCode 用保护分支规则,模型不同但功能对应。
验收标准
Refs gitcode-cli/cli#517