This is an automated email from the ASF dual-hosted git repository.
gosonzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong-website.git
The following commit(s) were added to refs/heads/master by this push:
new 9afb144952 [INLONG-621][Doc] Update the how-to-commit guide (#622)
9afb144952 is described below
commit 9afb14495276b49037652483c8fed391ba936a7f
Author: Charles Zhang <[email protected]>
AuthorDate: Mon Nov 28 13:10:37 2022 +0800
[INLONG-621][Doc] Update the how-to-commit guide (#622)
---
community/how-to-commit.md | 82 ++++++++++--------
.../current/how-to-commit.md | 99 +++++++++++++---------
2 files changed, 105 insertions(+), 76 deletions(-)
diff --git a/community/how-to-commit.md b/community/how-to-commit.md
index fbf832c798..86a52d9461 100644
--- a/community/how-to-commit.md
+++ b/community/how-to-commit.md
@@ -3,35 +3,29 @@ title: How to Commit
sidebar_position: 2
---
-Apache InLong uses github's Pull Request (PR) to receive contributed code.
This document will introduce the process of code commit in detail.
-
+Apache InLong uses GitHub's Pull Request (PR) to receive contributed code.
This document will introduce the process of code commit in detail.
- InLong code base:https://github.com/apache/inlong
-
- InLong website base:https://github.com/apache/inlong-website
-## Fork the repository
+## Confirm the issue to fix
+Can be an [existing issue](https://github.com/apache/inlong/issues) or your
[newly created issue](https://github.com/apache/inlong/issues/new/choose), and
record the `Issue ID`.
-Open [apache/inlong](https://github.com/apache/inlong) 's github page,
clicking on the `fork` button at the top right to fork.
+## Fork the repository
+Open [apache/inlong](https://github.com/apache/inlong) 's GitHub page,
clicking on the `fork` button at the top right to fork.
## Configure git and commit changes
-
### Clone your fork to your local machine
-
```shell
git clone https://github.com/<your_github_name>/inlong.git
```
-After clone is completed, `origin` will linked to the remote fork address on
github by default.
-
### Add apache/inlong to local repository's remote branch upstream
-
```shell
cd inlong
git remote add upstream https://github.com/apache/inlong.git
```
### Check remote repository settings
-
```shell
git remote -v
origin https://github.com/<your_github_name>/inlong.git (fetch)
@@ -39,50 +33,66 @@ origin
https://github.com/<your_github_name>/inlong.git(push)
upstream https://github.com/apache/inlong.git (fetch)
upstream https://github.com/apache/inlong.git (push)
```
-
-There will be two repositories: `origin` (own repository) and `upstream`
(official repository).
+:::note
+origin is its own fork repository, upstream is the official repository
+:::
### Fetch code from upstream and update the local master branch code to the
latest
-
```shell
git fetch upstream
git pull upstream master
```
### Create a new branch
-> Generally, issue id is used as the branch name, such as: INLONG-123
-
+Generally, issue id is used as the branch name, such as: INLONG-XYZ.
```shell
-git checkout -b INLONG-123
+git checkout -b INLONG-XYZ
```
+:::caution
+Make sure that the branch `INLONG-XYZ` is checkout from the latest code of the
official master branch.
+:::
-**Make sure that the branch `INLONG-123` is building successfully on the
latest code of the official master branch**
-
-After the branch is created, you can start coding.
+### Modify the code and format
+After modifying the code, you can format it with the following command.
+```shell
+mvn spotless:check
+mvn spotless:apply
+```
### Commit code to remote branch
-> The format of the commit message must be consistent with the issue title and
start with `[issue id]`, such as `[INLONG-123] xxx`:
+The format of the commit message must be consistent with the issue title and
start with `[INLONG-XYZ][Component]`.
```shell
-git commit -a -m "[INLONG-123] xxx"
-git push origin INLONG-123
+git commit -a -m "[INLONG-XYZ][Component] commit msg"
+git push origin INLONG-XYZ
```
+:::note
+`Component` should be replaced by the InLong component name, like Manager,
Sort, DataProxy...
+:::
## Open a Pull Request
-### Open your github repository page
- `https://github.com/<your_github_name>/inlong`
+### Open your GitHub repository page
+```shell
+https://github.com/<your_github_name>/inlong
+```
+
### Switch branch
- Switch to committed branch `INLONG-123`
-### New pull request
- Click `New pull request` or `Compare & pull request`
+Switch to committed branch `INLONG-XYZ`
+
+### New pull request(PR)
+Click `New pull request` or `Compare & pull request`
+
### Click `Create pull request` button to open a PR
- Considerations when opening a pull request:
- 1. The title of PR must start with issue id, which is better consistent
with the commit message
- 2. You can fill in some description information or not
- 3. If a code conflict is prompted after clicking `Create pull request` ,
please synchronize the code of the `INLONG-123` branch with the master branch
and commit it
+Considerations when opening a pull request:
+- he title of PR must start with issue id, which is better consistent with the
commit message
+- To speed up the review, it is recommended to supplement the necessary
information according to the submission template, such as modification
motivation, implementation details, etc.
-## Code Review
-After creating PR, everyone can review your code and may discuss some
implementation details with you, and you may need to modify them further.
+:::note
+Enter the [apache/inlong](https://github.com/apache/inlong) home page, and a
pop-up window for Pull Request will appear, or you can directly click to create
it.
+:::
-**Generally, the PR can be formally merged into the code base only after more
than 2 PMC/Committer reply + 1.**
+## Review Code
+:::note
+Generally, the PR can be formally merged into the code base only after more
than 2 PMC/Committer reply + 1.
+:::
-Finally, congratulations on becoming an official contributor to InLong!
\ No newline at end of file
+Finally, congratulations on becoming an official contributor to InLong!
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs-community/current/how-to-commit.md
b/i18n/zh-CN/docusaurus-plugin-content-docs-community/current/how-to-commit.md
index 9d6598e80f..cffcf6af70 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs-community/current/how-to-commit.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs-community/current/how-to-commit.md
@@ -3,30 +3,28 @@ title: 如何提交代码
sidebar_position: 2
---
-Apache InLong使用Github的Pull Request (PR)来接收贡献的代码,本文将详细介绍提交代码的详细流程。
+Apache InLong 使用 Github 的 Pull Request (PR) 来接收贡献的代码,本文将介绍提交代码的详细流程。
+- InLong 代码库:https://github.com/apache/inlong
+- InLong 官网库:https://github.com/apache/inlong-website
-- InLong代码库:https://github.com/apache/inlong
+## 确定要处理的 Issue
+可以是[已经存在的 Issue](https://github.com/apache/inlong/issues),或者是你[新创建的
issue](https://github.com/apache/inlong/issues/new/choose),并记录 `Issue ID`。
-- InLong官网库:https://github.com/apache/inlong-website
-
-## Fork仓库
-
-进入 [apache/inlong](https://github.com/apache/inlong) 的Github页面 ,点击右上角按钮 `Fork`
进行 Fork。如下图所示:
-
-
-## 配置git和提交修改
+## Fork 仓库
+进入 [apache/inlong](https://github.com/apache/inlong) 的 Github 页面 ,点击右上角按钮
`Fork`。
+## 配置 Git 和提交修改
### 将代码克隆到本地
```shell
git clone https://github.com/<your_github_name>/inlong.git
```
-clone完成后,origin会默认指向github上的远程fork地址。
-### 将 apache/inlong 添加为本地仓库的远程分支upstream
+### 将 apache/inlong 添加为本地仓库的远程分支 upstream
```shell
cd inlong
git remote add upstream https://github.com/apache/inlong.git
```
+
### 检查远程仓库设置
```shell
git remote -v
@@ -35,45 +33,66 @@ origin
https://github.com/<your_github_name>/inlong.git(push)
upstream https://github.com/apache/inlong.git (fetch)
upstream https://github.com/apache/inlong.git (push)
```
-此时会有两个仓库:origin(自己的仓库)和upstream(官方的仓库)
+:::note
+origin 为自己 fork 的仓库,upstream 为官方的仓库
+:::
-### 获取upstream仓库代码,并更新本地master分支代码为最新
+### 获取 upstream 仓库代码,并更新本地 master 分支代码为最新
```shell
git fetch upstream
git pull upstream master
```
+
### 新建分支
-> 一般以issue id作为分支名,如:INLONG-123
+一般以`INLONG-[Issue ID]`作为分支名,比如:INLONG-XYZ
```shell
-git checkout -b INLONG-123
+git checkout -b INLONG-XYZ
```
-**确保分支`INLONG-123`是基于官方master分支的最新代码**
+:::caution
+如果是处理新的 issue,需确保分支`INLONG-XYZ`是基于官方 master 分支的最新代码
+:::
-分支创建完成后即可进行代码更改。
+### 修改代码并格式化
+修改完代码,可以通过以下命令进行格式化。
+```shell
+mvn spotless:check
+mvn spotless:apply
+```
### 提交代码到远程分支
-> commit 信息的格式必须与Issue标题保持一致且以`[issue id]`开头,即:`[INLONG-123] xxx`
+commit 信息的格式必须与Issue标题保持一致且以`[INLONG-XYZ][Component]`开头。
```shell
-git commit -a -m "[INLONG-123] xxx"
-git push origin INLONG-123
+git commit -a -m "[INLONG-XYZ][Component] commit msg"
+git push origin INLONG-XYZ
```
-## 创建PR
-### 打开自己的github仓库页面
- https://github.com/<your_github_name>/inlong
+:::note
+`Component` 使用 InLong 组件名称进行替换,比如Manager、Sort、DataProxy...
+:::
+
+## 创建 PR
+### 打开自己的 GitHub 仓库页面
+```shell
+https://github.com/<your_github_name>/inlong
+```
+
### 切换分支
- 切换到提交的分支 `INLONG-123`
-### 创建新PR
- 点击 `New pull request`或者`Compare & pull request`
-### 点击`Create pull request`按钮进行创建PR
- 需要注意以下几点:
- 1. PR的标题必须以issue id开头,最好与commit信息保持一致
- 2. 可以填写部分描述信息也可以不填
- 3. 如果点击`Create pull request`后提示代码冲突,则请将`INLONG-123`分支的代码
- 与master分支同步一致后在进行提交
-
-
-## Review代码
-创建完PR后,所有的人都可以Review代码,可能会与您讨论一些实现的细节,可能还需要你进一步修改。
-**一般该PR必须有2位以上的社区PMC/Committer +1后,才可能正式合入官方代码库。**
-
-最后,恭喜您已经成为了InLong的官方贡献者了!
+切换到提交的分支 `INLONG-XYZ`
+
+### 创建新的 pull request(即 PR)
+点击 `New pull request`或者`Compare & pull request`
+
+### 点击`Create pull request`按钮进行创建 PR
+需要注意以下几点:
+- PR 的标题必须以`[INLONG-XYZ][Component]`开头,最好与commit信息保持一致
+- 为了加速 Review 速度,建议按提交模板,补充必要的信息,比如修改动机、实现细节等
+
+:::note
+进入 [apache/inlong](https://github.com/apache/inlong) 首页,会出现 Pull Request
的弹窗,也可以直接点击进行创建。
+:::
+
+## Review 代码
+:::note
+一般该PR必须有 2 位以上的社区 PMC/Committer +1后,才可能正式合入官方代码库。
+:::
+
+最后,恭喜您已经成为了 Apache InLong 的官方贡献者了!