You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+28-21Lines changed: 28 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,17 @@ This document describes the policies and procedures for working with NHibernate.
4
4
5
5
For the least friction, please follow the steps in the order presented, being careful not to miss any. There are many details in this document that will help your contribution go as smoothly as possible. Please read it thoroughly.
6
6
7
-
## Check for Existing Issues Visit
7
+
## Create or find a GitHub Issue
8
8
9
-
[https://nhibernate.jira.com][1] and search for your issue. If you see it, voting for it is a good way to increase the visibility of the issue.
10
-
## Create a JIRA Issue
9
+
GitHub is used to generate the release notes and serves as a central point of reference for all changes that have occurred to NHibernate.
11
10
12
-
JIRA is used to generate the release notes and serves as a central point of reference for all changes that have occurred to NHibernate.
11
+
Visit [https://github.com/nhibernate/nhibernate-core/issues][1] and search for your issue. If you see it, giving it a like is a good way to increase the visibility of the issue.
13
12
14
-
Before creating an issue, please do your best to verify the existence of the problem. This reduces noise in the issue tracker and helps conserve the resources of the team for more useful tasks. Note the issue number for future steps. Ex. NH-2318
13
+
Before creating an issue, please do your best to verify the existence of the problem. This reduces noise in the issue tracker and helps conserve the resources of the team for more useful tasks. Note the issue number for future steps.
15
14
16
15
## Fork and Clone from GitHub
17
16
18
-
The main GitHub repository is at <https://github.com/nhibernate/nhibernate-core>. If you plan to contribute your test case or improvement back to NHibernate, you should visit that page and fork the repository so you can commit your own changes and then submit a pull request.
17
+
The main GitHub repository is at [https://github.com/nhibernate/nhibernate-core][2]. If you plan to contribute your test case or improvement back to NHibernate, you should visit that page and fork the repository so you can commit your own changes and then submit a pull request.
19
18
20
19
## The Build Menu
21
20
@@ -35,29 +34,32 @@ The main GitHub repository is at <https://github.com/nhibernate/nhibernate-core>
35
34
## Setting up For Development
36
35
37
36
1. Install your favorite database and optionally set up a user capable of creating and dropping a database called **nhibernate**. There are some per-database instructions in the lib/teamcity/* folders, which you may find helpful. For SQL Server, you might be able to use the **localhost\sqlexpress** instance installed with Visual Studio. Often people already have databases set up, so you might not even need to do anything in this step.
38
-
2. Run the build menu and select the option A to create the AssemblyInfo.cs files.
39
-
3. Run the build menu and select option B to create a new test configuration. Notepad will pop up and you should edit the connection string information, saving it when you're done. These configurations will appear in the "available-test-configurations" folder.
40
-
4. Run the build menu and select option C to activate the test configuration you created. The appropriate configuration will be copied to the "current-test-configuration" folder.
41
-
5. (Optional) Run all the tests with option D and hopefully you will see no failing tests. The build may fail on certain databases; please ask on the mailing list if you are having trouble.
42
-
6. Before using the database for unit tests from Visual Studio, you'll need to create an empty database that matches your connection string. [NH-2866][2] will make this easier, but for now you just have to drop/create the database specified in your connection string yourself.
37
+
2. Run the build menu and select option B to create a new test configuration. Notepad will pop up and you should edit the connection string information, saving it when you're done. These configurations will appear in the "available-test-configurations" folder.
38
+
3. Run the build menu and select option C to activate the test configuration you created. The appropriate configuration will be copied to the "current-test-configuration" folder.
39
+
4. (Optional) Run all the tests with option D and hopefully you will see no failing tests. The build may fail on certain databases; please ask on the mailing list if you are having trouble.
40
+
5. Before using the database for unit tests from Visual Studio, you'll need to create an empty database that matches your connection string.
43
41
44
42
## Creating a Test Case to Verify the Issue
45
43
46
44
In most cases, you will be adding your test to the NHibernate.Test project. If there is a test that only works with VisualBasic, then add it to the NHibernate.Test.VisualBasic project instead.
47
45
48
46
1. Open **NHibernate.sln** from the src folder.
49
47
2. If adding a C# test, go to the NHSpecificTest folder in the NHibernate.Test project. If adding a VisualBasic test, go to the Issues folder in the NHibernate.Test.VisualBasic project.
50
-
3. Copy and paste the NH0000 folder to create a duplicate test ("Copy of NH0000").
51
-
4. Replace the four (five for vb) instances of NH0000 with your issue number.
48
+
3. Copy and paste the GH0000 folder to create a duplicate test ("Copy of GH0000").
49
+
4. Replace the four instances of GH0000 with your issue number.
52
50
5. Edit the test as you see fit. Don't commit yet; there are details in a later step.
53
51
52
+
Do not use anymore the NHxxxx naming, they match issue numbers from https://nhibernate.jira.com/
53
+
54
+
NHibernate has migrated its issue tracking from Jira to GitHub, and using the Jira naming may lead to conflicts with previous Jira issues.
55
+
54
56
## Running Your Unit Test
55
57
56
58
### Debugging Through Included NUnit GUI
57
59
58
60
1. Right click on the project (ex. NHibernate.Test) in Visual Studio.
59
61
2. Select: Debug -> Start New Instance
60
-
3. Type the name of your unit test to quickly go to it. For example: NH2318
62
+
3. Type the name of your unit test to quickly go to it. For example: GH2318
61
63
4. Select and run the test.
62
64
5. You can also make the test project your startup project and it will run NUnit when you press F5.
63
65
@@ -66,13 +68,16 @@ In most cases, you will be adding your test to the NHibernate.Test project. If t
66
68
1. Sometimes tests fail when run under x64. If required (ex. SQLite and Firebird), go to the project properties Build tab and set the target to x86.
67
69
2. Next, just run the tests as usual.
68
70
71
+
## Regenerate async code
72
+
73
+
NHibernate uses a code generator for its async implementation and tests. If your changes, including tests, involve any synchronous method having an async
74
+
counter-part, you should regenerate the async code. Use build-menu option H for this. Then test any async counter-part it may have generated from your tests.
75
+
69
76
## Commit your Test Case
70
77
71
78
Ensure that your e-mail address and name are configured appropriately in Git.
72
79
73
-
Create a feature branch so it's easy to keep it separate from other improvements. Having a pull request accepted might involve further commits based on community feedback, so having the feature branch provides a tidy place to work from. Using the issue number as the branch name is good practice.
74
-
75
-
When you commit, please include the issue number in your commit message. This will allow the JIRA issue tracker to automatically link your commits to the issue. By example: *NH-1234 - test case for blah trouble*. Make sure you do not put any non whitespace character adjacent to the issue number, as this would prevent JIRA to match it. (Avoid *NH-1234: test case for blah trouble*.)
80
+
Create a feature branch so it's easy to keep it separate from other improvements. Having a pull request accepted might involve further commits based on community feedback, so having the feature branch provides a tidy place to work from. Using the issue number as the branch name is good practice.
76
81
77
82
## Implementing the Bug Fix or Improvement
78
83
@@ -86,19 +91,21 @@ Please note that some tests assume a case insensitive accent sensitive database
86
91
87
92
## Submit a Pull Request
88
93
89
-
Be sure to link to the JIRA issue in your GitHub pull request. Also, go back to your JIRA issue and link to the pull request.
94
+
If you are fixing an existing issue, please make sure to include this issue number in your GitHub pull request.
90
95
91
96
We use tabs for code indentation, not spaces. As this is not the default in Visual Studio, you will need to reconfigure Visual Studio to indent with tabs whenever you work on the NHibernate codebase. To make this easier, NHibernate has an [editorconfig][3] configuration file to switch Visual Studio automatically between tabs and spaces mode. It is recommended you install editorconfig from the Visual Studio Extension Manager.
92
97
98
+
After submitting your pull request, come back later to check the outcome of automated builds. If some have failed, they will be listed in your pull request with a link to the corresponding TeamCity build. Find out in the build which tests are newly failing, and take appropriate action. Some of those builds have many known failing tests, which does not trigger a build failure. A *Comparison.txt* file in build Artifacts may help finding which failing tests are not known failing tests and must be addressed.
99
+
93
100
## Further Discussion
94
101
95
-
The NHibernate team monitors JIRA and GitHub regularly, so your request will be noticed. If you want to discuss it further, you are welcome to post to the [nhibernate-development mailing list][4].
102
+
The NHibernate team monitors GitHub regularly, so your request will be noticed. If you want to discuss it further, you are welcome to post to the [nhibernate-development mailing list][4].
96
103
97
104
## Happy Contributing!
98
105
99
106
The NHibernate community values your contributions. Thank you for the time you have invested.
0 commit comments