Skip to content

Contributing

We're happily taking patches and other contributions. Below is a summary of the processes we follow for any contribution.

Bug reports and enhancement requests

Bug reports and enhancement requests are an important part of making DetectMateService more stable and are curated through GitHub issues. Before reporting an issue, check our backlog of open issues to see if anybody else has already reported it. If that is the case, you might be able to give additional information on that issue. Bug reports are very helpful to us in improving the software, and therefore, they are very welcome. It is very important to give us at least the following information in a bug report:

  1. Description of the bug. Describe the problem clearly.
  2. Steps to reproduce. With the following configuration, go to.., click.., see error
  3. Expected behavior. What should happen?
  4. Environment. What was the environment for the test (DetectMateService version, Python version, OS, deployment method, etc.)?

Please don't include any private/sensitive information in your issue! For reporting security-related issues, see SECURITY.md

Working on the codebase

To contribute to this project, you must fork the project and create a pull request to the upstream repository, following the next steps:

1. Fork

Go to https://github.com/ait-detectmate/DetectMateService.git and click on fork. Please note that you must login first to GitHub.

2. Clone

After forking the repository into your own workspace, clone the development branch of that repository.

Clone repository
git clone -b development git@github.com:YOURUSERNAME/DetectMateService.git

3. Create a feature branch

Every work package should be developed in its own feature branch. Use a name that describes the feature:

Create your own branch
cd DetectMateService
git checkout -b feature-some_important_work

4. Develop your feature and improvements in the feature-branch

Please make sure that you commit only improvements that are related to the work package you created the feature branch for. See the section Development for detailed information about how to develop code for DetectMateService.

DetectMateService uses prek to ensure code quality. Make sure that you use it properly

5. Fetch and merge from the upstream

If your work on this feature-branch is done, make sure that you are in sync with the branch of the upstream:

Fetch and merge
git remote add upstream git@github.com:ait-detectmate/DetectMateService.git
git pull upstream development

If any conflicts occur, fix them and add them using git add and continue with the merge or fast-forward.

Additional infos:

6. Push the changes to your GitHub-repository

Before we can push our changes, we have to make sure that we don't have unnecessary commits. First checkout our commits:

Check logs
git log

After that we can squash the last n commits together:

Rebase
git rebase -i HEAD~n

Finally you can push the changes to YOUR github-repository:

Push
git push

Additional documentation:

7. Submit your pull-request

Use the GitHub-Webinterface to create a pull-request. Make sure that the target-repository is ait-detectmate/DetectMateService.

If your pull-request was accepted and merged into the development branch continue with "8. Update your local development branch". If it wasn't accepted, read the comments and fix the problems. Before pushing the changes make sure that you squashed them with your last commit:

Rebase from head
git rebase -i HEAD~2

Delete your local feature-branch after the pull-request was merged into the development branch.

8. Update your local development branch

Update your local development branch:

Update your local branch
git fetch upstream development
git checkout development
git rebase upstream/development

Additional infos:

9. Update your development branch in your GitHub repository

Please make sure that you updated your local development branch as described in section 8. above. After that push the changes to your github-repository to keep it up2date:

Push again
git push