Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add dco / rerere doc #784

Merged
merged 6 commits into from
Nov 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
以下展示的是 TiDB 社区当中较为常用的一些组件或插件,其中名称以 `ti-community-` 开头的外部插件是 TiDB 社区 [Community Infra SIG](https://developer.tidb.io/SIG/community-infra) 开发并正在维护的插件。如果你在使用过程中遇到任何问题,你都可以在 [Slack](https://slack.tidb.io/invite?team=tidb-community&channel=sig-community-infra&ref=github) 当中与我们取得联系。

| 插件名称 | 插件类型 | 功能简介 |
| ------------------------------- | -------- | --------------------------------------------------------------------------------------------- |
|---------------------------------|----------|-----------------------------------------------------------------------------------------------|
| tide | 基础组件 | 通过一些给定条件来管理 GitHub PR 池,自动合并符合条件的 PR。 |
| rerere | 基础组件 | 将代码 push 到专门用来重新测试的分支上进行重新测试。 |
| ti-community-owners | 外部插件 | 根据 SIG 或 Github 权限等信息来确定 PR 的 reviewer 和 committer。 |
Expand All @@ -28,7 +28,7 @@
| ti-community-label-blocker | 外部插件 | 主要负责阻止用户对某些敏感标签的进行非法操作。 |
| ti-community-label-contribution | 外部插件 | 主要负责为外部贡献者的 PR 添加 `contribution` 或 `first-time-contributor` 标签。 |
| ti-community-cherrypicker | 外部插件 | 主要负责将 PR cherry-pick 到其他目标分支。 |
| ti-community-format-checker | 外部插件 | 主要负责将 PR 或 Issue 的标题、内容以及提交信息的格式进行检查。 |
| ti-community-format-checker | 外部插件 | 主要负责将 PR 或 Issue 的标题、内容以及提交信息的格式进行检查。 |
| needs-rebase | 外部插件 | 当 PR 需要进行 rebase 时,通过添加标签或添加评论提醒 PR 作者进行 rebase。 |
| require-matching-label | 内置插件 | 当 PR 或 Issue 缺失相关标签时,通过添加标签或评论提醒贡献者进行补充。 |
| hold | 内置插件 | 通过 `/[un]hold` 命令,添加或取消 PR 的不可合并状态。 |
Expand All @@ -38,6 +38,7 @@
| wip | 内置插件 | 为正在开发的 PR 添加 `do-not-merge/work-in-progress` 标签,阻止自动分配 reviewer 和 PR 合并。 |
| welcome | 内置插件 | 通过机器人向首次贡献的贡献者发送欢迎语。 |
| release-note | 内置插件 | 主要负责检测 PR 是否添加了发布说明。 |
| dco | 内置插件 | 检查 PR 的所有 commit 是否都签署邮箱地址。 |
| label_sync | 工具 | 能够将 yaml 文件当中配置的标签同步到一个或多个仓库。 |
| autobump | 工具 | 通过自动提交 Pull Request 的方式更新上游 Prow 及其相关组件和插件的版本。 |

Expand Down
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [assign](plugins/assign.md)
- [milestone](plugins/milestone.md)
- [release-note](plugins/release-note.md)
- [dco](plugins/dco.md)
- [工具](tools.md)
- [label_sync](tools/label_sync.md)
- [autobump](tools/autobump.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/components/rerere.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

为了解决上述问题我们开发了 [tars](plugins/tars.md) 来自动的合并最新 的 Base 分支到 PR,这样能解决问题,但是对于大型仓库来说这不是一个高效的解决方案。**例如有 n 个同时可以 merge 的 PR,那就要跑 O(n^2) 次测试,大大浪费了 CI 资源。**

为了高效的合并 PR,并且节省测试资源,我们提出了[多个解决方案](https://github.com/ti-community-infra/rfcs/discussions/13)。最终决定利用 Prow Job 结合 Tide 来解决该问题。
为了高效的合并 PR,并且节省测试资源,我们提出了[多个解决方案](https://github.com/ti-community-infra/rfcs/discussions/13) 。最终决定利用 Prow Job 结合 Tide 来解决该问题。

## 设计思路

1. Prow Job 会利用 [clonerefs](https://github.com/kubernetes/test-infra/tree/master/prow/clonerefs) 工具将 PR 和最新的 Base 分支合并之后克隆到运行测试的 Pod,所以我们总是能够获取到已经合并了最新 Base 的代码库,rerere 可以将该代码 push 到重新测试分支进行合并之前的测试。
2. Porw Job 可以设置 max_concurrency 来控制该 CI 任务最多的执行个数,这是一个天然的 FIFO 队列,我们可以利用该功能对重新测试任务排队。
2. Porw Job 可以设置 `max_concurrency` 来控制该 CI 任务最多的执行个数,这是一个天然的 FIFO 队列,我们可以利用该功能对重新测试任务排队。
3. Tide 在代码合并之前,会检测所有的 Prow Job 是否都使用了最新的 Base 进行了测试。如果当前 CI Pod 使用的不是最新的 Base,Tide 会自动重新触发该测试,这样就确保了所有的 PR 在合并之前都会用最新的 Base 重新测试。
4. 在 rerere 中我们会将代码 push 到指定的测试分支,然后定期检查要求的 CI 是否都已经通过,当所有要求的 CI 都通过时,我们 rerere 的 Prow Job 就会通过测试。Tide 则会自动合并当前 PR。

Expand Down
52 changes: 27 additions & 25 deletions docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,33 @@ The TiDB community has customized a number of its own plugins based on this feat

The following shows some commonly used components or plugins in the TiDB community. The external plugins whose name begin with `ti-community-` are developed and maintained by the [Community Infra SIG](https://developer.tidb.io/SIG/community-infra) of TiDB community. If you encounter any problems during use, you can contact us in [Slack](https://slack.tidb.io/invite?team=tidb-community&channel=sig-community-infra&ref=github).

| plugin name | plugin type | introduction |
|-----------------------------|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| tide | basic component | Manage the GitHub PR pool through some given conditions and automatically merge PR that meets the conditions. |
| ti-community-owners | external plugin | Determine the reviewer and committer of the PR based on information such as SIG or Github permissions. |
| ti-community-lgtm | external plugin | Add, update or delete the `status/LGT*` label by submitting Approve or Request Changes review. |
| ti-community-merge | external plugin | Add or delete the `status/can-merge` label for PR by command. |
| ti-community-blunderbuss | external plugin | Mainly responsible for automatically assigning reviewers based on SIG or Github permissions. |
| ti-community-autoresponder | external plugin | Automatically reply based on the content of the comment. |
| ti-community-tars | external plugin | Mainly responsible for automatically merging the main branch into the current PR to ensure that the current PR's Base is kept up to date. |
| ti-community-label | external plugin | Add labels to PR or Issue via commands. |
| ti-community-label-blocker | external plugin | Mainly responsible for preventing users from illegal operations on certain sensitive labels. |
| ti-community-contribution | external plugin | Mainly responsible for adding `contribution` or `first-time-contributor` labels to the PRs of external contributors. |
| ti-community-cherrypicker | external plugin | Mainly responsible for cherry-pick PR to other target branches. |
| ti-community-format-checker | external plugin | Mainly responsible for checking the title, content and format of the commit message of the PR or issue. |
| needs-rebase | external plugin | When the PR needs to rebase, add labels or add comments to remind the PR author to rebase. |
| require-matching-label | internal plugin | When a PR or Issue lacks a relevant label, add a label or comment to remind contributors to supplement. |
| hold | internal plugin | Add or cancel the non-combinable status of PR through the `/[un]hold` command. |
| assign | internal plugin | Add or cancel the assignee of PR or Issue through the `/[un]assign` command. |
| size | internal plugin | Evaluate the size of the PR based on the number of lines of code modification, and label the PR with `size/*`. |
| lifecycle | internal plugin | Use labels to mark the life cycle of Issue or PR. |
| wip | internal plugin | Add the `do-not-merge/work-in-progress` label to the PR under development to prevent the automatic assignment of reviewer and PR merge. |
| welcome | internal plugin | Send a welcome message to contributors who have contributed for the first time through a robot. |
| release-note | internal plugin | It is mainly responsible for detecting whether a PR has added a release note. |
| label_sync | tool | Able to synchronize the labels configured in the yaml file to one or more repositories. |
| autobump | tool | Update the version of upstream Prow and its related components and plugins by automatically submitting Pull Requests. |
| plugin name | plugin type | introduction |
|-----------------------------|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| tide | basic component | Manage the GitHub PR pool through some given conditions and automatically merge PR that meets the conditions. |
| rerere | basic component | Push the code to a branch dedicated to re-testing for re-testing. |
| ti-community-owners | external plugin | Determine the reviewer and committer of the PR based on information such as SIG or Github permissions. |
| ti-community-lgtm | external plugin | Add, update or delete the `status/LGT*` label by submitting Approve or Request Changes review. |
| ti-community-merge | external plugin | Add or delete the `status/can-merge` label for PR by command. |
| ti-community-blunderbuss | external plugin | Mainly responsible for automatically assigning reviewers based on SIG or Github permissions. |
| ti-community-autoresponder | external plugin | Automatically reply based on the content of the comment. |
| ti-community-tars | external plugin | Mainly responsible for automatically merging the main branch into the current PR to ensure that the current PR's Base is kept up to date. |
| ti-community-label | external plugin | Add labels to PR or Issue via commands. |
| ti-community-label-blocker | external plugin | Mainly responsible for preventing users from illegal operations on certain sensitive labels. |
| ti-community-contribution | external plugin | Mainly responsible for adding `contribution` or `first-time-contributor` labels to the PRs of external contributors. |
| ti-community-cherrypicker | external plugin | Mainly responsible for cherry-pick PR to other target branches. |
| ti-community-format-checker | external plugin | Mainly responsible for checking the title, content and format of the commit message of the PR or issue. |
| needs-rebase | external plugin | When the PR needs to rebase, add labels or add comments to remind the PR author to rebase. |
| require-matching-label | internal plugin | When a PR or Issue lacks a relevant label, add a label or comment to remind contributors to supplement. |
| hold | internal plugin | Add or cancel the non-combinable status of PR through the `/[un]hold` command. |
| assign | internal plugin | Add or cancel the assignee of PR or Issue through the `/[un]assign` command. |
| size | internal plugin | Evaluate the size of the PR based on the number of lines of code modification, and label the PR with `size/*`. |
| lifecycle | internal plugin | Use labels to mark the life cycle of Issue or PR. |
| wip | internal plugin | Add the `do-not-merge/work-in-progress` label to the PR under development to prevent the automatic assignment of reviewer and PR merge. |
| welcome | internal plugin | Send a welcome message to contributors who have contributed for the first time through a robot. |
| release-note | internal plugin | It is mainly responsible for detecting whether a PR has added a release note. |
| dco | internal plugin | Check whether all commits of the PR have signed off by email addresses. |
| label_sync | tool | Able to synchronize the labels configured in the yaml file to one or more repositories. |
| autobump | tool | Update the version of upstream Prow and its related components and plugins by automatically submitting Pull Requests. |

At the same time, you can find all currently available components or plugins in [Plugins](https://prow.tidb.io/plugins) page, or in [Command](https://prow.tidb.io/command-help) to view the commands available in the specified repository.

Expand Down
2 changes: 2 additions & 0 deletions docs/en/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- [Components](en/components.md)
- [Tide](en/components/tide.md)
- [rerere](en/components/rerere.md)
- [Plugins](en/plugins.md)
- External
- [ti-community-owners](en/plugins/owners.md)
Expand All @@ -21,6 +22,7 @@
- [assign](en/plugins/assign.md)
- [milestone](en/plugins/milestone.md)
- [release-note](en/plugins/release-note.md)
- [dco](en/plugins/dco.md)
- [tools](tools.md)
- [label_sync](en/tools/label_sync.md)
- [autobump](en/tools/autobump.md)
Expand Down
Loading