2021-02-23 11:00:18 +01:00
|
|
|
|
# Contributing to Eclipse hawkBit
|
2016-01-21 13:18:55 +01:00
|
|
|
|
|
|
|
|
|
|
:+1: First off, thanks for taking the time to contribute! We really appreciate this. :+1:
|
|
|
|
|
|
|
|
|
|
|
|
Please read this if you intend to contribute to the project.
|
|
|
|
|
|
|
2016-02-24 10:20:33 +01:00
|
|
|
|
## Conventions
|
|
|
|
|
|
|
|
|
|
|
|
### Code Style
|
2016-01-21 13:18:55 +01:00
|
|
|
|
|
|
|
|
|
|
* Java files:
|
2024-11-05 11:41:56 +02:00
|
|
|
|
* we follow the standard eclipse IDE (built in) code formatter with the following changes:
|
|
|
|
|
|
* Tab policy: spaces only: 4
|
|
|
|
|
|
* We recommend using at least Eclipse [Mars](https://www.eclipse.org/mars/) IDE release. It seems that the Java code
|
|
|
|
|
|
formatter line break handling has been changed between [Luna](https://www.eclipse.org/luna/) and Mars.
|
2016-01-21 13:18:55 +01:00
|
|
|
|
* XML files:
|
2024-11-05 11:41:56 +02:00
|
|
|
|
* we follow the standard eclipse IDE XML formatter with the following changes:
|
|
|
|
|
|
* Indent using spaces only: 3
|
2016-01-21 13:18:55 +01:00
|
|
|
|
* SCSS files:
|
2024-11-05 11:41:56 +02:00
|
|
|
|
* we follow the standard [scss-lint](https://github.com/brigade/scss-lint/) rules with the following exception:
|
|
|
|
|
|
* disabled rules: ImportantRule, PropertySortOrder
|
2016-01-21 13:18:55 +01:00
|
|
|
|
* Sonarqube:
|
2024-11-05 11:41:56 +02:00
|
|
|
|
* Our rule set can be found [here](https://sonarcloud.io/organizations/bosch-iot-rollouts/rules)
|
|
|
|
|
|
* Sonarqube reports can be
|
|
|
|
|
|
found [here](https://sonarcloud.io/project/overview?id=org.eclipse.hawkbit%3Ahawkbit-parent)
|
2016-01-21 13:18:55 +01:00
|
|
|
|
|
2017-06-01 06:28:59 +02:00
|
|
|
|
### Utility library usage
|
|
|
|
|
|
|
2024-11-05 11:41:56 +02:00
|
|
|
|
hawkBit has currently [Apache commons lang](https://commons.apache.org/proper/commons-lang/) on the classpath in several
|
|
|
|
|
|
of its modules. However, we see introducing too many utility libraries problematic as we force these as transitive
|
|
|
|
|
|
dependencies on hawkBit users. We in fact are looking into reducing them in future not adding new ones.
|
2017-06-01 06:28:59 +02:00
|
|
|
|
|
|
|
|
|
|
So we kindly ask contributors:
|
|
|
|
|
|
|
|
|
|
|
|
* not introduce extra utility library dependencies
|
2024-11-12 12:06:56 +02:00
|
|
|
|
* keep them out of the core modules (e.g. hawkbit-core, hawkbit-rest-core) to avoid that all
|
2024-11-05 11:41:56 +02:00
|
|
|
|
modules have them as transitive dependency
|
2017-06-01 06:28:59 +02:00
|
|
|
|
* use utility functions in general based in the following priority:
|
2024-11-05 11:41:56 +02:00
|
|
|
|
* use utility functions from JDK if feasible
|
|
|
|
|
|
* use Spring utility classes if feasible
|
|
|
|
|
|
* use [Apache commons lang](https://commons.apache.org/proper/commons-lang/) if feasible
|
2017-06-01 06:28:59 +02:00
|
|
|
|
|
2016-02-24 10:20:33 +01:00
|
|
|
|
### Test documentation
|
|
|
|
|
|
|
2025-06-20 15:51:06 +03:00
|
|
|
|
You could document the test cases using the following format:
|
2021-02-23 11:00:18 +01:00
|
|
|
|
|
|
|
|
|
|
```java
|
2025-06-20 15:51:06 +03:00
|
|
|
|
/**
|
|
|
|
|
|
* Feature: TEST_TYPE - HAWKBIT_COMPONENT<br/>
|
|
|
|
|
|
* Story: Test class description
|
|
|
|
|
|
*/
|
2016-02-24 10:20:33 +01:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Test types are:
|
2018-06-06 10:16:46 +02:00
|
|
|
|
|
2016-02-24 10:20:33 +01:00
|
|
|
|
* Unit Tests - for single units tests with a mocked environment
|
2024-11-05 11:41:56 +02:00
|
|
|
|
* Component Tests - for complete components including lower layers, e.g. Spring MVC test on rest API including
|
|
|
|
|
|
repository and database.
|
2016-02-24 10:20:33 +01:00
|
|
|
|
* Integration Tests - including clients, e.g. Selenium UI tests with various browsers.
|
|
|
|
|
|
* System Tests - on target environments, e.g. Cloud Foundry.
|
|
|
|
|
|
|
|
|
|
|
|
Examples for hawkBit components:
|
2018-06-06 10:16:46 +02:00
|
|
|
|
|
2016-02-24 10:20:33 +01:00
|
|
|
|
* Management API
|
|
|
|
|
|
* Direct Device Integration API
|
|
|
|
|
|
* Device Management Federation API
|
|
|
|
|
|
* Repository
|
|
|
|
|
|
* Security
|
|
|
|
|
|
|
2016-01-21 13:18:55 +01:00
|
|
|
|
## Legal considerations for your contribution
|
|
|
|
|
|
|
2018-06-06 10:16:46 +02:00
|
|
|
|
Before your contribution can be accepted by the project team contributors must
|
|
|
|
|
|
electronically sign the [Eclipse Contributor Agreement (ECA)](http://www.eclipse.org/legal/ECA.php).
|
2016-01-21 13:18:55 +01:00
|
|
|
|
|
2018-06-06 10:16:46 +02:00
|
|
|
|
Commits that are provided by non-committers must have a Signed-off-by field in
|
|
|
|
|
|
the footer indicating that the author is aware of the terms by which the
|
|
|
|
|
|
contribution has been provided to the project. The non-committer must
|
|
|
|
|
|
additionally have an Eclipse Foundation account and must have a signed Eclipse
|
|
|
|
|
|
Contributor Agreement (ECA) on file.
|
2016-01-21 13:18:55 +01:00
|
|
|
|
|
2018-06-06 10:16:46 +02:00
|
|
|
|
For more information, please see the Eclipse Committer Handbook:
|
2021-02-23 11:00:18 +01:00
|
|
|
|
[https://www.eclipse.org/projects/handbook/#resources-commit](https://www.eclipse.org/projects/handbook/#resources-commit)
|
2016-01-21 13:18:55 +01:00
|
|
|
|
|
2018-06-06 16:52:34 +02:00
|
|
|
|
HowTo "Sign-off" your commits:
|
2016-01-21 13:18:55 +01:00
|
|
|
|
|
|
|
|
|
|
You do this by adding the `-s` flag when you make the commit(s), e.g.
|
|
|
|
|
|
|
2021-02-23 11:00:18 +01:00
|
|
|
|
```bash
|
|
|
|
|
|
git commit -s -m "Shave the yak some more"
|
|
|
|
|
|
```
|
2016-01-21 13:18:55 +01:00
|
|
|
|
|
2021-02-03 17:30:53 +01:00
|
|
|
|
### License Header
|
|
|
|
|
|
|
|
|
|
|
|
Please make sure newly created files contain a proper license header like this:
|
|
|
|
|
|
|
2021-02-23 11:00:18 +01:00
|
|
|
|
```java
|
2021-02-03 17:30:53 +01:00
|
|
|
|
/**
|
2023-09-14 11:03:20 +03:00
|
|
|
|
* Copyright (c) {date} {owner} [and others]
|
2021-02-03 17:30:53 +01:00
|
|
|
|
*
|
2023-09-14 11:03:20 +03:00
|
|
|
|
* This program and the accompanying materials are made
|
|
|
|
|
|
* available under the terms of the Eclipse Public License 2.0
|
|
|
|
|
|
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
|
|
|
|
*
|
|
|
|
|
|
* SPDX-License-Identifier: EPL-2.0
|
2021-02-03 17:30:53 +01:00
|
|
|
|
*/
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2016-01-21 13:18:55 +01:00
|
|
|
|
## Making your changes
|
|
|
|
|
|
|
|
|
|
|
|
* Fork the repository on GitHub
|
|
|
|
|
|
* Create a new branch for your changes
|
|
|
|
|
|
* Make your changes
|
|
|
|
|
|
* Make sure you include tests
|
|
|
|
|
|
* Make sure the tests pass after your changes
|
|
|
|
|
|
* Commit your changes into that branch
|
|
|
|
|
|
* Use descriptive and meaningful commit messages
|
|
|
|
|
|
* If you have a lot of commits squash them into a single commit
|
|
|
|
|
|
* Make sure you use the `-s` flag when committing as explained above.
|
|
|
|
|
|
* Push your changes to your branch in your forked repository
|
|
|
|
|
|
|
|
|
|
|
|
## Submitting the changes
|
|
|
|
|
|
|
|
|
|
|
|
Submit a pull request via the normal GitHub UI (desktop or web).
|
|
|
|
|
|
|
|
|
|
|
|
## After submitting
|
|
|
|
|
|
|
|
|
|
|
|
* Do not use your branch for any other development, otherwise further changes that you make will be visible in the PR.
|
|
|
|
|
|
|
2021-02-23 11:00:18 +01:00
|
|
|
|
## Reporting a security vulnerability
|
|
|
|
|
|
|
2024-11-05 11:41:56 +02:00
|
|
|
|
If you find a vulnerability, **DO NOT** disclose it in the public immediately! Instead, give us the possibility to fix
|
|
|
|
|
|
it beforehand.
|
|
|
|
|
|
So please don’t report your finding using GitHub issues and better head over
|
|
|
|
|
|
to [https://eclipse.org/security](https://eclipse.org/security) and learn how to disclose a vulnerability in a safe and
|
|
|
|
|
|
responsible manner
|
2021-02-23 11:00:18 +01:00
|
|
|
|
|
2018-06-06 10:16:46 +02:00
|
|
|
|
## Further information
|
2016-01-21 13:18:55 +01:00
|
|
|
|
|
|
|
|
|
|
* [Eclipse Project Page](http://projects.eclipse.org/projects/iot.hawkbit)
|