Skip to content

Commit 51d224f

Browse files
committed
optimize: add contrbuting_CN doc
Signed-off-by: slievrly <slievrly@163.com>
1 parent 6ae23fa commit 51d224f

File tree

2 files changed

+215
-11
lines changed

2 files changed

+215
-11
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to Apache Seata(incubating)
22

3-
It is warmly welcomed if you have interest to hack on Seata. First, we encourage this kind of willing very much. And here is a list of contributing guide for you.
3+
It is warmly welcomed if you have interest to hack on Apache Seata(incubating). First, we encourage this kind of willing very much. And here is a list of contributing guide for you.
44

55
[[中文贡献文档](./CONTRIBUTING_CN.md)]
66

@@ -15,11 +15,11 @@ It is warmly welcomed if you have interest to hack on Seata. First, we encourage
1515

1616
## Reporting security issues
1717

18-
Security issues are always treated seriously. As our usual principle, we discourage anyone to spread security issues. If you find a security issue of Seata, please do not discuss it in public and even do not open a public issue. Instead we encourage you to send us a private email to [dev-seata@googlegroups.com](mailto:dev-seata@googlegroups.com) to report this.
18+
Security issues are always treated seriously. As our usual principle, we discourage anyone to spread security issues. If you find a security issue of Apache Seata(incubating), please do not discuss it in public and even do not open a public issue. Instead we encourage you to send us a private email to [private@seata.apache.org](mailto:private@seata.apache.org) to report this.
1919

2020
## Reporting general issues
2121

22-
To be honest, we regard every user of Seata as a very kind contributor. After experiencing Seata, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/seata/seata/issues/new/choose).
22+
To be honest, we regard every user of Seata as a very kind contributor. After experiencing Seata, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/apache/incubator-seata/issues/new/choose).
2323

2424
Since we collaborate project Seata in a distributed way, we appreciate **WELL-WRITTEN**, **DETAILED**, **EXPLICIT** issue reports. To make the communication more efficient, we wish everyone could search if your issue is an existing one in the searching list. If you find it existing, please add your details in comments under the existing issue instead of opening a brand new one.
2525

@@ -70,32 +70,32 @@ Since you are ready to improve Seata with a PR, we suggest you could take a look
7070

7171
To put forward a PR, we assume you have registered a GitHub ID. Then you could finish the preparation in the following steps:
7272

