Skip to content

Commit e5a6895

Browse files
authored
docs: add readme ,contributing and pr template doc (#153)
1 parent 11f8bd5 commit e5a6895

File tree

9 files changed

+575
-1
lines changed

9 files changed

+575
-1
lines changed
File renamed without changes.

.github/ISSUE_TEMPLATE/enhancement.md renamed to .github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for seata-go
4+
labels: kind/feature
5+
6+
---
7+
18
<!-- Please only use this template for submitting enhancement requests -->
29

310
**What would you like to be added**:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Thanks for sending a pull request!
2+
-->
3+
4+
**What this PR does**:
5+
6+
**Which issue(s) this PR fixes**:
7+
<!--
8+
*Automatically closes linked issue when PR is merged.
9+
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
10+
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
11+
-->
12+
Fixes #
13+
14+
**Special notes for your reviewer**:
15+
16+
**Does this PR introduce a user-facing change?**:
17+
<!--
18+
If no, just write "NONE" in the release-note block below.
19+
If yes, a release note is required:
20+
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
21+
-->
22+
```release-note
23+
24+
```

CONTRIBUTING.md

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# Contributing to seata-go
2+
3+
It is warmly welcomed if you have interest to hack on seata-go. First, we encourage this kind of willing very much. And here is a list of contributing guide for you.
4+
5+
[[中文贡献文档](./CONTRIBUTING_CN.md)]
6+
7+
## Topics
8+
9+
* [Reporting general issues](#reporting-general-issues)
10+
* [Code and doc contribution](#code-and-doc-contribution)
11+
* [Test case contribution](#test-case-contribution)
12+
* [Engage to help anything](#engage-to-help-anything)
13+
* [Code Style](#code-style)
14+
15+
## Reporting general issues
16+
17+
To be honest, we regard every user of seata-go as a very kind contributor. After experiencing seata-go, you may have some feedback for the project. Then feel free to open an issue via [NEW ISSUE](https://github.com/seata/seata-go/issues/new/choose).
18+
19+
Since we collaborate project seata-go 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.
20+
21+
To make the issue details as standard as possible, we setup an [ISSUE TEMPLATE](./.github/ISSUE_TEMPLATE) for issue reporters. Please **BE SURE** to follow the instructions to fill fields in template.
22+
23+
There are a lot of cases when you could open an issue:
24+
25+
* bug report
26+
* feature request
27+
* performance issues
28+
* feature proposal
29+
* feature design
30+
* help wanted
31+
* doc incomplete
32+
* test improvement
33+
* any questions on project
34+
* and so on
35+
36+
Also we must remind that when filling a new issue, please remember to remove the sensitive data from your post. Sensitive data could be password, secret key, network locations, private business data and so on.
37+
38+
## Code and doc contribution
39+
40+
Every action to make project seata-go better is encouraged. On GitHub, every improvement for seata-go could be via a PR (short for pull request).
41+
42+
* If you find a typo, try to fix it!
43+
* If you find a bug, try to fix it!
44+
* If you find some redundant codes, try to remove them!
45+
* If you find some test cases missing, try to add them!
46+
* If you could enhance a feature, please **DO NOT** hesitate!
47+
* If you find code implicit, try to add comments to make it clear!
48+
* If you find code ugly, try to refactor that!
49+
* If you can help to improve documents, it could not be better!
50+
* If you find document incorrect, just do it and fix that!
51+
* ...
52+
53+
Actually it is impossible to list them completely. Just remember one principle:
54+
55+
> WE ARE LOOKING FORWARD TO ANY PR FROM YOU.
56+
57+
Since you are ready to improve seata-go with a PR, we suggest you could take a look at the PR rules here.
58+
59+
* [Workspace Preparation](#workspace-preparation)
60+
* [Branch Definition](#branch-definition)
61+
* [Commit Rules](#commit-rules)
62+
* [PR Description](#pr-description)
63+
64+
### Workspace Preparation
65+
66+
To put forward a PR, we assume you have registered a GitHub ID. Then you could finish the preparation in the following steps:
67+
68+
1. **FORK** seata-go 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-go) main page. Then you will end up with your repository in `https://github.com/<your-username>/seata-go`, in which `your-username` is your GitHub username.
69+
70+
1. **CLONE** your own repository to develop locally. Use `git clone [email protected]:<your-username>/seata-go.git` to clone repository to your local machine. Then you can create new branches to finish the change you wish to make.
71+
72+
1. **Set Remote** upstream to be `[email protected]:seata/seata-go.git` using the following two commands:
73+
74+
```bash
75+
git remote add upstream [email protected]:seata/seata-go.git
76+
git remote set-url --push upstream no-pushing
77+
```
78+
79+
With this remote setting, you can check your git remote configuration like this:
80+
81+
```shell
82+
$ git remote -v
83+
origin [email protected]:<your-username>/seata-go.git (fetch)
84+
origin [email protected]:<your-username>/seata-go.git (push)
85+
upstream [email protected]:seata/seata-go.git (fetch)
86+
upstream no-pushing (push)
87+
```
88+
89+
Adding this, we can easily synchronize local branches with upstream branches.
90+
91+
### Branch Definition
92+
93+
Right now we assume every contribution via pull request is for [branch develop](https://github.com/seata/seata-go/tree/develop) in seata-go. Before contributing, be aware of branch definition would help a lot.
94+
95+
As a contributor, keep in mind again that every contribution via pull request is for branch develop. While in project seata-go, 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.
96+
97+
When officially releasing a version, there will be a release branch and named with the version number.
98+
99+
After the release, we will merge the commit of the release branch into the master branch.
100+
101+
When we find that there is a bug in a certain version, we will decide to fix it in a later version or fix it in a specific hotfix version. When we decide to fix the hotfix version, we will checkout the hotfix branch based on the corresponding release branch, perform code repair and verification, and merge it into the develop branch and the master branch.
102+
103+
For larger features, we will pull out the feature branch for development and verification.
104+
105+
106+
### Commit Rules
107+
108+
Actually in seata-go, we take two rules serious when committing:
109+
110+
* [Commit Message](#commit-message)
111+
* [Commit Content](#commit-content)
112+
113+
#### Commit Message
114+
115+
Commit message could help reviewers better understand what is the purpose of submitted PR. It could help accelerate the code review procedure as well. We encourage contributors to use **EXPLICIT** commit message rather than ambiguous message. In general, we advocate the following commit message type:
116+
117+
* docs: xxxx. For example, "docs: add docs about seata-go cluster installation".
118+
* feature: xxxx.For example, "feature: support oracle in AT mode".
119+
* bugfix: xxxx. For example, "bugfix: fix panic when input nil parameter".
120+
* refactor: xxxx. For example, "refactor: simplify to make codes more readable".
121+
* test: xxx. For example, "test: add unit test case for func InsertIntoArray".
122+
* other readable and explicit expression ways.
123+
124+
On the other side, we discourage contributors from committing message like the following ways:
125+
126+
* ~~fix bug~~
127+
* ~~update~~
128+
* ~~add doc~~
129+
130+
If you get lost, please see [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/) for a start.
131+
132+
#### Commit Content
133+
134+
Commit content represents all content changes included in one commit. We had better include things in one single commit which could support reviewer's complete review without any other commits' help. In another word, contents in one single commit can pass the CI to avoid code mess. In brief, there are three minor rules for us to keep in mind:
135+
136+
* avoid very large change in a commit;
137+
* complete and reviewable for each commit.
138+
* check git config(`user.name`, `user.email`) when committing to ensure that it is associated with your GitHub ID.
139+
140+
```bash
141+
git config --get user.name
142+
git config --get user.email
143+
```
144+
145+
* when submitting pr, please add a brief description of the current changes to the dev.md file under the 'changes/' folder
146+
147+
148+
In addition, in the code change part, we suggest that all contributors should read the [code style of seata-go](#code-style).
149+
150+
No matter commit message, or commit content, we do take more emphasis on code review.
151+
152+
153+
#### Format your code
154+
155+
Before submitting the code, execute the script of formatting the code under the project root directory:
156+
157+
~~~shell
158+
sh goimports.sh
159+
~~~
160+
161+
### PR Description
162+
163+
PR is the only way to make change to seata-go project files. To help reviewers better get your purpose, PR description could not be too detailed. We encourage contributors to follow the [PR template](./.github/pull-request-template.md) to finish the pull request.
164+
165+
## Test case contribution
166+
167+
Any test case will be welcomed. Currently, seata-go functional test cases are of high priority.
168+
169+
- For unit tests, create a XXX_test.go file in the file directory of go file
170+
171+
## Engage to help anything
172+
173+
We choose GitHub as the primary place for seata-go to collaborate. So the latest updates of seata-go are always here. Although contributions via PR is an explicit way to help, we still call for any other ways.
174+
175+
* reply to other's issues if you could;
176+
* help solve other user's problems;
177+
* help review other's PR design;
178+
* help review other's codes in PR;
179+
* discuss about seata-go to make things clearer;
180+
* advocate seata-go technology beyond GitHub;
181+
* write blogs on seata-go and so on.
182+
183+
184+
## Code Style
185+
186+
Seata-go code style reference [uber-go/guide](https://github.com/uber-go/guide)
187+
188+
189+
### IDE Plugin Install(not necessary)
190+
191+
*It is not necessary to install, if you want to find a problem when you are coding.*
192+
193+
install go fmt 和 goimports plugin,detailed reference:https://github.com/golang/tools
194+
195+
196+
In a word, **ANY HELP IS CONTRIBUTION.**

0 commit comments

Comments
 (0)