CONTRIBUTING.md 6.2 KB
Newer Older
R
Polish  
Rossen Stoyanchev 已提交
1
# Contributing  to the Spring Framework
2

R
Rossen Stoyanchev 已提交
3
First off, thank you for taking the time to contribute! :+1: :tada: 
4

R
Polish  
Rossen Stoyanchev 已提交
5
### Table of Contents
6

R
Rossen Stoyanchev 已提交
7 8 9
* [Code of Conduct](#code-of-conduct)
* [How to Contribute](#how-to-contribute)
  * [Discuss](#discuss)
R
Rossen Stoyanchev 已提交
10 11
  * [Create an Issue](#create-an-issue)
  * [Issue Lifecycle](#issue-lifecycle)
R
Rossen Stoyanchev 已提交
12 13 14 15
  * [Submit a Pull Request](#submit-a-pull-request)
* [Build from Source](#build-from-source)
* [Source Code Style](#source-code-style)
* [Reference Docs](#reference-docs)
16

17
### Code of Conduct
18

19
This project is governed by the [Spring Code of Conduct](CODE_OF_CONDUCT.adoc).
20 21 22
By participating you are expected to uphold this code.
Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.

23
### How to Contribute
24

25
#### Discuss
26

S
Sam Brannen 已提交
27
If you have a question, check Stack Overflow using
28
[this list of tags](https://spring.io/questions), organized by Spring project.
S
Sam Brannen 已提交
29
Find an existing discussion, or start a new one if necessary.
30

R
Rossen Stoyanchev 已提交
31 32 33 34 35
If you believe there is an issue, search through
[existing issues](https://github.com/spring-projects/spring-framework/issues) trying a
few different ways to find discussions, past or current, that are related to the issue.
Reading those discussions helps you to learn about the issue, and helps us to make a
decision.
36

37

R
Rossen Stoyanchev 已提交
38
#### Create an Issue
39

40
Reporting an issue or making a feature request is a great way to contribute. Your feedback
R
Rossen Stoyanchev 已提交
41 42
and the conversations that result from it provide a continuous flow of ideas. However,
before creating a ticket, please take the time to [discuss and research](#discuss) first.
R
Rossen Stoyanchev 已提交
43

R
Rossen Stoyanchev 已提交
44 45 46
If creating an issue after a discussion on Stack Overflow, please provide a description
in the issue instead of simply referring to Stack Overflow. The issue tracker is an
important place of record for design discussions and should be self-sufficient.
R
Rossen Stoyanchev 已提交
47

R
Rossen Stoyanchev 已提交
48 49
Once you're ready, create an issue on
[GitHub](https://github.com/spring-projects/spring-framework/issues).
R
Rossen Stoyanchev 已提交
50

R
Rossen Stoyanchev 已提交
51
#### Issue Lifecycle
52

S
Polish  
Stephane Nicoll 已提交
53
When an issue is first created, it is flagged `waiting-for-triage` waiting for a team
R
Rossen Stoyanchev 已提交
54 55 56
member to triage it. Once the issue has been reviewed, the team may ask for further
information if needed, and based on the findings, the issue is either assigned a target
milestone or is closed with a specific status.
S
Polish  
Stephane Nicoll 已提交
57

R
Rossen Stoyanchev 已提交
58 59 60 61
When a fix is ready, the issue is closed and may still be re-opened until the fix is
released. After that the issue will typically no longer be reopened. In rare cases if the
issue was not at all fixed, the issue may be re-opened. In most cases however any
follow-up reports will need to be created as new issues with a fresh description.
62

63
#### Submit a Pull Request
64 65

1. If you have not previously done so, please sign the
R
Rossen Stoyanchev 已提交
66 67
[Contributor License Agreement](https://cla.pivotal.io/sign/spring). You will be reminded
automatically when you submit the PR.
68

R
Rossen Stoyanchev 已提交
69 70 71 72 73
1. Should you create an issue first? No, just create the pull request and use the
description to provide context and motivation, as you would for an issue. If you want
to start a discussion first or have already created an issue, once a pull request is
created, we will close the issue as superseded by the pull request, and the discussion
about the issue will continue under the pull request.
74 75

1. Always check out the `master` branch and submit pull requests against it
76
(for target version see [settings.gradle](settings.gradle)).
77 78 79 80 81
Backports to prior versions will be considered on a case-by-case basis and reflected as
the fix version in the issue tracker.

1. Choose the granularity of your commits consciously and squash commits that represent
multiple edits or corrections of the same logical change. See
S
Spring Operator 已提交
82
[Rewriting History section of Pro Git](https://git-scm.com/book/en/Git-Tools-Rewriting-History)
S
Sam Brannen 已提交
83
for an overview of streamlining the commit history.
84

S
Stephane Nicoll 已提交
85
1. Format commit messages using 55 characters for the subject line, 72 characters per line
S
Polish  
Stephane Nicoll 已提交
86
for the description, followed by the issue fixed, e.g. `Closes gh-22276`. See the
S
Spring Operator 已提交
87
[Commit Guidelines section of Pro Git](https://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines)
S
Sam Brannen 已提交
88
for best practices around commit messages, and use `git log` to see some examples.
89

R
Rossen Stoyanchev 已提交
90 91
1. If there is a prior issue, reference the GitHub issue number in the description of the
pull request.
92

93 94 95
If accepted, your contribution may be heavily modified as needed prior to merging.
You will likely retain author attribution for your Git commits granted that the bulk of
your changes remain intact. You may also be asked to rework the submission.
96

97 98 99
If asked to make corrections, simply push the changes against the same branch, and your
pull request will be updated. In other words, you do not need to create a new pull request
when asked to make changes.
100

101 102 103 104 105 106 107
#### Participate in Reviews

Helping to review pull requests is another great way to contribute. Your feedback
can help to shape the implementation of new features. When reviewing pull requests,
however, please refrain from approving or rejecting a PR unless you are a core
committer for the Spring Framework.

108 109 110 111 112 113
### Build from Source

See the [Build from Source](https://github.com/spring-projects/spring-framework/wiki/Build-from-Source)
wiki page for instructions on how to check out, build, and import the Spring Framework
source code into your IDE.

114
### Source Code Style
115

R
Rossen Stoyanchev 已提交
116 117 118
The wiki pages
[Code Style](https://github.com/spring-projects/spring-framework/wiki/Code-Style) and
[IntelliJ IDEA Editor Settings](https://github.com/spring-projects/spring-framework/wiki/IntelliJ-IDEA-Editor-Settings)
S
Sam Brannen 已提交
119
define the source file coding standards we use along with some IDEA editor settings we customize.
120

121
### Reference Docs
122

S
Sam Brannen 已提交
123
The reference documentation is in the [src/docs/asciidoc](src/docs/asciidoc) directory, in
S
Spring Operator 已提交
124
[Asciidoctor](https://asciidoctor.org/) format. For trivial changes, you may be able to browse,
125
edit source files, and submit directly from GitHub.
126

S
Sam Brannen 已提交
127
When making changes locally, execute `./gradlew asciidoctor` and then browse the result under
128
`build/asciidoc/html5/index.html`.
129

130
Asciidoctor also supports live editing. For more details read
S
Spring Operator 已提交
131
[Editing AsciiDoc with Live Preview](https://asciidoctor.org/docs/editing-asciidoc-with-live-preview/).
132
Note that if you choose the
S
Spring Operator 已提交
133
[System Monitor](https://asciidoctor.org/docs/editing-asciidoc-with-live-preview/#using-a-system-monitor)
134
option, you can find a Guardfile under `src/docs/asciidoc`.