# Contribution guidelines

## Basic workflow
* Clone this repository to your local machine
* Create a branch using the branch name convention
* Do your work 🚀
* Create commits using the commit message convention
* Get your PR merged 🎉

## Branch name convention

This repository has Github Actions checks in place for the branch name you're using. The branch name has to match the following pattern:

```
<subject>/<ticket-number>/<meaningful-change>
```

The subject can have the following keywords:

* `feature`
    * Branch which is used to implement a single feature. The target branch is either `develop` or an epic branch.
* `hotfix`
    * Usually created when a bug occurs on the production system and a hot fix is needed. The target branch is usually `main`.
* `bugfix`
    * After developing a feature or epic you may occur an issue which needs an additional fix. The target branch is usually `develop`.
* `epic`
    * Feature branch which is used for multiple tickets. The target branch is usually `develop`.
* `release`
    * Release preparation branch to bump up the `composer.json` & `package.json` meta files as well as updating the `CHANGELOG.md`.

The ticket number has to match the following pattern:

```
<project-prefix>-<ticket-number>
```

Additionally we're allowing branches without a dedicated JIRA ticket number. Please use the `ntr` (no ticket required) for these kind of branches.

Here are a couple example of valid branch names:


* `feature/ksl-42/store-locator-detail-modal`
* `hotfix/ntr/cookie-permissions-workaround`
* `bugfix/kst-12/color-variable-not-assigned`
* `epic/ke-3/document-management`
* `release/ntr/release-prep-1.2.0`

## Commit message convention

Commit messages have to follow a certain pattern as well. We're preferring commit messages in present-tense as well as very commit message should contain the JIRA ticket number and a message body. Please match the following pattern with your commit messages.

```
<jira-ticket-number> - <message-body>
```

The following verbs may be used as the first word of your commit message:

* Adds
* Removes
* Refactors
* Updates
* Enables
* Disables
* Prepares
* Bumps
* ...

Additionally we're allowing commit messages without a dedicated JIRA ticket number. This is usually the case for dependency chores or release preparation. Instead of the JIRA ticket number please use the `NTR` (no ticket required) for these kind of branches.

Here are a couple example of valid commit messages:

* `NTR - Updates changelog`
* `KST-42 - Refactors review media`
* `KSL-2 - Adds new route for store locator`
* `KE-423 - Removes Railway font stack`
* `KFOOD-3 - Refactors option parsing for plugin`
* `NTR - Bumps up version in composer.json & package.json`