English | 中文 |
---|
在分析开发工作产生代码量时,常常需要知道两个版本之间产生了多少个 commit。本插件基于数据库中存储的 commits 父子关系信息,提供了计算两个 ref(branch/tag) 之间相差 commits 列表的能力。计算的结果回存于数据库中,方便后续的交叉分析。
本插件基于领域层数据进行数据增强,无需额外配置。
为了触发数据增强,您需要在 Pipeline 中加入一个新的任务
commits
表和 refs
的数据已经正确收集,refs
表应含有类似下面的数据:id ref_type github:GithubRepository:384111310:refs/tags/0.3.5 TAG github:GithubRepository:384111310:refs/tags/0.3.6 TAG github:GithubRepository:384111310:refs/tags/0.5.0 TAG github:GithubRepository:384111310:refs/tags/v0.0.1 TAG github:GithubRepository:384111310:refs/tags/v0.2.0 TAG github:GithubRepository:384111310:refs/tags/v0.3.0 TAG github:GithubRepository:384111310:refs/tags/v0.4.0 TAG github:GithubRepository:384111310:refs/tags/v0.6.0 TAG github:GithubRepository:384111310:refs/tags/v0.6.1 TAG
curl -v -XPOST http://localhost:8080/pipelines --data @- <<'JSON' { "name": "test-refdiff", "tasks": [ [ { "plugin": "refdiff", "options": { "repoId": "github:GithubRepository:384111310", "pairs": [ { "newRef": "refs/tags/v0.6.0", "oldRef": "refs/tags/0.5.0" }, { "newRef": "refs/tags/0.5.0", "oldRef": "refs/tags/0.4.0" } ], "tasks": [ "calculateCommitsDiff", "calculateIssuesDiff", "calculatePrCherryPick", ] } } ] ] } JSON