Compare commits
2 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
7eb33272ff | |
|
|
a8c9c931ac |
|
|
@ -0,0 +1,32 @@
|
||||||
|
# GitLink 2026 参赛提交入口
|
||||||
|
|
||||||
|
作品名称:**gitlink-cli 功能扩展与开源协作治理能力增强**
|
||||||
|
|
||||||
|
参赛方向:**子赛题一:扩展 gitlink-cli 功能**
|
||||||
|
|
||||||
|
作品仓库:<https://gitlink.org.cn/wangyue111/gitlink-cli>
|
||||||
|
|
||||||
|
## 评委阅读入口
|
||||||
|
|
||||||
|
- 正式参赛报告 DOCX:[`competition/gitlink-cli-competition-report.docx`](competition/gitlink-cli-competition-report.docx)
|
||||||
|
- 正式参赛报告 Markdown:[`competition/gitlink-cli-competition-report.md`](competition/gitlink-cli-competition-report.md)
|
||||||
|
- PR 贡献清单:[`competition/pr-contribution-summary.md`](competition/pr-contribution-summary.md)
|
||||||
|
- 演示命令清单:[`competition/demo-commands.md`](competition/demo-commands.md)
|
||||||
|
- Review 响应记录:[`competition/review-response-log.md`](competition/review-response-log.md)
|
||||||
|
- 大赛平台提交文案:[`competition/submission-form.md`](competition/submission-form.md)
|
||||||
|
|
||||||
|
## 成果摘要
|
||||||
|
|
||||||
|
截至 2026-07-09,个人贡献中 GitLink 页面/API 明确显示 `status=merged` 的 PR 共 **12 个**,覆盖 Issue 批量维护、PR patchset、仓库洞察、Release 更新、仓库设置、health bug 修复、CLI 生产力和安装诊断等场景。
|
||||||
|
|
||||||
|
贡献规模建议作为答辩重点:本作品对应 GitLink contributors 条目位列主仓库贡献榜 **Top 3**,贡献值 **89**、占比 **8.69%**;已进入 `upstream/master` 的 Git 历史中包含 **16 个非合并提交**,累计 **+6,543 / -626**,净增 **5,917 行**,总变更 **7,169 行**。PR 提交账号为 `wangyue111`,进入主仓库后的 Git author / contributors 条目显示为 `wangyue789`。
|
||||||
|
|
||||||
|
另有多个主推 PR 已 rebase 至最新 master,当前无冲突、`mergeable=true`,包括仓库脚手架、成员生命周期、分支治理、Commit 检视、PR conversation、SSH Key 和 Issue 模板管理等能力。
|
||||||
|
|
||||||
|
## 已合并 PR
|
||||||
|
|
||||||
|
#12、#18、#24、#43、#44、#45、#57、#59、#69、#71、#120、#165。
|
||||||
|
|
||||||
|
## 主推待评审 PR
|
||||||
|
|
||||||
|
#225、#267、#268、#206、#214、#223、#224。
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
# GitLink 2026 参赛材料
|
||||||
|
|
||||||
|
作品名称:**gitlink-cli 功能扩展与开源协作治理能力增强**
|
||||||
|
|
||||||
|
本目录是评委和维护者查看本作品的统一入口,整理了参赛报告、PR 贡献清单、演示命令、Review 响应记录和平台提交文案。
|
||||||
|
|
||||||
|
## 1. 作品定位
|
||||||
|
|
||||||
|
- 参赛方向:子赛题一,扩展 gitlink-cli 功能。
|
||||||
|
- 贡献方式:向 gitlink-cli 主仓库提交功能 PR、修复 PR 和文档/Skill 更新。
|
||||||
|
- 核心思路:围绕开源维护者真实工作流补齐 CLI 能力,而不是简单搬运 OpenAPI。
|
||||||
|
|
||||||
|
## 2. 核心成果
|
||||||
|
|
||||||
|
截至 2026-07-09,GitLink 页面/API 明确显示 `status=merged` 的个人 PR 共 **12 个**:
|
||||||
|
|
||||||
|
#12、#18、#24、#43、#44、#45、#57、#59、#69、#71、#120、#165。
|
||||||
|
|
||||||
|
主推待评审 PR 当前无冲突、`mergeable=true`:
|
||||||
|
|
||||||
|
#225、#267、#268、#206、#214、#223、#224。
|
||||||
|
|
||||||
|
贡献规模口径:
|
||||||
|
|
||||||
|
- GitLink contributors 排名:**Top 3 / 55**,贡献值 **89**,占比 **8.69%**。
|
||||||
|
- PR 贡献量:个人 PR 共 **89 条**,其中 **12 merged / 56 open / 21 closed**。
|
||||||
|
- 已进入主仓库代码量:**16 个非合并提交**,**+6,543 / -626**,净增 **5,917 行**,总变更 **7,169 行**。
|
||||||
|
- 账号说明:PR 提交账号为 `wangyue111`;进入主仓库后的 Git author / contributors 条目显示为 `wangyue789`。
|
||||||
|
|
||||||
|
## 3. 材料索引
|
||||||
|
|
||||||
|
| 文件 | 用途 |
|
||||||
|
|---|---|
|
||||||
|
| [`gitlink-cli-competition-report.docx`](gitlink-cli-competition-report.docx) | 正式参赛报告,可上传大赛平台 |
|
||||||
|
| [`gitlink-cli-competition-report.md`](gitlink-cli-competition-report.md) | 报告 Markdown 版本,便于网页查看 |
|
||||||
|
| [`pr-contribution-summary.md`](pr-contribution-summary.md) | 已合并 PR 与主推 PR 清单 |
|
||||||
|
| [`demo-commands.md`](demo-commands.md) | 答辩演示命令与复现步骤 |
|
||||||
|
| [`review-response-log.md`](review-response-log.md) | 维护者 Review 响应与工程质量记录 |
|
||||||
|
| [`submission-form.md`](submission-form.md) | 大赛平台表单可直接复制的文案 |
|
||||||
|
|
||||||
|
## 4. 一句话简介
|
||||||
|
|
||||||
|
本作品面向 GitLink 平台和开源社区维护者的真实协作场景,系统扩展 gitlink-cli 的 Shortcut 命令能力,覆盖 Issue 批量维护、仓库初始化、成员申请/退出、分支生命周期、PR/Commit 审查、SSH Key 管理、Issue 模板管理等流程;通过 dry-run、yes 确认、参数校验和完整测试保证 CLI 与 Agent 自动化调用安全可靠。
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
# 演示命令清单
|
||||||
|
|
||||||
|
建议答辩时优先使用 `--dry-run`,既展示请求契约,也避免修改线上数据。
|
||||||
|
|
||||||
|
## 1. Issue 批量关闭
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gitlink-cli issue +batch-close \
|
||||||
|
--owner wangyue111 \
|
||||||
|
--repo gitlink-cli \
|
||||||
|
--numbers 1,2 \
|
||||||
|
--dry-run \
|
||||||
|
--format json
|
||||||
|
```
|
||||||
|
|
||||||
|
展示点:
|
||||||
|
|
||||||
|
- `--numbers` 使用网页 Issue 编号。
|
||||||
|
- `--dry-run` 不修改线上数据。
|
||||||
|
- 输出 `total/succeeded/failed/results`。
|
||||||
|
|
||||||
|
## 2. Issue 批量更新
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gitlink-cli issue +batch-update \
|
||||||
|
--owner wangyue111 \
|
||||||
|
--repo gitlink-cli \
|
||||||
|
--ids 101,102 \
|
||||||
|
--status-id 3 \
|
||||||
|
--dry-run \
|
||||||
|
--format json
|
||||||
|
```
|
||||||
|
|
||||||
|
展示点:
|
||||||
|
|
||||||
|
- `--ids` 是 OpenAPI issue id,与 `batch-close --numbers` 区分。
|
||||||
|
- 支持批量更新状态、优先级、里程碑、标签、负责人。
|
||||||
|
|
||||||
|
## 3. 仓库脚手架创建
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gitlink-cli repo +create \
|
||||||
|
--name demo-project \
|
||||||
|
--identifier demo-project \
|
||||||
|
--description demo \
|
||||||
|
--private \
|
||||||
|
--license-id 1 \
|
||||||
|
--ignore-id 1 \
|
||||||
|
--dry-run \
|
||||||
|
--format json
|
||||||
|
```
|
||||||
|
|
||||||
|
展示点:
|
||||||
|
|
||||||
|
- 一条命令完成仓库初始化参数预览。
|
||||||
|
- 支持 identifier、license、ignore、language、category、blockchain 等字段。
|
||||||
|
|
||||||
|
## 4. 成员申请加入
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gitlink-cli member +apply \
|
||||||
|
--code <invite-code> \
|
||||||
|
--role developer \
|
||||||
|
--dry-run \
|
||||||
|
--format json
|
||||||
|
```
|
||||||
|
|
||||||
|
展示点:
|
||||||
|
|
||||||
|
- 用户侧 onboarding 流程。
|
||||||
|
- role 本地校验:manager/developer/reporter。
|
||||||
|
|
||||||
|
## 5. 分支默认分支设置
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gitlink-cli branch +set-default \
|
||||||
|
--owner wangyue111 \
|
||||||
|
--repo gitlink-cli \
|
||||||
|
--name main \
|
||||||
|
--dry-run \
|
||||||
|
--format json
|
||||||
|
```
|
||||||
|
|
||||||
|
展示点:
|
||||||
|
|
||||||
|
- 分支治理能力。
|
||||||
|
- 写操作 dry-run 预览请求路径和 query。
|
||||||
|
|
||||||
|
## 6. 通用验证命令
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git diff --check
|
||||||
|
GOPROXY=https://goproxy.cn,direct go test ./...
|
||||||
|
go vet ./...
|
||||||
|
```
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,73 @@
|
||||||
|
# gitlink-cli 功能扩展与开源协作治理能力增强参赛报告
|
||||||
|
|
||||||
|
> 子赛题一:扩展 CLI 功能。作品仓库:<https://gitlink.org.cn/wangyue111/gitlink-cli>
|
||||||
|
|
||||||
|
## 核心摘要
|
||||||
|
|
||||||
|
本作品围绕 GitLink 开源维护者真实工作流,扩展 gitlink-cli 的 Issue 批量维护、仓库初始化、成员协作、分支治理、PR/Commit 审查和账号配置能力。所有高风险写操作均设计 dry-run、yes 确认、参数校验和结构化输出。截至 2026-07-09,已有 12 个 PR 合并进主仓库,GitLink contributors 排名 Top 3,已进入 upstream/master 的代码净增 5,917 行,另有多个主推 PR 无冲突且 mergeable=true。
|
||||||
|
|
||||||
|
## 贡献规模与仓库影响力
|
||||||
|
|
||||||
|
> PR 提交账号为 `wangyue111`;进入主仓库后的 Git author / GitLink contributors 条目显示为 `wangyue789`。建议答辩口径使用“贡献榜 Top 3、核心外部贡献者、参赛贡献第一梯队”,避免无范围限定地写“全仓库第一贡献者”。
|
||||||
|
|
||||||
|
| 指标 | 数据 | 说明 |
|
||||||
|
|---|---:|---|
|
||||||
|
| GitLink 贡献榜 | 第 3 / 55 | 89 contributions,占比 8.69%;位于主仓库贡献第一梯队 |
|
||||||
|
| PR 落地数量 | 12 merged PR | GitLink PR 列表复核:个人 PR 共 89 条,其中 12 merged、56 open、21 closed |
|
||||||
|
| Git 提交规模 | 16 个非合并提交 | 已进入 upstream/master;按 Git author 统计仅次于核心维护者 wbtiger |
|
||||||
|
| 代码变更量 | +6,543 / -626 | 主仓库历史中净增 5,917 行,总变更 7,169 行 |
|
||||||
|
|
||||||
|
## 已合并 PR
|
||||||
|
|
||||||
|
| PR | 标题 | 贡献价值 |
|
||||||
|
|---:|---|---|
|
||||||
|
| [#12](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/12) | `feat(issue): add batch close shortcut with dry-run support` | Issue 批量关闭;dry-run、CSV、保留 description |
|
||||||
|
| [#18](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/18) | `fix(npm): improve missing binary diagnostics` | 改善 npm 安装/二进制缺失诊断,提升安装体验 |
|
||||||
|
| [#24](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/24) | `feat(pr): add patchset version shortcuts` | PR patchset/version 查询,支撑 Review 迭代追踪 |
|
||||||
|
| [#43](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/43) | `feat(issue): add metadata lookup shortcuts` | Issue 状态、优先级、标签等元数据查询 |
|
||||||
|
| [#44](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/44) | `feat(issue): add user lookup shortcuts` | Issue 作者/负责人等用户检索 |
|
||||||
|
| [#45](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/45) | `feat(cli): add productivity shortcuts and API body inputs` | CLI 生产力与 Raw API 请求体输入增强 |
|
||||||
|
| [#57](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/57) | `feat(issue): support metadata fields` | 扩展 Issue metadata 字段支持 |
|
||||||
|
| [#59](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/59) | `feat(repo): add insight shortcuts` | 仓库洞察:语言、贡献者、代码统计、关注/点赞 |
|
||||||
|
| [#69](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/69) | `feat(release): add edit and update shortcuts` | Release 编辑/更新,支撑版本发布维护 |
|
||||||
|
| [#71](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/71) | `feat(repo): add settings and topic shortcuts` | 仓库设置与 Topic 管理 |
|
||||||
|
| [#120](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/120) | `fix(health): use effective list filters` | 真实接口验证并修复 health 筛选 bug |
|
||||||
|
| [#165](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/165) | `feat(issue): add batch maintenance shortcuts` | Issue 批量更新/删除,补齐批量维护闭环 |
|
||||||
|
|
||||||
|
## 主推待评审 PR
|
||||||
|
|
||||||
|
| PR | 状态 | 主推理由 |
|
||||||
|
|---:|---|---|
|
||||||
|
| [#225](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/225) | open, mergeable=true | 增强 repo +create,补齐 identifier/category/language/ignore/license/blockchain/dry-run |
|
||||||
|
| [#267](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/267) | open, mergeable=true | 成员申请加入与退出项目,支持 dry-run/yes |
|
||||||
|
| [#268](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/268) | open, mergeable=true | 分支全量列表、默认分支设置、恢复删除分支 |
|
||||||
|
| [#206](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/206) | open, mergeable=true | Commit 检视能力,支撑代码审查和科研代码溯源 |
|
||||||
|
| [#214](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/214) | open, mergeable=true | PR conversation 查询/删除,与现有 pr +comment 互补 |
|
||||||
|
| [#223](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/223) | open, mergeable=true | SSH Key 列表、创建、删除,提升开发者 onboarding |
|
||||||
|
| [#224](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/224) | open, mergeable=true | Issue 模板完整生命周期管理 |
|
||||||
|
|
||||||
|
## 复现验证
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git diff --check
|
||||||
|
GOPROXY=https://goproxy.cn,direct go test ./...
|
||||||
|
go vet ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
## 演示命令
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gitlink-cli issue +batch-close --owner wangyue111 --repo gitlink-cli --numbers 1,2 --dry-run --format json
|
||||||
|
```
|
||||||
|
```bash
|
||||||
|
gitlink-cli issue +batch-update --owner wangyue111 --repo gitlink-cli --ids 101,102 --status-id 3 --dry-run --format json
|
||||||
|
```
|
||||||
|
```bash
|
||||||
|
gitlink-cli repo +create --name demo-project --identifier demo-project --description demo --private --license-id 1 --ignore-id 1 --dry-run --format json
|
||||||
|
```
|
||||||
|
```bash
|
||||||
|
gitlink-cli member +apply --code <invite-code> --role developer --dry-run --format json
|
||||||
|
```
|
||||||
|
```bash
|
||||||
|
gitlink-cli branch +set-default --owner wangyue111 --repo gitlink-cli --name main --dry-run --format json
|
||||||
|
```
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,43 @@
|
||||||
|
# PR 贡献清单
|
||||||
|
|
||||||
|
## 已合并 PR(成果落地核心证据)
|
||||||
|
|
||||||
|
截至 2026-07-09,GitLink 页面/API 明确显示 `status=merged` 的个人贡献 PR 共 **12 个**。
|
||||||
|
|
||||||
|
## 贡献规模(答辩推荐重点)
|
||||||
|
|
||||||
|
> PR 提交账号为 `wangyue111`;进入主仓库后的 Git author / GitLink contributors 条目显示为 `wangyue789`。公开口径建议写“贡献榜 Top 3 / 核心外部贡献者 / 参赛贡献第一梯队”,不要无范围限定地写“全仓库第一贡献者”。
|
||||||
|
|
||||||
|
| 指标 | 数据 | 说明 |
|
||||||
|
|---|---:|---|
|
||||||
|
| GitLink contributors 排名 | Top 3 / 55 | 贡献值 89,占比 8.69% |
|
||||||
|
| PR 贡献量 | 89 条 | 12 merged / 56 open / 21 closed |
|
||||||
|
| Git 提交规模 | 16 个非合并提交 | 已进入 `upstream/master` |
|
||||||
|
| 代码变更量 | +6,543 / -626 | 净增 5,917 行,总变更 7,169 行 |
|
||||||
|
|
||||||
|
| PR | 标题 | 价值 |
|
||||||
|
|---:|---|---|
|
||||||
|
| [#12](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/12) | `feat(issue): add batch close shortcut with dry-run support` | Issue 批量关闭;支持 dry-run、CSV、保留 description |
|
||||||
|
| [#18](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/18) | `fix(npm): improve missing binary diagnostics` | 改善 npm 安装/二进制缺失诊断,提升安装体验 |
|
||||||
|
| [#24](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/24) | `feat(pr): add patchset version shortcuts` | PR patchset/version 查询,支撑 Review 迭代追踪 |
|
||||||
|
| [#43](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/43) | `feat(issue): add metadata lookup shortcuts` | Issue 状态、优先级、标签等元数据查询 |
|
||||||
|
| [#44](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/44) | `feat(issue): add user lookup shortcuts` | Issue 作者/负责人等用户检索 |
|
||||||
|
| [#45](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/45) | `feat(cli): add productivity shortcuts and API body inputs` | CLI 生产力与 Raw API 请求体输入增强 |
|
||||||
|
| [#57](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/57) | `feat(issue): support metadata fields` | 扩展 Issue metadata 字段支持 |
|
||||||
|
| [#59](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/59) | `feat(repo): add insight shortcuts` | 仓库洞察:语言、贡献者、代码统计、关注/点赞 |
|
||||||
|
| [#69](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/69) | `feat(release): add edit and update shortcuts` | Release 编辑/更新,支撑版本发布维护 |
|
||||||
|
| [#71](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/71) | `feat(repo): add settings and topic shortcuts` | 仓库设置与 Topic 管理 |
|
||||||
|
| [#120](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/120) | `fix(health): use effective list filters` | 真实接口验证并修复 health 筛选 bug |
|
||||||
|
| [#165](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/165) | `feat(issue): add batch maintenance shortcuts` | Issue 批量更新/删除,补齐批量维护闭环 |
|
||||||
|
|
||||||
|
## 主推待评审 PR(已 rebase,无冲突,mergeable=true)
|
||||||
|
|
||||||
|
| PR | 标题 | 主推理由 |
|
||||||
|
|---:|---|---|
|
||||||
|
| [#225](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/225) | `feat(repo): add scaffold creation options` | 增强 `repo +create`,补齐 identifier/category/language/ignore/license/blockchain/dry-run |
|
||||||
|
| [#267](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/267) | `feat(member): add application shortcuts` | 成员申请加入与退出项目,支持 dry-run/yes |
|
||||||
|
| [#268](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/268) | `feat(branch): add lifecycle shortcuts` | 分支全量列表、默认分支设置、恢复删除分支 |
|
||||||
|
| [#206](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/206) | `feat(commit): add commit inspection shortcuts` | Commit 检视能力,支撑代码审查和科研代码溯源 |
|
||||||
|
| [#214](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/214) | `feat(pr): add conversation comment shortcuts` | PR conversation 查询/删除,与现有 `pr +comment` 互补 |
|
||||||
|
| [#223](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/223) | `feat(public-key): add SSH key shortcuts` | SSH Key 列表、创建、删除,提升开发者 onboarding |
|
||||||
|
| [#224](https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/224) | `feat(project-template): add issue template shortcuts` | Issue 模板完整生命周期管理 |
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
# Review 响应与工程质量记录
|
||||||
|
|
||||||
|
## 1. #12 Issue batch-close:高危数据丢失问题修复并合并
|
||||||
|
|
||||||
|
Review 指出:关闭 Issue 时只传 `subject + status_id`,不传 `description` 会导致 GitLink API 清空描述。
|
||||||
|
|
||||||
|
处理:
|
||||||
|
|
||||||
|
- 关闭前复用 `fetchExistingIssue()` 获取现有 `subject` 和 `description`。
|
||||||
|
- PATCH 时同时带回 `subject`、`description`、`status_id`。
|
||||||
|
- rebase 最新 master,适配 v1 API。
|
||||||
|
- 参数语义改为 `--numbers`,明确使用网页 Issue 编号。
|
||||||
|
|
||||||
|
结果:#12 已合并。
|
||||||
|
|
||||||
|
## 2. #22 Webhook:根据 Review 补文档并重发 PR
|
||||||
|
|
||||||
|
Review 要求:
|
||||||
|
|
||||||
|
- rebase 最新 master。
|
||||||
|
- 解决 README 冲突。
|
||||||
|
- 在 Skill 中补全 `--events` 支持的完整事件列表。
|
||||||
|
|
||||||
|
处理:
|
||||||
|
|
||||||
|
- 解决 README 冲突。
|
||||||
|
- 补充 `push/create/delete/issues_only/issue_assign/issue_label/issue_comment/pull_request_only/pull_request_assign/pull_request_comment` 等事件说明。
|
||||||
|
- 旧 PR 无法充分修改说明时关闭并重发,提高可审查性。
|
||||||
|
|
||||||
|
## 3. 批量 rebase 与冲突处理
|
||||||
|
|
||||||
|
维护者对多个 OpenAPI PR 提出共性建议:
|
||||||
|
|
||||||
|
- rebase 最新 master。
|
||||||
|
- 处理 gofmt。
|
||||||
|
- squash commit,降低 Review 成本。
|
||||||
|
- 解决 `shortcuts/register.go`、`shortcuts/register_test.go`、README、Skill 文档冲突。
|
||||||
|
|
||||||
|
处理:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git fetch upstream master
|
||||||
|
git rebase upstream/master
|
||||||
|
gofmt -w <changed-go-files>
|
||||||
|
git diff --check
|
||||||
|
GOPROXY=https://goproxy.cn,direct go test ./...
|
||||||
|
go vet ./...
|
||||||
|
git push --force-with-lease
|
||||||
|
```
|
||||||
|
|
||||||
|
结果:多个 open PR 保持无冲突、可合并状态。
|
||||||
|
|
||||||
|
## 4. #120 Health filter:真实线上 bug 修复
|
||||||
|
|
||||||
|
问题:`health +fetch` 中 Issue/PR 列表筛选参数无效,线上接口返回混合状态数据。
|
||||||
|
|
||||||
|
处理:
|
||||||
|
|
||||||
|
- PR list 改用 `status=0/1/2`。
|
||||||
|
- Issue list 改用 `category=opened/closed`。
|
||||||
|
- `savePull` 兼容 v1 PR list 返回结构。
|
||||||
|
- 补充单元测试。
|
||||||
|
|
||||||
|
结果:#120 已合并,体现真实成果落地。
|
||||||
|
|
||||||
|
## 5. #248 Dataset guard:按维护者意见收敛方案
|
||||||
|
|
||||||
|
背景:Issue #21 指出 dataset 仓库级后端接口未部署,会返回 404。
|
||||||
|
|
||||||
|
处理:曾提交 CLI guard 方案,保留 `dataset +list`,并给未部署接口提供 dry-run / guard。
|
||||||
|
|
||||||
|
维护者反馈:后端 404 已足够明确,大范围 guard 可收敛,建议拆出更小的 `dataset +view --dry-run`。
|
||||||
|
|
||||||
|
当前口径:不强推 #248,作为“响应 Issue 并根据维护者意见收敛方案”的案例。
|
||||||
|
|
@ -0,0 +1,378 @@
|
||||||
|
from pathlib import Path
|
||||||
|
from docx import Document
|
||||||
|
from docx.shared import Inches, Pt, RGBColor
|
||||||
|
from docx.enum.text import WD_ALIGN_PARAGRAPH
|
||||||
|
from docx.enum.table import WD_TABLE_ALIGNMENT, WD_CELL_VERTICAL_ALIGNMENT
|
||||||
|
from docx.oxml import OxmlElement
|
||||||
|
from docx.oxml.ns import qn
|
||||||
|
from docx.enum.section import WD_SECTION
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
REPORT_DOCX = ROOT / "gitlink-cli-competition-report.docx"
|
||||||
|
REPORT_MD = ROOT / "gitlink-cli-competition-report.md"
|
||||||
|
|
||||||
|
MERGED_PRS = [
|
||||||
|
(12, "feat(issue): add batch close shortcut with dry-run support", "Issue 批量关闭;dry-run、CSV、保留 description", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/12"),
|
||||||
|
(18, "fix(npm): improve missing binary diagnostics", "改善 npm 安装/二进制缺失诊断,提升安装体验", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/18"),
|
||||||
|
(24, "feat(pr): add patchset version shortcuts", "PR patchset/version 查询,支撑 Review 迭代追踪", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/24"),
|
||||||
|
(43, "feat(issue): add metadata lookup shortcuts", "Issue 状态、优先级、标签等元数据查询", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/43"),
|
||||||
|
(44, "feat(issue): add user lookup shortcuts", "Issue 作者/负责人等用户检索", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/44"),
|
||||||
|
(45, "feat(cli): add productivity shortcuts and API body inputs", "CLI 生产力与 Raw API 请求体输入增强", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/45"),
|
||||||
|
(57, "feat(issue): support metadata fields", "扩展 Issue metadata 字段支持", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/57"),
|
||||||
|
(59, "feat(repo): add insight shortcuts", "仓库洞察:语言、贡献者、代码统计、关注/点赞", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/59"),
|
||||||
|
(69, "feat(release): add edit and update shortcuts", "Release 编辑/更新,支撑版本发布维护", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/69"),
|
||||||
|
(71, "feat(repo): add settings and topic shortcuts", "仓库设置与 Topic 管理", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/71"),
|
||||||
|
(120, "fix(health): use effective list filters", "真实接口验证并修复 health 筛选 bug", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/120"),
|
||||||
|
(165, "feat(issue): add batch maintenance shortcuts", "Issue 批量更新/删除,补齐批量维护闭环", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/165"),
|
||||||
|
]
|
||||||
|
|
||||||
|
OPEN_PRS = [
|
||||||
|
(225, "feat(repo): add scaffold creation options", "open, mergeable=true", "增强 repo +create,补齐 identifier/category/language/ignore/license/blockchain/dry-run", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/225"),
|
||||||
|
(267, "feat(member): add application shortcuts", "open, mergeable=true", "成员申请加入与退出项目,支持 dry-run/yes", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/267"),
|
||||||
|
(268, "feat(branch): add lifecycle shortcuts", "open, mergeable=true", "分支全量列表、默认分支设置、恢复删除分支", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/268"),
|
||||||
|
(206, "feat(commit): add commit inspection shortcuts", "open, mergeable=true", "Commit 检视能力,支撑代码审查和科研代码溯源", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/206"),
|
||||||
|
(214, "feat(pr): add conversation comment shortcuts", "open, mergeable=true", "PR conversation 查询/删除,与现有 pr +comment 互补", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/214"),
|
||||||
|
(223, "feat(public-key): add SSH key shortcuts", "open, mergeable=true", "SSH Key 列表、创建、删除,提升开发者 onboarding", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/223"),
|
||||||
|
(224, "feat(project-template): add issue template shortcuts", "open, mergeable=true", "Issue 模板完整生命周期管理", "https://www.gitlink.org.cn/Gitlink/gitlink-cli/pulls/224"),
|
||||||
|
]
|
||||||
|
|
||||||
|
CONTRIBUTION_METRICS = [
|
||||||
|
("GitLink 贡献榜", "第 3 / 55", "89 contributions,占比 8.69%;位于主仓库贡献第一梯队"),
|
||||||
|
("PR 落地数量", "12 merged PR", "GitLink PR 列表复核:个人 PR 共 89 条,其中 12 merged、56 open、21 closed"),
|
||||||
|
("Git 提交规模", "16 个非合并提交", "已进入 upstream/master;按 Git author 统计仅次于核心维护者 wbtiger"),
|
||||||
|
("代码变更量", "+6,543 / -626", "主仓库历史中净增 5,917 行,总变更 7,169 行"),
|
||||||
|
]
|
||||||
|
|
||||||
|
REVIEW_CASES = [
|
||||||
|
("#12 Issue batch-close", "Review 指出关闭 Issue 未保留 description,且 Issue API 已切到 v1。", "复用 fetchExistingIssue(),PATCH 时带回 subject/description/status_id;参数语义改为 --numbers;最终合并。"),
|
||||||
|
("#22 Webhook", "Review 要求 rebase、解决 README 冲突,并补全 Skill 中 --events 事件列表。", "补齐 push/create/delete/issues_only/issue_assign/issue_label/issue_comment/pull_request_* 等事件说明;重发 PR 提升可审查性。"),
|
||||||
|
("#43/#57/#59/#63/#64/#69/#70/#71/#72", "维护者要求 rebase 最新 master、处理 gofmt、squash commit、解决 register/README/Skill 冲突。", "批量 rebase、gofmt、diff --check、go test、go vet,并 force-push,保持 PR 可合并。"),
|
||||||
|
("#120 health filter", "真实接口验证发现已合入 health 功能使用的 state 筛选无效。", "改为 PR status=0/1/2、Issue category=opened/closed,并补充 savePull v1 结构测试;最终合并。"),
|
||||||
|
("#248 dataset guard", "Issue #21 指出仓库级 dataset 后端未部署;维护者认为大范围 guard 可收敛。", "记录为响应 Issue 的维护闭环,后续按建议拆小,只保留有价值的 dry-run 预览。"),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def set_run_font(run, name="Calibri", east_asia="Microsoft YaHei", size=None, color=None, bold=None, italic=None):
|
||||||
|
run.font.name = name
|
||||||
|
run._element.rPr.rFonts.set(qn("w:ascii"), name)
|
||||||
|
run._element.rPr.rFonts.set(qn("w:hAnsi"), name)
|
||||||
|
run._element.rPr.rFonts.set(qn("w:eastAsia"), east_asia)
|
||||||
|
if size is not None:
|
||||||
|
run.font.size = Pt(size)
|
||||||
|
if color is not None:
|
||||||
|
run.font.color.rgb = RGBColor.from_string(color)
|
||||||
|
if bold is not None:
|
||||||
|
run.bold = bold
|
||||||
|
if italic is not None:
|
||||||
|
run.italic = italic
|
||||||
|
|
||||||
|
|
||||||
|
def set_cell_shading(cell, fill):
|
||||||
|
tcPr = cell._tc.get_or_add_tcPr()
|
||||||
|
shd = tcPr.find(qn('w:shd'))
|
||||||
|
if shd is None:
|
||||||
|
shd = OxmlElement('w:shd')
|
||||||
|
tcPr.append(shd)
|
||||||
|
shd.set(qn('w:fill'), fill)
|
||||||
|
|
||||||
|
|
||||||
|
def set_cell_margins(cell, top=80, start=120, bottom=80, end=120):
|
||||||
|
tc = cell._tc
|
||||||
|
tcPr = tc.get_or_add_tcPr()
|
||||||
|
tcMar = tcPr.first_child_found_in("w:tcMar")
|
||||||
|
if tcMar is None:
|
||||||
|
tcMar = OxmlElement('w:tcMar')
|
||||||
|
tcPr.append(tcMar)
|
||||||
|
for m, v in [('top', top), ('start', start), ('bottom', bottom), ('end', end)]:
|
||||||
|
node = tcMar.find(qn(f'w:{m}'))
|
||||||
|
if node is None:
|
||||||
|
node = OxmlElement(f'w:{m}')
|
||||||
|
tcMar.append(node)
|
||||||
|
node.set(qn('w:w'), str(v))
|
||||||
|
node.set(qn('w:type'), 'dxa')
|
||||||
|
|
||||||
|
|
||||||
|
def set_table_width(table, widths):
|
||||||
|
table.alignment = WD_TABLE_ALIGNMENT.CENTER
|
||||||
|
table.autofit = False
|
||||||
|
tblPr = table._tbl.tblPr
|
||||||
|
tblW = tblPr.find(qn('w:tblW'))
|
||||||
|
if tblW is None:
|
||||||
|
tblW = OxmlElement('w:tblW')
|
||||||
|
tblPr.append(tblW)
|
||||||
|
tblW.set(qn('w:w'), str(sum(widths)))
|
||||||
|
tblW.set(qn('w:type'), 'dxa')
|
||||||
|
grid = table._tbl.tblGrid
|
||||||
|
if grid is None:
|
||||||
|
grid = OxmlElement('w:tblGrid')
|
||||||
|
table._tbl.insert(0, grid)
|
||||||
|
for child in list(grid):
|
||||||
|
grid.remove(child)
|
||||||
|
for w in widths:
|
||||||
|
gc = OxmlElement('w:gridCol')
|
||||||
|
gc.set(qn('w:w'), str(w))
|
||||||
|
grid.append(gc)
|
||||||
|
for row in table.rows:
|
||||||
|
for i, cell in enumerate(row.cells):
|
||||||
|
if i < len(widths):
|
||||||
|
cell.width = Inches(widths[i] / 1440)
|
||||||
|
tcPr = cell._tc.get_or_add_tcPr()
|
||||||
|
tcW = tcPr.find(qn('w:tcW'))
|
||||||
|
if tcW is None:
|
||||||
|
tcW = OxmlElement('w:tcW')
|
||||||
|
tcPr.append(tcW)
|
||||||
|
tcW.set(qn('w:w'), str(widths[i]))
|
||||||
|
tcW.set(qn('w:type'), 'dxa')
|
||||||
|
cell.vertical_alignment = WD_CELL_VERTICAL_ALIGNMENT.CENTER
|
||||||
|
set_cell_margins(cell)
|
||||||
|
|
||||||
|
|
||||||
|
def add_heading(doc, text, level=1):
|
||||||
|
p = doc.add_paragraph(style=f'Heading {level}')
|
||||||
|
run = p.add_run(text)
|
||||||
|
return p
|
||||||
|
|
||||||
|
|
||||||
|
def add_body(doc, text, bold_prefix=None):
|
||||||
|
p = doc.add_paragraph(style='Normal')
|
||||||
|
if bold_prefix and text.startswith(bold_prefix):
|
||||||
|
r = p.add_run(bold_prefix)
|
||||||
|
set_run_font(r, bold=True)
|
||||||
|
r2 = p.add_run(text[len(bold_prefix):])
|
||||||
|
set_run_font(r2)
|
||||||
|
else:
|
||||||
|
r = p.add_run(text)
|
||||||
|
set_run_font(r)
|
||||||
|
return p
|
||||||
|
|
||||||
|
|
||||||
|
def add_bullet(doc, text):
|
||||||
|
p = doc.add_paragraph(style='List Bullet')
|
||||||
|
r = p.add_run(text)
|
||||||
|
set_run_font(r)
|
||||||
|
return p
|
||||||
|
|
||||||
|
|
||||||
|
def add_number(doc, text):
|
||||||
|
p = doc.add_paragraph(style='List Number')
|
||||||
|
r = p.add_run(text)
|
||||||
|
set_run_font(r)
|
||||||
|
return p
|
||||||
|
|
||||||
|
|
||||||
|
def add_table(doc, headers, rows, widths):
|
||||||
|
table = doc.add_table(rows=1, cols=len(headers))
|
||||||
|
table.style = 'Table Grid'
|
||||||
|
hdr = table.rows[0].cells
|
||||||
|
for i, h in enumerate(headers):
|
||||||
|
hdr[i].text = ""
|
||||||
|
p = hdr[i].paragraphs[0]
|
||||||
|
r = p.add_run(h)
|
||||||
|
set_run_font(r, bold=True, size=9.5, color="0B2545")
|
||||||
|
set_cell_shading(hdr[i], 'F2F4F7')
|
||||||
|
for row in rows:
|
||||||
|
cells = table.add_row().cells
|
||||||
|
for i, val in enumerate(row):
|
||||||
|
cells[i].text = ""
|
||||||
|
p = cells[i].paragraphs[0]
|
||||||
|
r = p.add_run(str(val))
|
||||||
|
set_run_font(r, size=9)
|
||||||
|
set_table_width(table, widths)
|
||||||
|
doc.add_paragraph()
|
||||||
|
return table
|
||||||
|
|
||||||
|
|
||||||
|
def add_code(doc, code):
|
||||||
|
p = doc.add_paragraph()
|
||||||
|
p.paragraph_format.left_indent = Inches(0.18)
|
||||||
|
p.paragraph_format.space_before = Pt(4)
|
||||||
|
p.paragraph_format.space_after = Pt(6)
|
||||||
|
r = p.add_run(code)
|
||||||
|
set_run_font(r, name="Courier New", east_asia="Microsoft YaHei", size=9, color="1F2937")
|
||||||
|
return p
|
||||||
|
|
||||||
|
|
||||||
|
def make_docx():
|
||||||
|
doc = Document()
|
||||||
|
sec = doc.sections[0]
|
||||||
|
sec.page_width = Inches(8.5)
|
||||||
|
sec.page_height = Inches(11)
|
||||||
|
sec.top_margin = sec.bottom_margin = sec.left_margin = sec.right_margin = Inches(1)
|
||||||
|
sec.header_distance = Inches(0.492)
|
||||||
|
sec.footer_distance = Inches(0.492)
|
||||||
|
|
||||||
|
styles = doc.styles
|
||||||
|
normal = styles['Normal']
|
||||||
|
normal.font.name = 'Calibri'
|
||||||
|
normal._element.rPr.rFonts.set(qn('w:eastAsia'), 'Microsoft YaHei')
|
||||||
|
normal.font.size = Pt(11)
|
||||||
|
normal.paragraph_format.space_after = Pt(6)
|
||||||
|
normal.paragraph_format.line_spacing = 1.10
|
||||||
|
|
||||||
|
for name, size, color, before, after in [('Heading 1', 16, '2E74B5', 16, 8), ('Heading 2', 13, '2E74B5', 12, 6), ('Heading 3', 12, '1F4D78', 8, 4)]:
|
||||||
|
st = styles[name]
|
||||||
|
st.font.name = 'Calibri'
|
||||||
|
st._element.rPr.rFonts.set(qn('w:eastAsia'), 'Microsoft YaHei')
|
||||||
|
st.font.size = Pt(size)
|
||||||
|
st.font.color.rgb = RGBColor.from_string(color)
|
||||||
|
st.font.bold = True
|
||||||
|
st.paragraph_format.space_before = Pt(before)
|
||||||
|
st.paragraph_format.space_after = Pt(after)
|
||||||
|
|
||||||
|
# Header/footer
|
||||||
|
hp = sec.header.paragraphs[0]
|
||||||
|
hp.text = "gitlink-cli 参赛报告 | 功能扩展与开源协作治理能力增强"
|
||||||
|
hp.alignment = WD_ALIGN_PARAGRAPH.RIGHT
|
||||||
|
for r in hp.runs:
|
||||||
|
set_run_font(r, size=9, color="555555")
|
||||||
|
fp = sec.footer.paragraphs[0]
|
||||||
|
fp.text = "GitLink 2026 Competition Submission"
|
||||||
|
fp.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
||||||
|
for r in fp.runs:
|
||||||
|
set_run_font(r, size=9, color="555555")
|
||||||
|
|
||||||
|
# Masthead
|
||||||
|
p = doc.add_paragraph()
|
||||||
|
p.paragraph_format.space_before = Pt(14)
|
||||||
|
p.paragraph_format.space_after = Pt(4)
|
||||||
|
r = p.add_run("参赛报告")
|
||||||
|
set_run_font(r, size=12, color="555555", bold=True)
|
||||||
|
|
||||||
|
p = doc.add_paragraph()
|
||||||
|
p.paragraph_format.space_after = Pt(6)
|
||||||
|
r = p.add_run("gitlink-cli 功能扩展与开源协作治理能力增强")
|
||||||
|
set_run_font(r, size=24, color="0B2545", bold=True)
|
||||||
|
|
||||||
|
p = doc.add_paragraph()
|
||||||
|
p.paragraph_format.space_after = Pt(14)
|
||||||
|
r = p.add_run("子赛题一:扩展 CLI 功能 | 截至 2026-07-09,12 个 PR 已合并,贡献榜 Top 3,代码净增 5,917 行")
|
||||||
|
set_run_font(r, size=11, color="555555")
|
||||||
|
|
||||||
|
meta_rows = [
|
||||||
|
("作品仓库", "https://gitlink.org.cn/wangyue111/gitlink-cli"),
|
||||||
|
("主仓库", "https://gitlink.org.cn/Gitlink/gitlink-cli"),
|
||||||
|
("参赛方向", "子赛题一:向 gitlink-cli 主仓库贡献 CLI 功能 PR"),
|
||||||
|
("核心证据", "GitLink 贡献榜 Top 3 + 12 个 merged PR + 代码净增 5,917 行 + 单元测试/文档/Review 记录"),
|
||||||
|
]
|
||||||
|
add_table(doc, ["项目", "内容"], meta_rows, [1700, 7660])
|
||||||
|
|
||||||
|
add_heading(doc, "1. 项目概述", 1)
|
||||||
|
add_body(doc, "本作品围绕 GitLink 平台和开源社区维护者的真实工作流,系统扩展 gitlink-cli 的 Shortcut 命令能力,覆盖 Issue 批量维护、仓库初始化、成员协作、分支治理、PR/Commit 审查、SSH Key 管理、Issue 模板管理等流程。")
|
||||||
|
add_body(doc, "核心设计原则是:功能可直接运行,写操作可预览,批量任务可审计,Agent 调用可控,PR 能被主仓库持续 Review 和合并。")
|
||||||
|
add_body(doc, "贡献口径说明:PR 提交账号为 wangyue111;进入主仓库后的 Git author / GitLink contributors 条目显示为 wangyue789。以下排名和代码量均按公开主仓库数据复核。")
|
||||||
|
|
||||||
|
add_heading(doc, "2. 评分标准对应", 1)
|
||||||
|
score_rows = [
|
||||||
|
("功能完整性", "20%", "多模块 CLI PR;每个核心 PR 包含功能代码、单元测试、README/Skill/变更说明。"),
|
||||||
|
("创新性", "20%", "不是简单搬运 OpenAPI,而是围绕维护者工作流组织 batch/dry-run/yes/结构化输出。"),
|
||||||
|
("实用价值", "20%", "解决 Issue 批量收尾、仓库初始化、成员 onboarding、分支治理、PR Review 等真实场景。"),
|
||||||
|
("文档与演示", "20%", "提供正式报告、PR 清单、演示命令、Review 记录,命令可复制复现。"),
|
||||||
|
("成果落地", "20%", "12 个 PR 已合并,多个 PR open 且 mergeable=true,包含真实线上 bug 修复。"),
|
||||||
|
]
|
||||||
|
add_table(doc, ["维度", "权重", "对应证据"], score_rows, [1500, 900, 6960])
|
||||||
|
|
||||||
|
add_heading(doc, "3. 贡献规模与仓库影响力", 1)
|
||||||
|
add_body(doc, "除 PR 数量外,本作品还应突出“已经真实进入主仓库”的贡献规模。截至 2026-07-09 复核,GitLink contributors API 显示本作品对应 Git author 位列主仓库贡献榜第 3;Git 历史显示已进入 upstream/master 的代码净增 5,917 行。")
|
||||||
|
add_body(doc, "答辩建议口径:不裸写“全仓库第一贡献者”,而是更稳妥地表述为“贡献榜 Top 3、核心外部贡献者、参赛贡献第一梯队”。如果按已合并 PR 落地数量看,12 个 merged PR 已显著高于多数外部参赛者。")
|
||||||
|
add_table(doc, ["指标", "数据", "说明"], CONTRIBUTION_METRICS, [1700, 1800, 5860])
|
||||||
|
|
||||||
|
add_heading(doc, "4. 已合并成果:12 个 PR", 1)
|
||||||
|
add_body(doc, "截至 2026-07-09,通过 GitLink PR API 复核,个人贡献中页面/API 明确 status=merged 的 PR 共 12 个。这是子赛题一“成果落地”的核心证据。")
|
||||||
|
add_table(doc, ["PR", "标题", "贡献价值"], [(f"#{n}", title, value) for n, title, value, _ in MERGED_PRS], [700, 4100, 4560])
|
||||||
|
|
||||||
|
add_heading(doc, "5. 当前主推可评审 PR", 1)
|
||||||
|
add_body(doc, "除已合并成果外,还有一批主推 PR 已 rebase 至最新 master,当前无冲突且 mergeable=true,可作为截止日前“已提交且通过验证”的成果。")
|
||||||
|
add_table(doc, ["PR", "状态", "主推理由"], [(f"#{n}", status, value) for n, _, status, value, _ in OPEN_PRS], [700, 1700, 6960])
|
||||||
|
|
||||||
|
add_heading(doc, "6. 核心技术路线", 1)
|
||||||
|
add_heading(doc, "6.1 从单点接口到维护者工作流", 2)
|
||||||
|
add_body(doc, "作品不以接口数量为唯一目标,而是把接口组织成可执行的维护者任务流。例如 #12 解决批量关闭 Issue,#165 扩展为批量更新/删除 Issue,二者共同构成 Sprint 收尾、过期 Issue 清理、批量分派和仓库治理的 CLI 闭环。")
|
||||||
|
add_heading(doc, "6.2 安全优先的批量写操作", 2)
|
||||||
|
for item in ["--dry-run:预览请求路径、请求体、目标对象,不修改线上数据。", "--yes:删除、退出等不可逆操作必须显式确认。", "参数校验:正整数 ID、枚举值、时间范围、状态字段均在本地提前校验。", "字段保留:关闭 Issue 前读取原始 subject/description,避免 PATCH 清空描述。", "结构化输出:JSON/YAML 输出便于 Agent、CI 和脚本消费。"]:
|
||||||
|
add_bullet(doc, item)
|
||||||
|
add_heading(doc, "6.3 Agent 友好的 CLI 设计", 2)
|
||||||
|
add_body(doc, "命令默认提供清晰帮助、dry-run 预览和机器可读输出,避免 Agent 在批量写入场景中直接执行不可逆操作。Skill 文档和 README 同步更新,降低自动化调用时的歧义。")
|
||||||
|
|
||||||
|
add_heading(doc, "7. Review 响应与工程质量", 1)
|
||||||
|
add_body(doc, "作品持续响应维护者 Review,而不是一次性堆功能。以下案例体现真实开源协作中的修复、rebase、冲突处理和方案收敛。")
|
||||||
|
add_table(doc, ["案例", "反馈/问题", "处理结果"], REVIEW_CASES, [1800, 3500, 4060])
|
||||||
|
|
||||||
|
add_heading(doc, "8. 演示与复现命令", 1)
|
||||||
|
add_body(doc, "以下命令用于答辩演示。建议优先使用 dry-run,既能展示请求契约,也不会修改线上数据。")
|
||||||
|
commands = [
|
||||||
|
"gitlink-cli issue +batch-close --owner wangyue111 --repo gitlink-cli --numbers 1,2 --dry-run --format json",
|
||||||
|
"gitlink-cli issue +batch-update --owner wangyue111 --repo gitlink-cli --ids 101,102 --status-id 3 --dry-run --format json",
|
||||||
|
"gitlink-cli repo +create --name demo-project --identifier demo-project --description demo --private --license-id 1 --ignore-id 1 --dry-run --format json",
|
||||||
|
"gitlink-cli member +apply --code <invite-code> --role developer --dry-run --format json",
|
||||||
|
"gitlink-cli branch +set-default --owner wangyue111 --repo gitlink-cli --name main --dry-run --format json",
|
||||||
|
]
|
||||||
|
for c in commands:
|
||||||
|
add_code(doc, c)
|
||||||
|
|
||||||
|
add_heading(doc, "9. 结论", 1)
|
||||||
|
add_body(doc, "本作品已经从“提交 PR”推进到“多项功能进入主仓库”。12 个已合并 PR 证明成果可落地;贡献榜 Top 3 和代码净增 5,917 行证明贡献不是零散提交,而是持续、可度量、已进入主仓库的工程投入。")
|
||||||
|
add_body(doc, "面向评分标准,本作品的优势在于:功能覆盖面广但不散,围绕真实维护场景组织;写操作有安全机制;文档和演示可复现;贡献规模和合并记录共同证明成果已经进入主仓库并持续可用。")
|
||||||
|
|
||||||
|
doc.save(REPORT_DOCX)
|
||||||
|
|
||||||
|
|
||||||
|
def make_markdown():
|
||||||
|
lines = []
|
||||||
|
lines.append('# gitlink-cli 功能扩展与开源协作治理能力增强参赛报告')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('> 子赛题一:扩展 CLI 功能。作品仓库:<https://gitlink.org.cn/wangyue111/gitlink-cli>')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('## 核心摘要')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('本作品围绕 GitLink 开源维护者真实工作流,扩展 gitlink-cli 的 Issue 批量维护、仓库初始化、成员协作、分支治理、PR/Commit 审查和账号配置能力。所有高风险写操作均设计 dry-run、yes 确认、参数校验和结构化输出。截至 2026-07-09,已有 12 个 PR 合并进主仓库,GitLink contributors 排名 Top 3,已进入 upstream/master 的代码净增 5,917 行,另有多个主推 PR 无冲突且 mergeable=true。')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('## 贡献规模与仓库影响力')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('> PR 提交账号为 `wangyue111`;进入主仓库后的 Git author / GitLink contributors 条目显示为 `wangyue789`。建议答辩口径使用“贡献榜 Top 3、核心外部贡献者、参赛贡献第一梯队”,避免无范围限定地写“全仓库第一贡献者”。')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('| 指标 | 数据 | 说明 |')
|
||||||
|
lines.append('|---|---:|---|')
|
||||||
|
for name, data, note in CONTRIBUTION_METRICS:
|
||||||
|
lines.append(f'| {name} | {data} | {note} |')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('## 已合并 PR')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('| PR | 标题 | 贡献价值 |')
|
||||||
|
lines.append('|---:|---|---|')
|
||||||
|
for n,title,value,url in MERGED_PRS:
|
||||||
|
lines.append(f'| [#{n}]({url}) | `{title}` | {value} |')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('## 主推待评审 PR')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('| PR | 状态 | 主推理由 |')
|
||||||
|
lines.append('|---:|---|---|')
|
||||||
|
for n,title,status,value,url in OPEN_PRS:
|
||||||
|
lines.append(f'| [#{n}]({url}) | {status} | {value} |')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('## 复现验证')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('```bash')
|
||||||
|
lines.append('git diff --check')
|
||||||
|
lines.append('GOPROXY=https://goproxy.cn,direct go test ./...')
|
||||||
|
lines.append('go vet ./...')
|
||||||
|
lines.append('```')
|
||||||
|
lines.append('')
|
||||||
|
lines.append('## 演示命令')
|
||||||
|
lines.append('')
|
||||||
|
for c in [
|
||||||
|
'gitlink-cli issue +batch-close --owner wangyue111 --repo gitlink-cli --numbers 1,2 --dry-run --format json',
|
||||||
|
'gitlink-cli issue +batch-update --owner wangyue111 --repo gitlink-cli --ids 101,102 --status-id 3 --dry-run --format json',
|
||||||
|
'gitlink-cli repo +create --name demo-project --identifier demo-project --description demo --private --license-id 1 --ignore-id 1 --dry-run --format json',
|
||||||
|
'gitlink-cli member +apply --code <invite-code> --role developer --dry-run --format json',
|
||||||
|
'gitlink-cli branch +set-default --owner wangyue111 --repo gitlink-cli --name main --dry-run --format json',
|
||||||
|
]:
|
||||||
|
lines.append('```bash')
|
||||||
|
lines.append(c)
|
||||||
|
lines.append('```')
|
||||||
|
REPORT_MD.write_text('\n'.join(lines), encoding='utf-8')
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
make_docx()
|
||||||
|
make_markdown()
|
||||||
|
print(REPORT_DOCX)
|
||||||
|
print(REPORT_MD)
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
# 大赛平台提交表单文案
|
||||||
|
|
||||||
|
## 项目名称
|
||||||
|
|
||||||
|
GitLink CLI 功能扩展与开源协作治理能力增强
|
||||||
|
|
||||||
|
## 项目简介
|
||||||
|
|
||||||
|
本作品面向 GitLink 平台和开源社区维护者的真实协作场景,系统扩展 gitlink-cli 的 Shortcut 命令能力,覆盖 Issue 批量维护、仓库初始化、成员申请/退出、分支生命周期、PR/Commit 审查、SSH Key 管理、Issue 模板管理等流程。所有高风险写操作均设计 dry-run、yes 确认、参数校验和结构化输出,便于人工维护者和 Agent 工作流安全调用。截至 2026-07-09,已有 12 个 PR 合并进 gitlink-cli 主仓库;GitLink contributors 排名 Top 3,贡献值 89、占比 8.69%;已进入 upstream/master 的 Git 历史中包含 16 个非合并提交,代码净增 5,917 行。另有多个 open PR 已 rebase 至最新 master,当前无冲突且可合并。
|
||||||
|
|
||||||
|
## 作品仓库
|
||||||
|
|
||||||
|
https://gitlink.org.cn/wangyue111/gitlink-cli
|
||||||
|
|
||||||
|
## 已合并成果
|
||||||
|
|
||||||
|
截至 2026-07-09,GitLink 页面/API 明确显示 `status=merged` 的个人贡献 PR 共 12 个:#12、#18、#24、#43、#44、#45、#57、#59、#69、#71、#120、#165。
|
||||||
|
|
||||||
|
## 贡献规模
|
||||||
|
|
||||||
|
PR 提交账号为 `wangyue111`;进入主仓库后的 Git author / contributors 条目显示为 `wangyue789`。按公开主仓库数据复核:GitLink contributors Top 3 / 55,贡献值 89、占比 8.69%;个人 PR 共 89 条,其中 12 merged、56 open、21 closed;已进入 `upstream/master` 的代码变更为 +6,543 / -626,净增 5,917 行,总变更 7,169 行。
|
||||||
|
|
||||||
|
## 主推待评审 PR
|
||||||
|
|
||||||
|
#225、#267、#268、#206、#214、#223、#224。上述 PR 已 rebase 至最新 master,当前无冲突、`mergeable=true`。
|
||||||
|
|
||||||
|
## 创新性说明
|
||||||
|
|
||||||
|
本作品不是简单搬运 OpenAPI,而是围绕开源维护者和 Agent 的真实任务流进行场景化封装。例如 Issue 批量维护链路同时支持编号语义区分、dry-run 预览、CSV 输入、字段保留和结构化结果;仓库初始化将 license、ignore、language、category、identifier 等字段组织成脚手架创建流程;分支和成员命令围绕治理生命周期设计,形成可复现、可自动化、可审计的 CLI 工作流。
|
||||||
|
|
||||||
|
## 实用价值说明
|
||||||
|
|
||||||
|
作品可直接服务 GitLink 平台仓库维护:Sprint 收尾时批量关闭/更新 Issue;新项目创建时一条命令完成仓库脚手架参数配置;社区协作中成员可申请加入或安全退出;维护者可恢复误删分支、设置默认分支、追踪 PR patchset;科研仓库可通过 repo insight、health 统计和贡献数据辅助治理。
|
||||||
|
|
||||||
|
## 测试与验证
|
||||||
|
|
||||||
|
统一执行:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git diff --check
|
||||||
|
GOPROXY=https://goproxy.cn,direct go test ./...
|
||||||
|
go vet ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
重点 PR 还执行对应命令的 `--help` 和 `--dry-run --format json` 验证。
|
||||||
Loading…
Reference in New Issue