Skip to content

Commit 18063ad

Browse files
8231601: Update CONTRIBUTING.md to clarify process for contributing features plus Skara changes
Reviewed-by: nlisker, jvos, mstrauss
1 parent 5422a5a commit 18063ad

File tree

1 file changed

+91
-61
lines changed

1 file changed

+91
-61
lines changed

CONTRIBUTING.md

Lines changed: 91 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Contributing to OpenJFX
22
=======================
33

4-
OpenJFX is an open source project and we love to receive contributions from our community — you! There are many ways to contribute, from improving the documentation, submitting bug reports and feature requests or writing code which can be incorporated into OpenJFX itself.
4+
OpenJFX is an open source project and we love to receive contributions from our community — you! There are many ways to contribute, from improving the documentation, submitting bug reports and feature requests, or writing code which can be incorporated into OpenJFX itself.
55

66
Bug reports
77
-----------
88

9-
If you think you have found a bug in OpenJFX, first make sure that you are testing against the latest version - your issue may already have been fixed. If not, search our [issues list](https://bugs.openjdk.java.net) in the Java Bug System (JBS) in case a similar issue has already been opened. More information on where and how to report a bug can be found at [bugreport.java.com](https://bugreport.java.com/).
9+
If you think you have found a bug in OpenJFX, first make sure that you are testing against the latest version - your issue may already have been fixed. If not, search our [issues list](https://bugs.openjdk.java.net/issues/?filter=39543) in the Java Bug System (JBS) in case a similar issue has already been opened. More information on where and how to report a bug can be found at [bugreport.java.com](https://bugreport.java.com/).
1010

1111
It is very helpful if you can prepare a reproduction of the bug. In other words, provide a small test case which we can run to confirm your bug. It makes it easier to find the problem and to fix it.
1212

@@ -15,13 +15,14 @@ Provide as much information as you can. The easier it is for us to recreate your
1515
Feature requests
1616
----------------
1717

18-
If you find yourself wishing for a feature that doesn't exist in OpenJFX, you are probably not alone. There are bound to be others out there with similar needs. Many of the features that OpenJFX has today have been added because our users saw the need.
19-
Open an issue on our [issues list](https://bugs.openjdk.java.net) on JBS which describes the feature you would like to see, why you need it, and how it should work.
18+
If you find yourself wishing for a feature that doesn't exist in OpenJFX, you are probably not alone. There are bound to be others out there with similar needs. Many of the features that OpenJFX has today have been added because our users saw the need. Please be aware that
19+
all new feature requests, including any API changes, need prior discussion on the [openjfx-dev](https://mail.openjdk.java.net/mailman/listinfo/openjfx-dev) mailing list, even if there is already an open
20+
[JBS issue](https://bugs.openjdk.java.net). See the [New features / API additions](#new-features--api-additions) section below for more information.
2021

2122
Contributing code and documentation changes
2223
-------------------------------------------
2324

24-
If you have a bug fix or new feature that you would like to contribute to OpenJFX, please find or open an issue about it first. Talk about what you would like to do. It may be that somebody is already working on it, or that there are particular issues that you should know about before implementing the change. Feature requests, in particular, should be discussed ahead of time and will require significant effort on your part.
25+
If you have a bug fix or new feature that you would like to contribute to OpenJFX, please talk about what you would like to do on the [openjfx-dev](https://mail.openjdk.java.net/mailman/listinfo/openjfx-dev) mailing list. It may be that somebody is already working on it, or that there are particular issues that you should know about before implementing the change.
2526

2627
We enjoy working with contributors to get their code accepted. There are many approaches to fixing a problem and it is important to find the best approach before writing too much code.
2728

@@ -45,24 +46,24 @@ If you are a first time contributor to OpenJFX, welcome! Please do the following
4546

4647
* Read the code review policies
4748

48-
Please read the entire section below on how to submit a pull request, as well as the [OpenJFX Code Review Policies](https://wiki.openjdk.java.net/display/OpenJFX/Code+Reviews). If this is a feature request, please note the additional requirements and expectations in the [New features / API additions](https://wiki.openjdk.java.net/display/OpenJFX/Code+Reviews#CodeReviews-NewFeaturesC.Newfeatures/APIadditions.) section of the Code Review Policies doc.
49+
Please read the entire section below on how to submit a pull request, as well as the [OpenJFX Code Review Policies](https://wiki.openjdk.java.net/display/OpenJFX/Code+Reviews). If this is a feature request, please note the additional requirements and expectations in the [New features / API additions](#new-features--api-additions) section at the end of this guide.
4950

5051
* File a bug in JBS for every pull request
5152

52-
A [JBS](https://bugs.openjdk.java.net) bug ID is needed for every
53+
A unique [JBS](https://bugs.openjdk.java.net) bug ID is needed for every
5354
pull request. If there isn't already a bug filed in JBS, then please
5455
file one at [bugreport.java.com](https://bugreport.java.com/).
5556
A developer with an active OpenJDK ID can file a bug directly in JBS.
5657

57-
TIP: A GitHub pull request (PR) should not be the first time we hear about your proposed change to OpenJFX. Unless clearly identified as experimental or work-in-progress (WIP), we will usually close a pull request that isn't associated with an existing bug report. Reading the policies below will help you in getting your change approved.
58+
TIP: A GitHub pull request (PR) should not be the first time we hear about your proposed change to OpenJFX. Unless clearly identified as a `Draft` or work-in-progress (WIP), as described in the following section, we will usually close a pull request that isn't associated with an existing bug report. Reading the policies below will help you in getting your change approved.
5859

5960
### Submitting your changes via a pull request
6061

6162
Once your changes and tests are ready to submit for review:
6263

6364
1. Test your changes
6465

65-
Run the test suite to make sure that nothing is broken.
66+
Run the test suite to make sure that nothing is broken. For most code changes, you need to provide new tests covering those changes. At least one of the new tests should fail before your proposed fix and pass after your proposed fix.
6667

6768
2. Rebase your changes
6869

@@ -72,9 +73,11 @@ Once your changes and tests are ready to submit for review:
7273

7374
Push your local changes to your forked copy of the repository and
7475
[submit a pull request](https://help.github.com/articles/using-pull-requests).
75-
The title of the pull request must start with the 7-digit JBS bug id
76-
(without the `JDK-` prefix), followed by a colon (`:`), then a space,
77-
and finally the bug title as taken from JBS. You should include
76+
The title of the pull request must start with the 7-digit JBS bug id,
77+
followed by a colon (`:`), then a space,
78+
and finally the bug title as taken from JBS. This title must _exactly_ match
79+
the JBS bug, else the Skara bot will warn about the mismatch and block integration.
80+
You should include
7881
additional details about your change in the Description of the pull
7982
request. For example, the following is a valid pull request title:
8083

@@ -85,20 +88,15 @@ Once your changes and tests are ready to submit for review:
8588
The Skara bot will then run `jcheck` on the server to verify the format
8689
of the PR title and check for whitespace errors. Once that passes,
8790
it will automatically send a Request For Review (RFR) email to the
88-
[openjfx-dev](mailto:openjfx-dev@openjdk.java.net) mailing list.
91+
[openjfx-dev](https://mail.openjdk.java.net/mailman/listinfo/openjfx-dev) mailing list.
92+
The Skara bot will also cross-link the JBS Issue and the pull request.
8993
See the
9094
[Skara project page](https://github.com/openjdk/skara#openjdk-project-skara)
9195
for information on `jcheck` and other Skara tools.
9296
93-
TIP: prefix the pull request title with `WIP:` if you aren't yet
97+
TIP: Create a `Draft` pull request or prefix the pull request title with `WIP:` if you aren't yet
9498
ready for it to be reviewed. The Skara bot will not send an RFR
95-
email unless the title starts with a 7-digit bug ID.
96-
97-
Please cross-link the JBS Issue and the pull request. A link to the
98-
JBS issue can be added as part of the pull request's Description. A
99-
link to the PR, can be added as an issue link in the JBS bug. If
100-
you don't have direct JBS access, one of the Project Committers or
101-
Authors will do this for you.
99+
email unless the PR is out of the `Draft` state and the title starts with a 7-digit bug ID.
102100
103101
Please adhere to the general guideline that you should never force push
104102
to a publicly shared branch. Once you have opened your pull request, you
@@ -111,13 +109,15 @@ Once your changes and tests are ready to submit for review:
111109
also not be done. The Skara bot will squash your commits into a
112110
single commit, and rebase it onto the target branch when the pull
113111
request is integrated.
112+
See the [GitHub Help Documentation](https://docs.github.com/en/github)
113+
for additional help on using Git and GitHub.
114114
115115
4. Code review
116116
117117
All pull requests _must_ be reviewed according to the
118118
[OpenJFX Code Review Policies](https://wiki.openjdk.java.net/display/OpenJFX/Code+Reviews).
119119
It is the responsibility of the Reviewer(s) and the Committer who
120-
will integrate the change to ensure that the code review policies
120+
will integrate or sponsor the change to ensure that the code review policies
121121
are followed, and that all concerns have been addressed.
122122
123123
Discussion and review of the pull request can happen either by adding
@@ -137,11 +137,16 @@ Once your changes and tests are ready to submit for review:
137137
is one for low-impact bug fixes and two for enhancements or high-impact
138138
bug fixes.
139139
140-
NOTE: while the Skara tooling will indicate that the PR is
141-
ready to integrate once the first reviewer with a "Reviewer" role
142-
in the project has approved it, this may or may not be sufficient
143-
depending on the type of fix. For example, you must wait for a second
144-
approval for enhancements or high-impact bug fixes.
140+
NOTE: A Reviewer in the project can set the minimum number of reviewers
141+
for a PR using the Skara `/reviewers` command. For example,
142+
`/reviewers 2` is used for high-impact fixes and enhancements to indicate
143+
that two reviewers are needed, at least one of whom needs to have the
144+
Reviewer role in the project.
145+
146+
NOTE: A reviewer can indicate that a PR needs a
147+
[CSR](https://wiki.openjdk.java.net/display/csr/Main) by
148+
entering the `/csr` command. The Skara bot will then require an approved
149+
CSR before the PR can be integrated.
145150
146151
5. Integrate the pull request
147152
@@ -161,43 +166,55 @@ Once your changes and tests are ready to submit for review:
161166
one of the reviewers who reviewed your PR, but it need not be. The
162167
sponsor will issue the `/sponsor` command after you issue `/integrate`
163168
once they are satisfied that the review criteria have been met.
164-
165-
6. Resolve the JBS bug as "Fixed"
166-
167-
There is currently no automation for resolving JBS bugs, although
168-
a future Skara improvement will automate this. Until then,
169-
the Committer who integrated or sponsored the fix is responsible for
170-
resolving the JBS issue. You do this with the "Resolve" action in JBS,
171-
selecting "Fixed" as the resolution. You also need to add the commit
172-
notification message (minus the list of modified files) as a comment.
173-
This includes the URL of the commit. For example:
174-
175-
```
176-
Changeset: 1de25a49
177-
Author: Kevin Rushforth <kcr@openjdk.org>
178-
Date: 2019-09-23 08:15:36 +7000
179-
URL: https://git.openjdk.java.net/jfx/commit/1de25a49
180-
181-
8231126: libxslt.md has incorrect version string
182-
183-
Reviewed-by: ghb
184-
```
185-
186-
187-
Contributing to the OpenJFX codebase
169+
The Skara bot will automatically resolve the JBS issue as "Fixed"
170+
so there is no need to manually resolve it.
171+
172+
173+
New features / API additions
174+
----------------------------
175+
176+
Adding a new feature to OpenJFX requires us to consider what it means to support that API forever; we take compatibility seriously.
177+
The main idea is to think in terms of "stewardship" when evolving the JavaFX API. This will require significant effort on your part.
178+
It begins before you submit a pull request for review, and continues after the new feature is integrated.
179+
With that in mind, here are the needed steps to get a new feature into JavaFX.
180+
181+
1. Discuss the proposed feature on the [openjfx-dev](https://mail.openjdk.java.net/mailman/listinfo/openjfx-dev) mailing list.
182+
You should start with _why_ you think
183+
adding the API to the core of JavaFX is a good and useful addition for multiple applications (not just your own)
184+
and for the evolution of the JavaFX UI Toolkit. Part of this is to see whether the Project Leads and Reviewers
185+
are generally supportive of the idea, as well as to see whether other developers have any ideas as to whether
186+
and how it would be useful in their applications. We want to make sure that the new feature fits in with the
187+
existing API and will move the API forward in a direction we want to go. We need to ensure that the value
188+
proposition of the new feature justifies the investment, which goes well beyond the initial cost of developing it.
189+
Presuming that the feature meets the cost / benefit assessment (including opportunity cost), then discussion can
190+
proceed to the API.
191+
192+
2. Discuss the API needed to provide the feature. While this can't always be completely separated from its
193+
implementation, it is the public API itself that is important to nail down and get right. While we don't currently
194+
use the formal JEP process as is done for larger JDK features, the [JEP template](http://openjdk.java.net/jeps/2)
195+
provides some ideas to consider when proposing an API, such as a summary of the changes, goals, motivation, testing,
196+
dependencies, etc. A Draft (or WIP) pull request can be useful for illustrative purposes as long as the focus is on the public API.
197+
If there are trade-offs to be made in the implementation, or different implementation approaches that you might take,
198+
this is a good time to discuss it. Once this step is far enough along that there is general agreement as to the API,
199+
then it's time to focus on the implementation.
200+
201+
3. Submit a review of your proposed implementation. As noted in the
202+
[New features / API additions](https://wiki.openjdk.java.net/display/OpenJFX/Code+Reviews#CodeReviews-NewFeaturesC.Newfeatures/APIadditions.)
203+
section of the Code Review Policies doc, we also need a [CSR](https://wiki.openjdk.java.net/display/csr/Main), which documents the API change and its approval.
204+
The CSR can be reviewed in parallel. Changes in the API that arise during the review need to be reflected in the CSR, meaning
205+
that the final review / approval of the CSR usually happens late in the review cycle.
206+
You can avoid extra work by waiting to submit the CSR until the API is agreed upon and the code review for the documentation is reasonably far along.
207+
208+
TIP: a pull request is _not_ the starting point, since that skips the first two important steps and jumps right into
209+
"given this new feature, and an API definition that specifies it, please review my proposed implementation".
210+
211+
Coding style and testing guidelines
188212
------------------------------------------
189213
190-
JDK 11 (at a minimum) is required to build OpenJFX. You must have a JDK 11 installation
191-
with the environment variable `JAVA_HOME` referencing the path to Java home for
192-
your JDK 11 installation. By default, tests use the same runtime as `JAVA_HOME`.
193-
Currently OpenJFX builds are running on JDK 11 (recommended) and JDK 12.
194-
195-
It is possible to develop in any major Java IDE (Eclipse, IntelliJ, NetBeans). IDEs can automatically configure projects based on Gradle setup.
196-
197214
The following formatting rules are enforced for source code files by
198215
`git jcheck`, which is run by the Skara bot:
199216
200-
* Use Unix-style (LF) line endings not DOS-style (CRLF)
217+
* Use Unix-style (LF) line endings, not DOS-style (CRLF)
201218
* Do not use TAB characters (exception: Makefiles can have TABS)
202219
* No trailing spaces
203220
* No files with execute permission
@@ -207,10 +224,21 @@ Please also follow these formatting guidelines:
207224
* Java indent is 4 spaces
208225
* Line width is no more than 120 characters
209226
* The rest is left to Java coding standards
210-
* Disable &ldquo;auto-format on save&rdquo; to prevent unnecessary format changes. This makes reviews much harder as it generates unnecessary formatting changes. If your IDE supports formatting only modified chunks that is fine to do.
211-
* Wildcard imports (`import foo.bar.baz.*`) are forbidden and may cause the build to fail. Please attempt to tame your IDE so it doesn't make them and please send a PR against this document with instructions for your IDE if it doesn't contain them.
227+
* Avoid making changes that are unrelated to the bug you are fixing. This includes fixing minor errors such as warnings, spacing / indentation, spelling errors, etc, in code that you aren't otherwise modifying as part of your fix.
228+
* Disable &ldquo;auto-format on save&rdquo; to prevent your IDE from making unnecessary formatting changes. This makes reviews much harder as it generates unnecessary diffs. If your IDE supports formatting only modified chunks, that is fine to do.
229+
* Wildcard imports &ndash; for example, `import java.util.*;` &ndash; are forbidden and may cause the build to fail. Please attempt to configure your IDE so it doesn't generate wildcard imports. An exception to this rule is that wildcard static imports in test classes are allowed, for example, `import static org.junit.Assert.*;`.
212230
* Don't worry too much about import order. Try not to change it but don't worry about fighting your IDE to stop it from doing so.
213231
232+
### Building and testing
233+
234+
JDK 11 (at a minimum) is required to build OpenJFX. You must have the JDK
235+
installed on your system
236+
with the environment variable `JAVA_HOME` referencing the path to Java home for
237+
your JDK installation. By default, tests use the same runtime as `JAVA_HOME`.
238+
Currently OpenJFX will build and run on JDK 11 through JDK 18. JDK 17 is recommended.
239+
240+
It is possible to develop in any major Java IDE (Eclipse, IntelliJ, NetBeans). IDEs can automatically configure projects based on Gradle setup.
241+
214242
OpenJFX uses Gradle for its build. Before submitting your changes, run the test suite to make sure that nothing is broken, with:
215243
216244
```sh
@@ -223,5 +251,7 @@ If you are changing anything that might possibly affect rendering, you should ru
223251
bash ./gradlew -PFULL_TEST=true -PUSE_ROBOT=true all test
224252
```
225253

254+
If you don't build WebKit (using the `-PCOMPILE_WEBKIT=true` option), you are likely to get test failures when running the web tests. See the [Web Testing](WEBKIT-MEDIA-STUBS.md) page for information on how to address this.
255+
226256
Even more documentation on OpenJFX projects and its build system can be found on the
227257
[OpenJFX Wiki](https://wiki.openjdk.java.net/display/OpenJFX/).

0 commit comments

Comments
 (0)