|
| 1 | +# Contributing to the plugin |
| 2 | + |
| 3 | +Plugin source code is hosted on [GitHub](https://github.com/jenkinsci/docker-java-api-plugin). |
| 4 | +New feature proposals and bug fix proposals should be submitted as |
| 5 | +[GitHub pull requests](https://help.github.com/articles/creating-a-pull-request). |
| 6 | +Your pull request will be evaluated by the [Jenkins job](https://ci.jenkins.io/job/Plugins/job/docker-java-api-plugin/). |
| 7 | + |
| 8 | +Before submitting your change, please assure that you've added tests which verify your change. |
| 9 | + |
| 10 | +## Code formatting with spotless |
| 11 | + |
| 12 | +Source code and pom file formatting are maintained by the `spotless` maven plugin. |
| 13 | +Before submitting a pull request, please format with: |
| 14 | + |
| 15 | +* `mvn spotless:apply` |
| 16 | + |
| 17 | +## Static analysis with spotbugs |
| 18 | + |
| 19 | +Please don't introduce new spotbugs output. |
| 20 | + |
| 21 | +* `mvn spotbugs:check` to analyze project using [Spotbugs](https://spotbugs.github.io) |
| 22 | +* `mvn spotbugs:gui` to review report using GUI |
| 23 | + |
| 24 | +## Code Coverage |
| 25 | + |
| 26 | +[JaCoCo code coverage](https://www.jacoco.org/jacoco/) reporting is available as a maven target and is [reported](https://ci.jenkins.io/job/Plugins/job/docker-java-api-plugin/) by the [Jenkins warnings plugin](https://plugins.jenkins.io/warnings-ng/). |
| 27 | +Please try to improve code coverage with tests when you submit a pull request. |
| 28 | + |
| 29 | +* `mvn -P enable-jacoco clean install jacoco:report` to report code coverage with JaCoCo. |
| 30 | + |
| 31 | +### Reviewing Code Coverage |
| 32 | + |
| 33 | +The code coverage report is a set of HTML files that show methods and lines executed. |
| 34 | +The following commands will open the `index.html` file in the browser. |
| 35 | + |
| 36 | +* Windows - `start target\site\jacoco\index.html` |
| 37 | +* Linux - `xdg-open target/site/jacoco/index.html` |
| 38 | + |
| 39 | +The file will have a list of package names. |
| 40 | +Click on them to find a list of class names. |
| 41 | + |
| 42 | +The lines of the code will be covered in three different colors, red, green, and orange. |
| 43 | +Red lines are not covered in the tests. |
| 44 | +Green lines are covered with tests. |
| 45 | + |
| 46 | +## Maintaining automated tests |
| 47 | + |
| 48 | +Automated tests are run as part of the `verify` phase. |
| 49 | +Run automated tests in a development environment with the command: |
| 50 | + |
| 51 | +``` |
| 52 | +$ mvn clean verify |
| 53 | +``` |
| 54 | + |
| 55 | +## Report an Issue |
| 56 | + |
| 57 | +Use the ["Report an issue" page](https://www.jenkins.io/participate/report-issue/redirect/#23136) to submit bug reports. |
| 58 | +Please review [existing issues](https://issues.jenkins.io/issues/?jql=resolution%20is%20EMPTY%20and%20component%3D23136) before submitting a new issue. |
| 59 | +Please use the ["How to Report an Issue"](https://www.jenkins.io/participate/report-issue/) guidelines when reporting issues. |
0 commit comments