We follow a simple model to make contributing as straightforward as possible. These guidelines allow us to streamline the development process and achieve greater transparency.
Help us keep java-api open and inclusive. Please read and follow our Code of Conduct.
Please join us on or Discussions.
If you find a bug or if something is missing in the source code, you can help us by submitting an issue, or even better, you can submit a Pull Request with a fix.
Tip
You may use our devcontainer.
For java-api we rely on Python 2.7.18 for development, Python 3.12 for
typechecking and the latest stable release to run tests and style checks with
pre-commit, pylint and tox. Additionally, we use commitizen to
help us maintain consistent and meaningful commit messages.
-
Once you've installed Python, install the required packages for development you may run the following command:
python2 -m pip install --requirement java-api/requirements.txt
-
Install Python 3 tools
-
python3 -m pip install pre-commit
-
Install the git hook scripts
pre-commit install --hook-type pre-commit --hook-type commit-msg --hook-type pre-push
-
-
python3 -m pip install tox
-
For java-api we use the GitHub flow as main versioning workflow.
- Fork the repository
- Create a new branch from main for each feature, fix or improvement, using
the following naming convention:
feat/scope/feature-namewhen introducing a new featurefix/scope/fix-namewhen fixing an existing issuedocs/changefor documentation changeschore/chore-descfor miscellaneous changes
- Make sure to run
pre-commitandtox - Add your commits to the branch following our Commit Message Format
- Send a pull request from each feature branch to the main branch
It is very important to separate new features or improvements into separate feature branches, and to send a pull request for each branch.
This allows us to review and pull in new features or improvements individually.
We use the Black code style, but also rely on other tools.
We have very precise rules over how our Git commit messages must be formatted. This format leads to easier to read commit history.
Each commit message consists of a header, a body, and a footer, trying to adhere to the "50/72 rule".
<header>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
The header is mandatory and must conform to the Conventional Commits specification.
Additionally, we recommend trying to keep the header to a maximum of 50 characters.
The body is mandatory for all commits except for those of type "docs".
When the body is present it should be wrapped at 72 characters.
The footer is optional. The Commit Message Footer format describes what the
footer is used for and the structure it must have.
<type>(<scope>): <summary>
The <type> and <summary> fields are mandatory, the (<scope>) field is optional.
Must be one of the following:
- build: Changes that affect the build system or external dependencies
(example scope:
deps,pip) - chore: Other changes that don't modify src or test files (example scopes:
release) - ci: Changes to our CI configuration files and scripts (example scope:
pip) - docs: Documentation only changes
- feat: A new feature (example scopes:
ia,java,javax,org,system) - fix: A bug fix (example scopes: same as feat)
- perf: A code change that improves performance (example scopes: same as feat)
- refactor: A code change that neither fixes a bug nor adds a feature (example scopes: same as feat)
- revert: Reverts a previous commit
- style: Changes that do not affect the meaning of the code (white-space, formatting, etc.)
- test: Adding missing tests or correcting existing tests
The scope should be the name of the Python package affected.
The following is the list of supported scopes:
- ia: for changes to the
com.inductiveautomationpackage - java: for changes to the
javapackage - javax: for changes to the
javaxpackage - org: for changes to the
orgpackage - pip: for changes to Python Packaging files (
pyproject.toml,setup.cfg,setup.py) - system: for changes to the
systempackage - thecesrom: for changes to the
dev.thecesrompackage
There are currently a few exceptions to the "use package name" rule:
- deps: for updating dependencies for our CI scripts. This is mainly used by
dependabotandpre-commit.ci - pip: for changes to
setup.[cfg|py], or the package publishing workflow - release: used for creating a new release
- none/empty string: useful for changes that are done across all packages (e.g.
style: use black style) and for docs changes that are not related to a specific package (e.g.docs: fix typo in README).
Use the summary field to provide a succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end
Example Conventional Commit message:
refactor(ia): improve Version comparison logic
The footer can contain information about breaking changes and deprecations and is also the place to reference GitHub issues, and other PRs that this commit closes or is related to. For example:
BREAKING CHANGE: <breaking change summary>
<BLANK LINE>
<breaking change description + migration instructions>
<BLANK LINE>
<BLANK LINE>
Fixes #<issue number>
or
DEPRECATED: <what is deprecated>
<BLANK LINE>
<deprecation description + recommended update path>
<BLANK LINE>
<BLANK LINE>
Closes #<pr number>
Breaking Change section should start with the phrase "BREAKING CHANGE: " followed by a summary of the breaking change, a blank line, and a detailed description of the breaking change that also includes migration instructions.
Similarly, a Deprecation section should start with "DEPRECATED: " followed by a short description of what is deprecated, a blank line, and a detailed description of the deprecation that also mentions the recommended update path.
If the commit reverts a previous commit, it should begin with revert:,
followed by the header of the reverted commit.
The content of the commit message body should contain:
- information about the SHA of the commit being reverted in the following
format:
This reverts commit <SHA>, - a clear description of the reason for reverting the commit message.
Example:
revert(ci): remove condition from job
Refs: 2a50de4