Skip to content

Commit

Permalink
πŸ“ : add contribution guidelines
Browse files Browse the repository at this point in the history
add CONTRIBUTING.md & pull request template

resolves #118
  • Loading branch information
juwit committed Jun 25, 2021
1 parent b106a97 commit e9c31bc
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 24 deletions.
36 changes: 36 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Description

(Add a description of your pull request & feature here.
pull requests without an adequate description will not be reviewed until one is added.)

## Checklist for the pull request author

- [ ] Tests added for this feature
- [ ] Commit messages follow conventions (see [CONTRIBUTING.md](CONTRIBUTING.md))
- [ ] Commits are combined ( 1 commit / type and scope )
- [ ] Documentation created / updated (if necessary)
- [ ] No new sonarqube issues added
- [ ] CI pipeline is OK
- [ ] Pull request is fast-forward to the `main` branch
- [ ] The last commit of this merge request :
- [ ] updates the `pom.xml` to a new minor or major version
- [ ] updates the `CHANGELOG.md`

## Checklist for the project maintainer

- [ ] Review the code, and add a *Review Approval* if everything is ok
- [ ] This pull request will be merged in merge-commit mode
- (in github or with the CLI, see [CONTRIBUTING.md](CONTRIBUTING.md))

### After the merge

- [ ] Put the tag on the merged commit
- (in github or with the CLI, see [CONTRIBUTING.md](CONTRIBUTING.md))
- [ ] Follow the pipeline for the tag, which should build & release the package (maven or docker)

## Issues / Links

* Documentation PR : (eg: gaia-app/docs#1)

(Please add issues resolution information when needed)

103 changes: 79 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,98 @@
# CONTRIBUTING
# CONTRIBUTING.md

## Releasing a new version
This document describes the contribution guidelines for this project.

### Creating a release branch
## Commit convention

New versions are released using Git Flow release branches.
This projects follows the *gitmoji* commit message convention (see [https://gitmoji.dev/](https://gitmoji.dev/))

When releasing a new version, create a branch using the version number to be released.
Commits message are build this way:

```bash
git checkout -b release/1.3.0
```
<emoji> : <message>
### Bump the version number
<details>
Change the version number in the `pom.xml` file.

### Generating the CHANGELOG.md

We use `gitmoji-changelog` to generate the `CHANGELOG.md` file.
resolves #<issue-number>
```

The `CHANGELOG.md` should be generated just after bumping the version number in the `pom.xml` file.
The `<emoji>` can be an emoji code (such as <em>:sparkles:</em>) or a unicode character (such as ✨).

```bash
# install gitmoji-changelog
npm install -g gitmoji-changelog
## How to add a feature

# generate the changelog
gitmoji-changelog --preset maven
* create a branch for the feature (eg: `feature/my-nice-feature`)
```shell
git checkout -b feature/my-nice-feature
```
* code your feature, and create commits for each subject/scope
* update the `pom.xml` to the next minor or major version (eg: 1.0.1 -> 1.1.0)
* commit the change to the `pom.xml` eg:
```shell
git add pom.xml && git commit -m "πŸ”– : bump version to 1.1.0"
```
* generate the CHANGELOG.md for the new version
```shell
npx gitmoji-changelog --preset maven --group-similar-commits true
```
* commit the CHANGELOG.md in the previous commit
```shell
git add CHANGELOG.md && git commit --amend --no-edit
```
* when done, push your branch, and open a merge request, with the pull request template.
```shell
git push --set-upstream origin feature/my-nice-feature
```

### Commit & PR
### Merging the feature

Commit those changes, and open a pull-request for the release-branch.
* merge the feature branch in merge-commit mode
```shell
git checkout main
git merge --no-ff feature/my-nice-feature
```
* create a tag for the feature, on the main branch, on the merge-commit that you just created
```shell
git tag v1.1.0
git push --tags
```
* enjoy & follow the automated build of the tag

The commit message should be like `:bookmark: : release 1.3.0`.
## How to add a fix

### Github Release and Tag
* create a branch for the fix (eg: `hotfix/my-nice-fix`)
```shell
git checkout -b hotfix/my-nice-fix
```
* code your fix, and create commits for each subject
* update the `pom.xml` to the next fix version (eg: 1.0.1 -> 1.0.2)
* commit the change to the `pom.xml` eg:
```shell
git add pom.xml && git commit -m "πŸ”– : bump version to 1.0.2"
```
* generate the CHANGELOG.md for the new version
```shell
npx gitmoji-changelog --preset maven --group-similar-commits true
```
* commit the CHANGELOG.md in the previous commit
```shell
git add CHANGELOG.md && git commit --amend --no-edit
```
* when done, push your branch, and open a merge request, with the pull request template.
```shell
git push --set-upstream origin hotfix/my-nice-fix
```

When the PR is merged, create a Github Release, which points on the previous commit, and add the content of the `CHANGELOG.md` to the release.
### Merging the fix

* merge the fix branch in merge-commit mode
```shell
git checkout main
git merge --no-ff hotfix/my-nice-fix
```
* create a tag for the fix, on the main branch, on the merge-commit that you just created
```shell
git tag v1.0.2
git push --tags
```
* enjoy & follow the automated build of the tag

0 comments on commit e9c31bc

Please sign in to comment.