Skip to content

Commit

Permalink
Merge pull request #78 from TFA-MAIF/feature/contributing
Browse files Browse the repository at this point in the history
Feature/contributing
  • Loading branch information
TFA-MAIF committed Feb 18, 2021
2 parents 960f121 + d91a593 commit d4521a4
Show file tree
Hide file tree
Showing 13 changed files with 257 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'type:bug'
assignees: ''
---

Hey there and thank you for using Issue Tracker!

Do the checklist before filing an issue:

- Is this something you can debug and fix? Send a pull request ! Bug fixes and documentation fixes are welcome.
- Have a usage question ? Ask your question on StackOverflow. We use StackOverflow for usage question and GitHub for bugs.

None of the above, create a bug report

Make sure to add all the information needed to understand the bug so that someone can help. If the info is missing we'll add the 'Needs more information' label and close the issue until there is enough information.

- Provide a minimal code snippet example that reproduces the bug.
- Provide screenshots where appropriate
- What's the version of Python you're using ?
- Are you using Mac, Linux or Windows?

**Python version** :

**Melusine version** :

**Operating System** :
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Documentation
about: Add or improve documentation of Melusine
title: ''
labels: 'type:documentation'
assignees: ''
---
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest an idea on how to improve Melusine
title: ''
labels: 'type:enhancement'
assignees: ''

---

**Description of Problem**:

**Overview of the Solution**:

**Examples**:

**Blockers**:

**Definition of Done**:
48 changes: 48 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# IMPORTANT: Please do not create a Pull Request without creating an issue first.

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.

Please provide enough information so that others can review your pull request:

Explain the details for making this change. What existing problem does the pull request solve ?

Test plan (required)

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [ ] Test A
- [ ] Test B

**Test Configuration**:
* OS:
* Python version:
* Melusine version:

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist: focal
language: python
python:
- 3.6
Expand Down
152 changes: 152 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# How to contribute to Melusine Open source

This guide aims to help you contributing to Melusine. If you have found any problems, improvements that can be done, or you have a burning desire to develop new features for Melusine, please make sure to follow the steps bellow.

- [How to open an issue](#how-to-open-an-issue)
- [Create your contribution to submit a pull request](#create-your-contribution-to-submit-a-pull-request)
- [Fork to code in your personal Melusine repo](#fork-to-code-in-your-personal-melusine-repo)
- [Clone your forked repository](#clone-your-forked-repository)
- [Make sure that your repository is up to date](#make-sure-that-your-repository-is-up-to-date)
- [Start your contribution code](#start-your-contribution-code)
- [Commit your changes](#commit-your-changes)
- [Create a pull request](#create-a-pull-request)
- [Finally submit your pull request](#finally-submit-your-pull-request)

# How to open an issue

**Screenshots are coming soon**

An issue will open a discussion to evaluate if the problem / feature that you submit is eligible, and legitimate for Melusine.

Check on the project tab if your issue / feature is not already created. In this tab, you will find the roadmap of Melusine.

A Pull Request must be linked to an issue.
Before you open an issue, please check the current opened issues to insure there are no duplicate. Define if it's a feature or a bugfix.

Next, the Melusine team, or the community, will give you a feedback on whether your issue must be implemented in Melusine, or if it can be resolved easily without a pull request.

# Create your contribution to submit a pull request
## Fork to code in your personal Melusine repo

The first step is to get our MAIF repository on your personal GitHub repositories. To do so, use the "Fork" button.

<img src="https://raw.githubusercontent.com/MAIF/melusine/master/docs/assets/images/contributing/fork_melusine.PNG" alt="fork this repository" />

## Clone your forked repository

<img align="right" width="300" src="https://raw.githubusercontent.com/MAIF/melusine/master/docs/assets/images/contributing/clone_melusine.PNG" alt="clone your forked repository" />

Click on the "Code" button to copy the url of your repository, and next, you can paste this url to clone your forked repository.

```
git clone https://github.com/YOUR_GITHUB_PROFILE/melusine.git
```

## Make sure that your repository is up to date

To insure that your local forked repository is synced, you have to update your repo with the master branch of Melusine (MAIF). So, go to your repository and as follow :

```
cd melusine
git remote add upstream https://github.com/MAIF/melusine.git
git pull upstream master
```

## Install Melusine into a virtualenv

Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

```
mkvirtualenv melusine
cd melusine
python setup.py develop
```

## Start your contribution code

To contribute to Melusine, you will need to create a personal branch.
```
git checkout -b feature/my-contribution-branch
```
We recommand to use a convention of naming branch.
- **feature/your_feature_name** if you are creating a feature
- **hotfix/your_bug_fix** if you are fixing a bug

## Commit your changes

Before committing your modifications, we have some recommendations :

- Execute pytest to check that all tests pass
```
pytest
```
- Try to build Melusine
```
python setup.py bdist_wheel
```
- Check your code with **flake8**

*We will soon add **pre commit** to automatically check your code quality during commit*

```
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
```

Also for now, try testing tox. It will not be used for much longer as we will be moving to Github Actions and a simpler process soon.

```
tox
```

To get flake8 and tox, just pip install them into your virtualenv.

In addition, we recommend committing with clear messages and grouping your commits by modifications dependencies.

Once all of these steps succeed, push your local modifications to your remote repository.

```
git add .
git commit -m ‘detailed description of your change’
git push origin feature/my-contribution-branch
```

Your branch is now available on your remote forked repository, with your changes.

Next step is now to create a Pull Request so the Melusine Team can add your changes to the official repository.

## Create a Pull Request


A pull request allows you to ask the Melusine team to review your changes, and merge your changes into the master branch of the official repository.

To create one, on the top of your forked repository, you will find a button "Compare & pull request"

<img src="https://raw.githubusercontent.com/MAIF/melusine/master/docs/assets/images/contributing/melusine-compare-pr.png" alt="pull request" />

As you can see, you can select on the right side which branch of your forked repository you want to associate to the pull request.

On the left side, you will find the official Melusine repository.

- Base repository: MAIF/melusine
- Base branch: master
- Head repository: your-github-username/melusine
- Head branch: your-contribution-branch

<img src="https://raw.githubusercontent.com/MAIF/melusine/master/docs/assets/images/contributing/melusine-pr-branch.png" alt="clone your forked repository" />

Once you have selected the right branch, let's create the pull request with the green button "Create pull request".

<img src="https://raw.githubusercontent.com/MAIF/melusine/master/docs/assets/images/contributing/melusine-pr-description.png" alt="clone your forked repository" />

In the description, a template is initialized with all informations you have to give about what you are doing on what your PR is doing.

Please follow this to write your PR content.


## Finally submit your pull request

Your pull request is now ready to be submitted. A member of the Melusine team will contact you and will review your code and contact you if needed.

You have contributed to an Open source project, thank you and congratulations ! 🥳

Show your contribution to Melusine in your curriculum, and share it on your social media. Be proud of yourself, you gave some code lines to the entire world !
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/contributing/fork_melusine.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ commands = flake8 melusine
[testenv]
setenv =
PYTHONPATH = {toxinidir}
CRYPTOGRAPHY_DONT_BUILD_RUST=1

deps =
-r{toxinidir}/requirements_dev.txt
Expand Down

0 comments on commit d4521a4

Please sign in to comment.