docs(repo): add contributing guide and pr template

This commit is contained in:
Your Name
2026-05-06 11:14:01 +08:00
parent 5b3c38b3ed
commit c8759c1d2c
3 changed files with 94 additions and 0 deletions

32
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,32 @@
## Summary
- What changed?
- Why was it needed?
## Scope
- In scope:
- Out of scope:
## Validation
- [ ] `go test ./... -count=1`
- [ ] `go test -race ./...`
- [ ] `go vet ./...`
- [ ] If relevant: `bash -n scripts/verify_preprod_gate_b.sh`
- [ ] If relevant: `bash -n scripts/verify_gate_c_rollback.sh`
## Risk
- What could regress?
- What areas need reviewer attention?
## Config / Docs Impact
- [ ] No config contract change
- [ ] Updated `docs/CONFIG_CONTRACT_BASELINE.md`
- [ ] Updated runbook / QA / plan docs if behavior changed
## Notes
- Related issues / design docs / rollout notes

61
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,61 @@
# Contributing
欢迎提交问题、补丁和设计建议。这个仓库现在是独立服务仓库,协作时默认按服务代码库的标准来处理,不再依赖 monorepo 语境。
## 提交前要求
在提交 PR 前,至少完成以下验证:
```bash
go test ./... -count=1
go test -race ./...
go vet ./...
```
如果改动涉及生产门禁、回滚、平台适配或配置契约,还要补跑对应脚本或最小验证:
```bash
bash -n scripts/verify_preprod_gate_b.sh
bash -n scripts/verify_gate_c_rollback.sh
```
## 变更原则
- 保持改动最小、局部、可验证。
- 不要把 `Sub2API` / `NewAPI` 的边缘适配逻辑渗透到 `dialog``ticket``audit` 主链内部。
- 不要在没有证据的情况下把“测试通过”写成“可生产上线”。
- 修改配置契约时,同步更新文档和测试状态文件。
## 推荐提交流程
1. 先补失败测试。
2. 再实现最小改动。
3. 再跑全量测试和相关脚本。
4. 最后提交 Conventional Commit。
## 提交信息
建议格式:
```text
feat(scope): summary
fix(scope): summary
docs(scope): summary
test(scope): summary
refactor(scope): summary
chore(scope): summary
```
## 代码评审关注点
- 配置项是否与 `docs/CONFIG_CONTRACT_BASELINE.md` 一致
- 新接口是否有明确的错误码和测试
- 平台适配是否仍然只停留在边缘层
- callback / outbox / dead letter 是否可追踪、可重放
## 参考文档
- [README](README.md)
- [Configuration Contract](docs/CONFIG_CONTRACT_BASELINE.md)
- [Platform Callback Runbook](docs/RUNBOOK_PLATFORM_CALLBACKS.md)
- [Sub2API Mapping](docs/SUB2API_MINIMAL_WEBHOOK_MAPPING.md)

View File

@@ -130,6 +130,7 @@ go vet ./...
- `test/QA_GATE_STATUS.md` - `test/QA_GATE_STATUS.md`
- 相关 runbook / plan 文档 - 相关 runbook / plan 文档
- 不要把“测试通过”直接写成“可生产上线”,门禁口径必须区分代码级、预生产级和灰度放量级 - 不要把“测试通过”直接写成“可生产上线”,门禁口径必须区分代码级、预生产级和灰度放量级
- 贡献方式和 PR 校验要求见 [CONTRIBUTING.md](CONTRIBUTING.md)
## 提问题 ## 提问题