Skip to content

Commit 6a9b9f4

Browse files
committed
[#2064] Add CONTRIBUTING.md
1 parent 71f1899 commit 6a9b9f4

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

CONTRIBUTING.md

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Contributing
2+
3+
Contributions from the community are essential in keeping Hibernate (and any Open Source
4+
project really) strong and successful.
5+
6+
# Legal
7+
8+
All original contributions to Hibernate are licensed under the
9+
[Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).
10+
11+
The Apache 2.0 license text is included verbatim in the [LICENSE](LICENSE) file in the root directory
12+
of the Hibernate Reactive repository.
13+
14+
All contributions are subject to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
15+
16+
The DCO text is available verbatim in the [dco.txt](dco.txt) file in the root directory
17+
of the Hibernate Reactive repository.
18+
19+
## Guidelines
20+
21+
While we try to keep requirements for contributing to a minimum, there are a few guidelines
22+
we ask that you mind.
23+
24+
For code contributions, these guidelines include:
25+
* Respect the project code style - find templates for [IntelliJ IDEA](https://hibernate.org/community/contribute/intellij-idea/) or [Eclipse](https://hibernate.org/community/contribute/eclipse-ide/)
26+
* Have a corresponding GitHub [issue](https://github.com/hibernate/hibernate-reactive/issues) and be sure to include
27+
the key for this issue in your commit messages.
28+
* Have a set of appropriate tests.
29+
For your convenience, a [set of test templates](https://github.com/hibernate/hibernate-test-case-templates/tree/main/reactive)
30+
have been made available.
31+
32+
When submitting bug reports, the tests should reproduce the initially reported bug and illustrate that your solution addresses the issue.
33+
For features/enhancements, the tests should demonstrate that the feature works as intended.
34+
In both cases, be sure to incorporate your tests into the project to protect against possible regressions.
35+
* If applicable, documentation should be updated to reflect the introduced changes
36+
* The code compiles and the tests pass (`./gradlew clean build`)
37+
38+
For documentation contributions, mainly to respect the project code style, especially in regard
39+
to the use of tabs - as mentioned above, code style templates are available for both IntelliJ IDEA and Eclipse
40+
IDEs. Ideally, these contributions would also have a corresponding issue, although this
41+
is less necessary for documentation contributions.
42+
43+
## Getting Started
44+
45+
If you are just getting started with Git, GitHub, and/or contributing to Hibernate via
46+
GitHub there are a few pre-requisite steps to follow:
47+
48+
* Make sure you have a [GitHub account](https://github.com/signup/free)
49+
* [Fork](https://help.github.com/articles/fork-a-repo) the Hibernate Reactive repository. As discussed in
50+
the linked page, this also includes:
51+
* [set up your local git install](https://help.github.com/articles/set-up-git)
52+
* clone your fork
53+
* Instruct git to ignore certain commits when using `git blame`. From the directory of your local clone, run this: `git config blame.ignoreRevsFile .git-blame-ignore-revs`
54+
* See the wiki pages for setting up your IDE, whether you use
55+
[IntelliJ IDEA](https://hibernate.org/community/contribute/intellij-idea/)
56+
or [Eclipse](https://hibernate.org/community/contribute/eclipse-ide/)<sup>(1)</sup>.
57+
58+
59+
## Create the working (topic) branch
60+
61+
Create a [topic branch](https://git-scm.com/book/en/Git-Branching-Branching-Workflows#Topic-Branches)
62+
on which you will work. The convention is to incorporate the JIRA issue key in the name of this branch,
63+
although this is more of a mnemonic strategy than a hard-and-fast rule - but doing so helps:
64+
* Remember what each branch is for
65+
* Isolate the work from other contributions you may be working on
66+
67+
_If there is not already a GitHub issue covering the work you want to do, [create one](https://github.com/hibernate/hibernate-reactive/issues/new)._
68+
69+
Assuming you will be working from the `main` branch and working
70+
on the GitHub issue #123 : `git checkout -b 123 main`
71+
72+
## Code
73+
74+
Do your thing!
75+
76+
77+
## Commit
78+
79+
* Make commits of logical units
80+
* Be sure to start each commit message using the ** GitHub issue key **. For example:
81+
```
82+
[#1234] Fix some kind of problem
83+
```
84+
* Make sure you have added the necessary tests for your changes
85+
* Run _all_ the tests to ensure nothing else was accidentally broken
86+
87+
_Before committing, if you want to pull in the latest upstream changes (highly
88+
appreciated btw), please use rebasing rather than merging. Merging creates
89+
"merge commits" that invariably muck up the project timeline._
90+
91+
## Submit
92+
93+
* Push your changes to the topic branch in your fork of the repository
94+
* Initiate a [pull request](https://help.github.com/articles/creating-a-pull-request)
95+
* Adding the sentence `Fix #123`, where `#123` is the issue key, will link the pull request to the corresponding issue
96+
and close it accordingly, when the pull request gets merged.
97+
98+
It is important that this topic branch of your fork:
99+
100+
* Is isolated to just the work on this one issue, or multiple issues if they are
101+
related and also fixed/implemented by this work. The main point is to not push commits for more than
102+
one PR to a single branch - GitHub PRs are linked to a branch rather than specific commits
103+
* remain until the PR is closed. Once the underlying branch is deleted the corresponding PR will be closed,
104+
if not already, and the changes will be lost.
105+
106+
# Notes
107+
<sup>(1)</sup> Gradle `eclipse` plugin is no longer supported, so the recommended way to import the project in your IDE is with the proper IDE tools/plugins. Don't try to run `./gradlew clean eclipse --refresh-dependencies` from the command line as you'll get an error because `eclipse` no longer exists

0 commit comments

Comments
 (0)