73-
1. **FORK** Seata to your repository. To make this work, you just need to click the button Fork in right-left of [seata/seata](https://github.com/seata/seata) main page. Then you will end up with your repository in `https://github.com/<your-username>/seata`, in which `your-username` is your GitHub username.
73+
1. **FORK** Seata to your repository. To make this work, you just need to click the button Fork in right-left of [apache/incubator-seata](https://github.com/apache/incubator-seata) main page. Then you will end up with your repository in `https://github.com/<your-username>/incubator-seata`, in which `your-username` is your GitHub username.
7474

75-
1. **CLONE** your own repository to develop locally. Use `git clone git@github.com:<your-username>/seata.git` to clone repository to your local machine. Then you can create new branches to finish the change you wish to make.
75+
1. **CLONE** your own repository to develop locally. Use `git clone git@github.com:<your-username>/incubator-seata.git` to clone repository to your local machine. Then you can create new branches to finish the change you wish to make.
7676

77-
1. **Set Remote** upstream to be `git@github.com:seata/seata.git` using the following two commands:
77+
1. **Set Remote** upstream to be `git@github.com:apache/incubator-seata.git` using the following two commands:
7878

7979
```bash
80-
git remote add upstream git@github.com:seata/seata.git
80+
git remote add upstream git@github.com:apache/incubator-seata.git
8181
git remote set-url --push upstream no-pushing
8282
```
8383

8484
With this remote setting, you can check your git remote configuration like this:
8585

8686
```shell
8787
$ git remote -v
88-
origin git@github.com:<your-username>/seata.git (fetch)
89-
origin git@github.com:<your-username>/seata.git (push)
90-
upstream git@github.com:seata/seata.git (fetch)
88+
origin git@github.com:<your-username>/incubator-seata.git (fetch)
89+
origin git@github.com:<your-username>/incubator-seata.git (push)
90+
upstream git@github.com:apache/incubator-seata.git (fetch)
9191
upstream no-pushing (push)
9292
```
9393

9494
Adding this, we can easily synchronize local branches with upstream branches.
9595

9696
### Branch Definition
9797

98-
Right now we assume every contribution via pull request is for [branch develop](https://github.com/seata/seata/tree/develop) in Seata. Before contributing, be aware of branch definition would help a lot.
98+
Right now we assume every contribution via pull request is for [branch develop](https://github.com/apache/incubator-seata/tree/2.x) in Seata. Before contributing, be aware of branch definition would help a lot.
9999

100100
As a contributor, keep in mind again that every contribution via pull request is for branch develop. While in project Seata, there are several other branches, we generally call them release branches(such as 0.6.0,0.6.1), feature branches, hotfix branches and master branch.
101101

CONTRIBUTING_CN.md

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# 为 Apache Seata(incubating) 做贡献
2+
3+
如果你有兴趣寻找关于Apache Seata(incubating)的漏洞,我们会热烈欢迎。首先,我们非常鼓励这种意愿。这是为您提供的贡献指南列表。
4+
5+
[[English Contributing Document](./CONTRIBUTING.md)]
6+
7+
## 话题
8+
9+
* [报告安全问题](#报告安全问题)
10+
* [报告一般问题](#报告一般问题)
11+
* [代码和文档贡献](#代码和文档贡献)
12+
* [测试用例贡献](#测试用例贡献)
13+
* [参与帮助任何事情](#参与帮助任何事情)
14+
* [代码风格](#代码风格)
15+
16+
## 报告安全问题
17+
18+
安全问题总会认真对待。通常,我们不鼓励任何人传播安全问题。如果您发现Apache Seata(incubating)的安全问题,请不要公开讨论,甚至不要公开问题。相反,我们鼓励您向 [private@seata.apache.org](mailto:private@seata.apache.org) 发送私人电子邮件 以报告此情况。
19+
20+
## 报告一般问题
21+
22+
老实说,我们认为每一个 Seata 用户都是非常好的贡献者。在体验了 Seata 之后,您可能会对项目有一些反馈。那么随时可以通过 [NEW ISSUE](https://github.com/apache/incubator-seata/issues/new/choose) 来提交。
23+
24+
由于我们通过分布式方式协作Seata,我们欣赏高质量,详细的,准确的问题报告。为了让沟通更高效,我们希望每个人都可以搜索下您的问题是否在搜索列表中。如果您发现它存在,请在现有问题评论中添加您的详细信息,而不是打开一个全新的问题。
25+
26+
为了使问题细节尽可能标准,我们为问题报告者提供了一个[问题模板](./.github/ISSUE_TEMPLATE) 请务必按照说明填写模板中的字段。
27+
28+
遇到以下情况你可以新建一个问题:
29+
30+
* 错误报告
31+
* 功能要求
32+
* 性能问题
33+
* 功能提案
34+
* 功能设计
35+
* 需要帮助
36+
* 文档不完整
37+
* 测试改进
38+
* 关于项目的任何问题
39+
* 等等
40+
41+
另外我们必须提醒的是,在填写新问题时,请记得从您的帖子中删除敏感数据。敏感数据可能是密码、密钥、网络位置、私人业务数据等。
42+
43+
## 代码和文档贡献
44+
45+
鼓励采取一切使 Seata 项目变得更好的行动。在 GitHub 上,Seata 的每项改进都可以通过 PR(Pull Request的缩写)实现。
46+
47+
* 如果您发现错别字,请尝试修复它!
48+
* 如果您发现bug,请尝试修复它!
49+
* 如果您发现一些冗余的代码,请尝试删除它们!
50+
* 如果您发现缺少一些测试用例,请尝试添加它们!
51+
* 如果您可以增强功能,请**不要**犹豫!
52+
* 如果您发现代码晦涩难懂,请尝试添加注释以使其更加易读!
53+
* 如果您发现代码丑陋,请尝试重构它!
54+
* 如果您能帮助改进文档,那就再好不过了!
55+
* 如果您发现文档不正确,只需执行并修复它!
56+
* ...
57+
58+
实际上不可能完全罗列所有场景。但记住一个原则:
59+
60+
> 我们期待您的任何PR。
61+
62+
现在您已准备好通过 PR 改进 Seata,我们建议您可以看看这里罗列的 PR 规则。
63+
64+
* [工作区准备](#工作区准备)
65+
* [分支定义](#分支定义)
66+
* [提交规则](#提交规则)
67+
* [PR说明](#PR说明)
68+
69+
### 工作区准备
70+
71+
为了提出 PR,我们假设你已经注册了一个 GitHub ID。然后您可以通过以下步骤完成准备工作:
72+
73+
1. **FORK** Seata 到您的仓库。要完成这项工作,您只需单击 [apache/incubator-seata](https://github.com/apache/incubator-seata) 主页右侧的 Fork 按钮。然后你将得到以你的仓库为路径的项目地址:`https://github.com/<your-username>/incubator-seata`,其中your-username是你的 GitHub 用户名。
74+
75+
2. **克隆** 您自己的存储库以在本地开发. 使用 `git clone git@github.com:<your-username>/incubator-seata.git` 将存储库克隆到本地计算机。 然后您可以创建新分支来完成您希望进行的更改。
76+
77+
3. **设置远程** 将上游设置为 `git@github.com:apache/incubator-seata.git` 使用以下两个命令:
78+
79+
```bash
80+
git remote add upstream git@github.com:apache/incubator-seata.git
81+
git remote set-url --push upstream no-pushing
82+
```
83+
84+
使用此远程设置,您可以像这样检查您的 git 远程配置:
85+
86+
```shell
87+
$ git remote -v
88+
origin git@github.com:<your-username>/incubator-seata.git (fetch)
89+
origin git@github.com:<your-username>/incubator-seata.git (push)
90+
upstream git@github.com:apache/incubator-seata.git (fetch)
91+
upstream no-pushing (push)
92+
```
93+
94+
添加这个,我们可以轻松地将本地分支与上游分支同步。
95+
96+
### 分支定义
97+
98+
现在我们假设通过拉取请求的每个贡献都是针对Seata 中的 [开发分支](https://github.com/apache/incubator-seata/tree/2.x) 。在贡献之前,请注意分支定义会很有帮助。
99+
100+
作为贡献者,请再次记住,通过拉取请求的每个贡献都是针对分支开发的。而在Seata项目中,还有其他几个分支,我们一般称它们为release分支(如0.6.0、0.6.1)、feature分支、hotfix分支和master分支。
101+
102+
当正式发布一个版本时,会有一个发布分支并以版本号命名。
103+
104+
在发布之后,我们会将发布分支的提交合并到主分支中。
105+
106+
当我们发现某个版本有bug时,我们会决定在以后的版本中修复它,或者在特定的hotfix版本中修复它。当我们决定修复hotfix版本时,我们会根据对应的release分支checkout hotfix分支,进行代码修复和验证,合并到开发分支和master分支。
107+
108+
对于较大的功能,我们将拉出功能分支进行开发和验证。
109+
110+
111+
### 提交规则
112+
113+
实际上,在 Seata 中,我们在提交时会认真对待两条规则:
114+
115+
* [提交消息](#提交消息)
116+
* [提交内容](#提交内容)
117+
118+
#### 提交消息
119+
120+
提交消息可以帮助审稿人更好地理解提交 PR 的目的是什么。它还可以帮助加快代码审查过程。我们鼓励贡献者使用显式的提交信息,而不是模糊的信息。一般来说,我们提倡以下提交消息类型:
121+
122+
* docs: xxxx. For example, "docs: add docs about Seata cluster installation".
123+
* feature: xxxx.For example, "feature: support oracle in AT mode".
124+
* bugfix: xxxx. For example, "bugfix: fix panic when input nil parameter".
125+
* refactor: xxxx. For example, "refactor: simplify to make codes more readable".
126+
* test: xxx. For example, "test: add unit test case for func InsertIntoArray".
127+
* 其他可读和显式的表达方式。
128+
129+
另一方面,我们不鼓励贡献者通过以下方式提交消息:
130+
131+
* ~~修复错误~~
132+
* ~~更新~~
133+
* ~~添加文档~~
134+
135+
如果你不知道该怎么做,请参阅 [如何编写 Git 提交消息](http://chris.beams.io/posts/git-commit/) 作为开始。
136+
137+
#### 提交内容
138+
139+
提交内容表示一次提交中包含的所有内容更改。我们最好在一次提交中包含可以支持审阅者完整审查的内容,而无需任何其他提交的帮助。换句话说,一次提交中的内容可以通过 CI 以避免代码混乱。简而言之,我们需要牢记三个小规则:
140+
141+
* 避免在提交中进行非常大的更改;
142+
* 每次提交都完整且可审查。
143+
* 提交时检查 git config(`user.name`, `user.email`) 以确保它与您的 GitHub ID 相关联。
144+
145+
```bash
146+
git config --get user.name
147+
git config --get user.email
148+
```
149+
150+
* 提交pr时,请在'changes/'文件夹下的XXXmd文件中添加当前更改的简要说明
151+
152+
153+
另外,在代码变更部分,我们建议所有贡献者阅读Seata的 [代码风格](#代码风格)
154+
155+
无论是提交信息,还是提交内容,我们都更加重视代码审查。
156+
157+
158+
### PR说明
159+
160+
PR 是更改 Seata 项目文件的唯一方法。为了帮助审查人更好地理解你的目的,PR 描述不能太详细。我们鼓励贡献者遵循 [PR 模板](./.github/PULL_REQUEST_TEMPLATE.md) 来完成拉取请求。
161+
162+
## 测试用例贡献
163+
164+
任何测试用例都会受到欢迎。目前,Seata 功能测试用例是高优先级的。
165+
166+
* 对于单元测试,您需要在同一模块的 test 目录中创建一个名为 xxxTest.java 的测试文件。推荐你使用junit5 UT框架
167+
168+
* 对于集成测试,您可以将集成测试放在 test 目录或 seata-test 模块中。推荐使用mockito测试框架。
169+
170+
## 参与帮助任何事情
171+
172+
我们选择 GitHub 作为 Seata 协作的主要场所。所以Seata的最新更新总是在这里。尽管通过 PR 贡献是一种明确的帮助方式,但我们仍然呼吁其他方式。
173+
174+
* 如果可以的话,回复别人的问题;
175+
* 帮助解决其他用户的问题;
176+
* 帮助审查他人的 PR 设计;
177+
* 帮助审查其他人在 PR 中的代码;
178+
* 讨论 Seata 以使事情更清楚;
179+
* 在Github之外宣传Seata技术;
180+
* 写关于 Seata 的博客等等。
181+
182+
183+
## 代码风格
184+
185+
Seata 代码风格 符合阿里巴巴 Java 编码指南。
186+
187+
188+
### 指南
189+
[阿里巴巴Java代码指南](https://alibaba.github.io/Alibaba-Java-Coding-Guidelines/)
190+
191+
192+
### IDE插件安装(非必须)
193+
194+
*没有必要安装,如果你想在编码的时候发现问题。*
195+
196+
197+
#### idea IDE
198+
[p3c-idea-plugin-install](https://github.com/alibaba/p3c/blob/master/idea-plugin/README.md)
199+
200+
#### eclipse IDE
201+
[p3c-eclipse-plugin-install](https://github.com/alibaba/p3c/blob/master/eclipse-plugin/README.md)
202+
203+
204+
总之,**任何帮助都是贡献。**

0 commit comments

Comments
 (0)