10 KB
Newer Older
# How to contribute to Orfeo ToolBox ?
2 3 4 5 6 7 8 9 10 11 12 13 14 15

Thank you for taking the time to contribute to OTB! This document will guide you
through the workflow and best practices you need to know to send your

There are many ways to contribute to OTB:

* [Reporting a bug](#reporting-bugs)
* [Making a feature request](#feature-requests-and-discussions)
* [Improving documentation](#documentation-improvements)
* [Contributing code (C++, Python, CMake, etc.)](#code-contribution)
* [Publishing a remote module](#remote-modules)

Our main workflow uses GitLab for source control, issues and task tracking. We
use a self-hosted GitLab instance:
17 18 19 20 21 22 23 24 25


Remember to check out also our [developers mailing list](!forum/otb-developers/join),
where we discuss some features, improvements and high level project planning.
You are welcome to ask questions there as a beginner or future OTB contributor!

## Reporting bugs

If you have found a bug, you can first [search the existing issues](
27 28
to see if it has already been reported.

If it's a new bug, please [open a new issue on GitLab](
30 31 32 33 34 35
The 'Bug' issue template will help you provide all important information and
help fixing the bug quicker. Remember to add as much information as possible!

## Feature requests and discussions

Feature requests are welcome! Generally you are welcome to simply [open an issue](
36 37
and discuss your idea there. For more complex requests there is an issue
template for in depth description called 'Request for Comments'.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

## Documentation improvements

The two main OTB documentations are the [Software Guide](
and the [CookBook](  Their sources are
hosted in the main OTB repository in the `Documentation/` directory. Then, to
contribute documentation use the same workflow as for code contributions (see

See also the [Compiling documentation](
wiki page for help on building the Sphinx and Latex source.

## Code contribution

The OTB workflow is based on GitLab [Merge Requests](
Clone the repository, create a feature branch, commit your changes, push the
feature branch to a fork (or the main repository if you are a core developer),
then send a merge request.

58 59
Note that we also accept PRs on our [GitHub mirror](
which we will manually merge.

Manuel Grizonnet's avatar
Manuel Grizonnet committed
Feature branches are tested on multiple platforms on the OTB test infrastructure (a.k.a the [Dashboard]( They appear in the FeatureBranches section. 

63 64
Caveat: even if the Dashboard build on develop branch is broken, it is not
allowed to push fixes directly on develop. The developer trying to fix the
65 66
build should create a merge request and submit it for review. Direct push to
develop without review must be avoided.

68 69 70 71
### Commit message

On your feature branch, write a good [commit message](
short and descriptive. If fixing an issue or bug, put the issue number in the
commit message so that GitLab can [cross-link it](
You can prefix your commit message with an indicating flag (DOC, BUG, PKG,
TEST, SuperBuild, etc.).

76 77 78 79 80 81 82 83 84 85
Standard prefixes for OTB commit messages:

    BUG: Fix for runtime crash or incorrect result
    COMP: Compiler error or warning fix
    DOC: Documentation change
    ENH: New functionality
    PERF: Performance improvement
    STYLE: No logic impact (indentation, comments)
    WIP: Work In Progress not ready for merge

86 87 88 89 90 91 92 93 94 95
For example, here are some good commit messages:

    BUG: #1701 Warn users if parameter string is unset
    DOC: Fix typo in Monteverdi French translation
    COMP: Allow GeoTIFF and TIFF to be disabled when no 3rd party drags them

### Merge request

Your contribution is ready to be added to the main OTB repository? Send a Merge
Request against the `develop` branch on GitLab using the merge request
Victor Poughon's avatar
Victor Poughon committed
96 97
template. The merge request will then be discussed by the community and the core
OTB team.

* Merge requests can not be merged until all discussions have been resolved (this is enforced by GitLab)
Julien Michel's avatar
Julien Michel committed
* Merge requests **must receive at least 2 positives votes from core developers** (members of Main Repositories group in Gitlab with at least "Developer" level; this includes PSC members) before being merged
* The merger is responsible for checking that the branch is up-to-date with develop
* Merge requests can be merged by anyone (not just PSC or RM) with push access to develop
103 104 105
* Merge requests can be merged once the dashboard is proven green for this branch.
  This condition is mandatory unless reviewers and authors explicitely agree that
  it can be skipped (for instance in case of documentation merges or compilation
106 107
  fixes on develop). Branches of that sort can be identified with the ~patch label, 
  which tells the reviewer that the author would like to merge without dashboard testing.

Victor Poughon's avatar
Victor Poughon committed
Branches can be registered for dashboard testing by adding one line in `Config/feature_branches.txt` in [otb-devutils repository](

Victor Poughon's avatar
Victor Poughon committed
For branches in the main repository, the syntax is the following:
112 113 114 115 116

branch_name [otb-data_branch_name]

Victor Poughon's avatar
Victor Poughon committed
The second branch name is optional. It can be set if you need to modify [otb-data]( according to your changes.

Victor Poughon's avatar
Victor Poughon committed
For branches in forks, the syntax is the following:
120 121 122
user/branch_name [user/otb-data_branch_name]
Victor Poughon's avatar
Victor Poughon committed
Again, the second branch name is optional.

Victor Poughon's avatar
Victor Poughon committed
For users without push access to [otb-devutils repository](, the modification can be asked through a merge requests to this repository.

Once the feature branch is registered for testing, it should appear in the *FeatureBranches* section of the [OTB dashboard]( next day (remember tests are run on a nightly basis).
128 129

Do not forget to remove the feature branch for testing once it has been merged.

131 132 133 134 135 136 137 138
### Contribution license agreement

OTB requires that contributors sign out a [Contributor License
Agreement]( The
purpose of this CLA is to ensure that the project has the necessary ownership or
grants of rights over all contributions to allow them to distribute under the
chosen license (Apache License Version 2.0)

Julien Michel's avatar
Julien Michel committed
To accept your contribution, we need you to complete, sign and email to *cla [at]
140 141 142 143 144 145 146
orfeo-toolbox [dot] org* an [Individual Contributor Licensing
Agreement]( (ICLA) form and a
[Corporate Contributor Licensing
Agreement]( (CCLA) form if you are
contributing on behalf of your company or another entity which retains copyright
for your contribution.

147 148 149 150
The copyright owner (or owner's agent) must be mentioned in headers of all
modified source files and also added to the [NOTICE

151 152
## Remote modules

[Remote Modules]( are
the preferred way if you wish to make your apps and filters available to the
155 156 157 158 159
community while keeping control and maintenance of their sources. Remote
modules are just like regular modules, except they are not distributed inside
OTB source code. Under some conditions (dependencies, official acceptance
process, etc.), we are also able to distribute your remote module in the
official standalone binaries. See [the wiki](
for more information.

## GitLab guidelines

In order to organize the issues in our GitLab instance, we use both labels and
165 166 167

The [milestones]( should be used to track in which release a feature is merged.
GitLab can then provide a summary of all features and bugs added to a given release
169 170 171 172 173 174 175

Regarding labels, we use the following set:
* ~story: significant feature to be implemented with a detailed work plan, it can
  correspond to a Request for Comments that has turned into a development action
* ~bug: Bug, crash or unexpected behavior, reported by a user or a developer
* ~feature: Feature request expressed by an OTB user/developer
* ~patch: A small patch fixing build warnings, compilation errors, typos in logs or documentation
177 178 179
* ~"To Do": action is planned
* ~Doing: work in progress
* ~api ~app ~documentation ~monteverdi ~packaging ~qgis: optional context information
180 181 182 183 184 185 186 187 188 189 190 191 192

## Versioning

Starting from OTB 7.0.0, we use [semantic versioning]( See the website for the full spec, in summary:

> Given a version number MAJOR.MINOR.PATCH, increment the:
>  1. MAJOR version when you make incompatible API changes,
>  2. MINOR version when you add functionality in a backwards-compatible manner, and
>  3. PATCH version when you make backwards-compatible bug fixes.
> Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

Victor Poughon's avatar
Victor Poughon committed
The develop branch is always the place where the upcoming major or minor release is worked on. Patch releases are done on release branches, for example 7.0.1 and 7.0.2 could be found on the release-7.0 branch.

Victor Poughon's avatar
Victor Poughon committed
For the purpose of defining backwards compatibility, the OTB API covers (not an exhaustive list): the C++ API, the Python bindings, application names, application parameters, output format and interpretation of input data.
Victor Poughon's avatar
Victor Poughon committed
196 197

When we deprecate part of our public API, we should do two things: (1) update our documentation to let users know about the change, (2) issue a new minor or major release with the deprecation in place.