diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2025ad8f0fe..022f66d266f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,224 +1,194 @@ -# How to contribute +# How to Contribute -We would love you to contribute to this project. You can do so in various ways. - - -## Contribute your knowledge - -Help others by participating in our [forum](https://forum.camunda.org/). - -Before you ask a question, search the forum. The answer may have already been provided. - - -## File bugs or feature requests +* [Ways to Contribute](#ways-to-contribute) +* [Build from Source](#build-from-source) +* [Create a Pull Request](#create-a-pull-request) +* [Contribution Checklist](#contribution-checklist) +* [Contributor License Agreement (CLA)](#contributor-license-agreement-cla) +* [Commit Message Conventions](#commit-message-conventions) +* [License Headers](#license-headers) +* [Review Process](#review-process) -[File bugs](https://app.camunda.com/jira/) you found in the code or [features](https://app.camunda.com/jira/) you would like to see in the future in our [issue tracker](https://app.camunda.com/jira/). - -* Register yourself on our [issue tracker](https://app.camunda.com/jira/) -* Search the list of open issues first, your bug or feature may have already been reported -* When filing a bug - * Be concise - * Qualify steps to reproduce a problem - * Specify environment you found the bug in (library version etc.) - * If possible, attach a test case that reproduces the problem - - -## Contribute code - -You can contribute code that fixes bugs and/or implements features. - -* [Start with an EasyPick](https://jira.camunda.com/issues/?jql=project%20%3D%20CAM%20AND%20labels%20%3D%20EasyPick%20AND%20status%20%3D%20Open): In our Jira we label issues which we consider small and easy to start on as EasyPicks. -* Have a look on [what we are working on](https://app.camunda.com/jira/secure/RapidBoard.jspa?rapidView=39) first to check that we do not perform duplicated work -* Read through our contribution guide lines -* Implement the feature or bug fix on a [feature branch and submit the result as a pull request](http://lefedt.de/blog/posts/2013/contributing-to-oss-through-pull-requests/) +# Ways to Contribute +We would love you to contribute to this project. You can do so in various ways. -## Write Tests -Best practices for writing test cases: +## Contribute your Knowledge -* write JUnit4-style tests, not JUnit3 -* Project `camunda-engine`: If you need a process engine object, use the JUnit rule `org.camunda.bpm.engine.test.util.ProvidedProcessEngineRule`. It ensures that the process engine object is reused across test cases and that certain integrity checks are performed after every test. For example: - ``` - public ProcessEngineRule engineRule = new ProvidedProcessEngineRule(); +Help others by participating in our [forum](https://forum.camunda.org/). Please read the [Forum FAQ](https://forum.camunda.org/faq) before you start. - @Test - public void testThings() { - ProcessEngine engine = engineRule.getProcessEngine(); - ... - } - ``` -* Project `camunda-engine`: As an alternative to the above, you can extend extend the `org.camunda.bpm.engine.test.util.PluggableProcessEngineTest` class. - The class already provides an instance of the `ProvidedProcessEngineRule`, as well as the `ProcessEngineTestRule` that - provides some additional custom assertions and helper methods. - * However, if you need to make modifications to the `ProcessEngineConfiguration`, then please use the `ProcessEngineBootstrapRule` - as described below. -* Project `camunda-engine`: If you need a process engine with custom configuration, use the JUnit rule `org.camunda.bpm.engine.test.util.ProcessEngineBootstrapRule` and chain it with `org.camunda.bpm.engine.test.util.ProvidedProcessEngineRule` like so: - ``` - protected ProcessEngineBootstrapRule bootstrapRule = new ProcessEngineBootstrapRule(configuration -> { - // apply configuration options here - }); - protected ProvidedProcessEngineRule engineRule = new ProvidedProcessEngineRule(bootstrapRule); +## File Bugs or Feature Requests - @Rule - public RuleChain ruleChain = RuleChain.outerRule(bootstrapRule).around(engineRule); - ``` +File bugs you found in the code or features you would like to see in the future in our [JIRA project named CAM](https://jira.camunda.com/browse/CAM). +1. [Signup for our JIRA](https://jira.camunda.com/secure/Signup!default.jspa) +1. [Search for similar issues](https://jira.camunda.com/issues/?jql=project%20%3D%20CAM), your bug or feature may have already been reported +1. [Create a new ticket](https://jira.camunda.com/secure/CreateIssue!default.jspa) + 1. Select the CAM project + 1. Be concise + 1. Describe the steps to reproduce the problem or the context of the feature request + 1. Specify your environment (e.g. Camunda version, Camunda modules you use, ...) + 1. Provide code. For a bug report, create a test that reproduces the problem. For feature requests, create mockup code that shows how the feature might look like. Fork our [unit test Github template](https://github.com/camunda/camunda-engine-unittest) to get started quickly. -## Coding styles -* tabs as spaces / tab size 2 (all files) -* If you created a number of commits, [squash](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) your work into a few commits only. -* Create commit messages that adhere to our commit message style(see below). +## Write Code +You can contribute code that fixes bugs and/or implements features. Here is how it works: -## License headers +1. Select a ticket that you would like to implement. Tickets labelled [EasyPick](https://jira.camunda.com/issues/?jql=project%20%3D%20CAM%20AND%20status%20in%20(Open%2C%20Reopened%2C%20Ready)%20AND%20labels%20in%20(easy-pick%2C%20EasyPick)) are tickets that require little effort and can be good candidates to start. Be aware though that some of them need good knowledge of the surrounding code. +1. Tell us in the ticket comments or in the [forum](https://forum.camunda.org/c/contributions/14) (select the *Contributions* category) that you want to work on your ticket. This is also the place where you can ask questions. +1. Check your code changes against our [contribution checklist](#contribution-checklist) +1. [Create a pull request on Github](). Note that you can already do this earlier if you would like feedback on your work in progress. -Every source file needs to contain the following license header at the top: -``` -Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH -under one or more contributor license agreements. See the NOTICE file -distributed with this work for additional information regarding copyright -ownership. Camunda licenses this file to you under the Apache License, -Version 2.0; you may not use this file except in compliance with the License. -You may obtain a copy of the License at +# Build from Source - http://www.apache.org/licenses/LICENSE-2.0 +In order to build our codebase from source, add the following to your Maven `settings.xml`. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +```xml + + + camunda-bpm + + + camunda-bpm-nexus + camunda-bpm-nexus + + true + + + true + + https://app.camunda.com/nexus/content/groups/public + + + + + + camunda-bpm + ``` -The header can be added manually, it can be set through your IDE's settings so that it is added to new source files automatically, or by running `mvn clean install -Plicense-header-check`. The last option will run a License Header plugin that will go through all the source files and add a license header to the ones that don't have one. It will also re-format an incorrectly formatted license header. - -It should be noted that `Java` source files from a contribution, that do not contain a valid license header, will not be merged with the codebase. - -## Contributor License Agreement +An entire repository can then be built by running `mvn clean install` in the root directory. This will build all sub modules and execute unit tests. Furthermore, you can restrict the build to just the module you are changing by running the same command in the corresponding directory. Check the repository's or module's README for additional module-specific instructions. -In order to merge your contribution you have to sign our [Contributor License Agreement](https://cla-assistant.io/camunda/) (CLA) (which needs to be done only once). The CLA contains the terms and conditions under which the contribution has been submitted. Keep in mind without signed CLA the contribution will not be merged. +Integration tests (e.g. tests that run in an actual application server) are usually not part of the default Maven profiles. If you think they are relevant to your contribution, please ask us in the ticket, on the forum or in your pull request for how to run them. Smaller contributions usually do not need this. -## Commit Message Conventions +# Create a Pull Request -> This page defines a convention for commit messages for [camundaBPM](http://camunda.org) related projects. -> -> All commits pushed to the [camunda BPM](https://github.com/camunda) repositories must conform to that convention. +In order to show us your code, you can create a pull request on Github. Do this when your contribution is ready for review, or if you have started with your implementation and want some feedback before you continue. It is always easier to help if we can see your work in progress. -The contents of this page are partly based on the [angular commit messages document](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit?pli=1). +A pull request can be submitted as follows: +1. [Fork the Camunda repository](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) you are contributing to +1. Commit and push your changes to a branch in your fork +1. [Submit a Pull Request to the Camunda repository](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork). As the *base* branch (the one that you contribute to), select `master`. This should also be the default in the Github UI. -### Purpose +# Contribution Checklist -The commit message is what is what describes your contribution. -Its purpose must therefore be to document what a commit contributes to a project. +Before submitting your pull request for code review, please go through the following checklist: -Its head line __should__ be as meaningful as possible because it is always -seen along with other commit messages. +1. Is your code formatted according to our code style guidelines? + * Java: Please check our [Java Code Style Guidelines](https://github.com/camunda/camunda-bpm-dev-docs/blob/master/development/Coding-Style-Java.md). You can also import [our template and settings files](https://github.com/camunda/camunda-bpm-platform/tree/master/settings) into your IDE before you start coding. + * Javascript: Your code is automatically formatted whenever you commit. +1. Is your code covered by unit tests? + * Ask us if you are not sure where to write the tests or what kind of tests you should write. + * Java: Please follow our [testing best practices](https://github.com/camunda/camunda-bpm-dev-docs/blob/master/development/Testing-Best-Practices-Java.md). + * Have a look at other tests in the same module for how it works. + * In rare cases, it is not feasible to write an automated test. Please ask us if you think that is the case for your contribution. +1. Do your commits follow our [commit message conventions](#commit-message-conventions)? +1. Does your code use the [correct license headers](#license-headers)? -Its body __should__ provide information to comprehend the commit for people -who care. +# Contributor License Agreement (CLA) -Its footer __may__ contain references to external artifacts -(issues it solves, related commits) as well as breaking change notes. +Before we can merge your contribution you have to sign our [Contributor License Agreement](https://cla-assistant.io/camunda/) (CLA). The CLA contains the terms and conditions under which the contribution is submitted. You need to do this only once for your first pull request. Keep in mind that without a signed CLA we cannot merge your contribution. -This applies to __all kind of projects__. +# Commit Message Conventions +The messages of all commits must conform to the style: -### Format - -#### Short form (only subject line) - - (): - -#### Long form (with body) - - (): - - - - - - - -