You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CONTRIBUTING.md 10 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. # Contribution Guidelines
  2. ## Table of Contents
  3. - [Contribution Guidelines](#contribution-guidelines)
  4. - [Introduction](#introduction)
  5. - [Bug reports](#bug-reports)
  6. - [Discuss your design](#discuss-your-design)
  7. - [Testing redux](#testing-redux)
  8. - [Vendoring](#vendoring)
  9. - [Translation](#translation)
  10. - [Code review](#code-review)
  11. - [Styleguide](#styleguide)
  12. - [Sign your work](#sign-your-work)
  13. - [Release Cycle](#release-cycle)
  14. - [Maintainers](#maintainers)
  15. - [Owners](#owners)
  16. - [Versions](#versions)
  17. - [Copyright](#copyright)
  18. ## Introduction
  19. This document explains how to contribute changes to the Gitea project.
  20. It assumes you have followed the
  21. [installation instructions](https://docs.gitea.io/en-us/).
  22. Sensitive security-related issues should be reported to
  23. [security@gitea.io](mailto:security@gitea.io).
  24. ## Bug reports
  25. Please search the issues on the issue tracker with a variety of keywords
  26. to ensure your bug is not already reported.
  27. If unique, [open an issue](https://github.com/go-gitea/gitea/issues/new)
  28. and answer the questions so we can understand and reproduce the
  29. problematic behavior.
  30. To show us that the issue you are having is in Gitea itself, please
  31. write clear, concise instructions so we can reproduce the behavior
  32. (even if it seems obvious). The more detailed and specific you are,
  33. the faster we can fix the issue. Check out [How to Report Bugs
  34. Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html).
  35. Please be kind, remember that Gitea comes at no cost to you, and you're
  36. getting free help.
  37. ## Discuss your design
  38. The project welcomes submissions but please let everyone know what
  39. you're working on if you want to change or add something to the Gitea
  40. repositories.
  41. Before starting to write something new for the Gitea project, please [file
  42. an issue](https://github.com/go-gitea/gitea/issues/new). Significant
  43. changes must go through the [change proposal
  44. process](https://github.com/go-gitea/proposals) before they can be
  45. accepted.
  46. This process gives everyone a chance to validate the design, helps
  47. prevent duplication of effort, and ensures that the idea fits inside
  48. the goals for the project and tools. It also checks that the design is
  49. sound before code is written; the code review tool is not the place for
  50. high-level discussions.
  51. ## Testing redux
  52. Before sending code out for review, run all the tests for the
  53. whole tree to make sure the changes don't break other usage
  54. and keep the compatibility on upgrade. To make sure you are
  55. running the test suite exactly like we do, you should install
  56. the CLI for [Drone CI](https://github.com/drone/drone), as
  57. we are using the server for continous testing, following [these
  58. instructions](http://readme.drone.io/usage/getting-started-cli). After
  59. that you can simply call `drone exec` within your working directory and
  60. it will try to run the test suite locally.
  61. ## Vendoring
  62. We keep a cached copy of dependencies within the `vendor/` directory,
  63. managing updates via [govendor](http://github.com/kardianos/govendor).
  64. Pull requests should only include `vendor/` updates if they are part of
  65. the same change, be it a bugfix or a feature addition.
  66. The `vendor/` update needs to be justified as part of the PR description,
  67. and must be verified by the reviewers and/or merger to always reference
  68. an existing upstream commit.
  69. ## Translation
  70. We do all translation work inside [Crowdin](https://crowdin.com/project/gitea).
  71. The only translation that is maintained in this git repository is
  72. [`en_US.ini`](https://github.com/go-gitea/gitea/blob/master/options/locale/locale_en-US.ini)
  73. and is synced regularily to Crowdin. Once a translation has reached
  74. A SATISFACTORY PERCENTAGE it will be synced back into this repo and
  75. included in the next released version.
  76. ## Code review
  77. Changes to Gitea must be reviewed before they are accepted, no matter who
  78. makes the change even if it is an owner or a maintainer. We use GitHub's
  79. pull request workflow to do that and we also use [LGTM](http://lgtm.co)
  80. to ensure every PR is reviewed by at least 2 maintainers.
  81. Please try to make your pull request easy to review for us.
  82. Please read the [How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/devel/faster_reviews.md) guide,
  83. it has lots of useful tips for any project you may want to contribute.
  84. Some of the key points:
  85. * Make small pull requests. The smaller, the faster to review and the
  86. more likely it will be merged soon.
  87. * Don't make changes unrelated to your PR. Maybe there are typos on
  88. some comments, maybe refactoring would be welcome on a function... but
  89. if that is not related to your PR, please make *another* PR for that.
  90. * Split big pull requests into multiple small ones. An incremental change
  91. will be faster to review than a huge PR.
  92. ## Styleguide
  93. For imports you should use the following format (_without_ the comments)
  94. ```go
  95. import (
  96. // stdlib
  97. "encoding/json"
  98. "fmt"
  99. // local packages
  100. "code.gitea.io/gitea/models"
  101. "code.gitea.io/sdk/gitea"
  102. // external packages
  103. "github.com/foo/bar"
  104. "gopkg.io/baz.v1"
  105. )
  106. ```
  107. ## Sign your work
  108. The sign-off is a simple line at the end of the explanation for the
  109. patch. Your signature certifies that you wrote the patch or otherwise
  110. have the right to pass it on as an open-source patch. The rules are
  111. pretty simple: If you can certify [DCO](DCO), then you just add a line
  112. to every git commit message:
  113. ```
  114. Signed-off-by: Joe Smith <joe.smith@email.com>
  115. ```
  116. Please use your real name, we really dislike pseudonyms or anonymous
  117. contributions. We are in the open-source world without secrets. If you
  118. set your `user.name` and `user.email` git configs, you can sign your
  119. commit automatically with `git commit -s`.
  120. ## Release Cycle
  121. We adopted a release schedule to streamline the process of working
  122. on, finishing, and issuing releases. The overall goal is to make a
  123. minor release every two months, which breaks down into one month of
  124. general development followed by one month of testing and polishing
  125. known as the release freeze. All the feature pull requests should be
  126. merged in the first month of one release period and during the frozen
  127. period a corresponding release branch is open for fix backported from
  128. master. Release candidate are made along this period for user testing to
  129. obtain a final version that is maintained in this branch. A release is
  130. maintained by issuing patch releases to only correct critical problems
  131. such as crashes or security issues.
  132. The current release cycle is aligned to start on December 25 to February
  133. 24, next is February 25 to April 24, and etc. On this cycle, we also
  134. maybe publish the previous release minor version. For example, the
  135. current release version is v1.1, but we maybe also publish v1.0.2. When
  136. we publish v1.2, then we will stop publish v1.0.3.
  137. ## Maintainers
  138. To make sure every PR is checked, we have [team
  139. maintainers](MAINTAINERS). Every PR **MUST** be reviewed by at least
  140. two maintainers (or owners) before it can get merged. A maintainer
  141. should be a contributor of Gitea (or Gogs) and contributed at least
  142. 4 accepted PRs. A contributor should apply as a maintainer in the
  143. [Discord](https://discord.gg/NsatcWJ) #develop channel. The owners
  144. or the team maintainers may invite the contributor. A maintainer
  145. should spend some time on code reviews. If a maintainer has no
  146. time to do that, they should apply to leave the maintainers team
  147. and we will give them the honor of being a member of the [advisors
  148. team](https://github.com/orgs/go-gitea/teams/advisors). Of course, if
  149. an advisor has time to code review, we will gladly welcome them back
  150. to the maintainers team. If a maintainer is inactive for more than 3
  151. months and forgets to leave the maintainers team, the owners may move
  152. him or her from the maintainers team to the advisors team.
  153. ## Owners
  154. Since Gitea is a pure community organization without any company support,
  155. to keep the development healthy we will elect three owners every year. All
  156. contributors may vote to elect up to three candidates, one of which will
  157. be the main owner, and the other two the assistant owners. When the new
  158. owners have been elected, the old owners will give up ownership to the
  159. newly elected owners. If an owner is unable to do so, the other owners
  160. will assist in ceding ownership to the newly elected owners.
  161. After the election, the new owners should proactively agree
  162. with our [CONTRIBUTING](CONTRIBUTING.md) requirements in the
  163. [Discord](https://discord.gg/NsatcWJ) #general channel. Below are the
  164. words to speak:
  165. ```
  166. I'm honored to having been elected an owner of Gitea, I agree with
  167. [CONTRIBUTING](CONTRIBUTING.md). I will spend part of my time on Gitea
  168. and lead the development of Gitea.
  169. ```
  170. To honor the past owners, here's the history of the owners and the time
  171. they served:
  172. * 2016-11-04 ~ 2017-12-31
  173. * [Lunny Xiao](https://github.com/lunny) <xiaolunwen@gmail.com>
  174. * [Thomas Boerger](https://github.com/tboerger) <thomas@webhippie.de>
  175. * [Kim Carlbäcker](https://github.com/bkcsoft) <kim.carlbacker@gmail.com>
  176. ## Versions
  177. Gitea has the `master` branch as a tip branch and has version branches
  178. such as `release/v0.9`. `release/v0.9` is a release branch and we will
  179. tag `v0.9.0` for binary download. If `v0.9.0` has bugs, we will accept
  180. pull requests on the `release/v0.9` branch and publish a `v0.9.1` tag,
  181. after bringing the bug fix also to the master branch.
  182. Since the `master` branch is a tip version, if you wish to use Gitea
  183. in production, please download the latest release tag version. All the
  184. branches will be protected via GitHub, all the PRs to every branch must
  185. be reviewed by two maintainers and must pass the automatic tests.
  186. ## Copyright
  187. Code that you contribute should use the standard copyright header:
  188. ```
  189. // Copyright 2017 The Gitea Authors. All rights reserved.
  190. // Use of this source code is governed by a MIT-style
  191. // license that can be found in the LICENSE file.
  192. ```
  193. Files in the repository contain copyright from the year they are added
  194. to the year they are last changed. If the copyright author is changed,
  195. just paste the header below the old one.