|
| 1 | +# Contributing to Magistrala |
| 2 | + |
| 3 | +The following is a set of guidelines to contribute to Magistrala and its libraries, which are hosted on the [Abstract Machines Organization](https://github.com/absmach) on GitHub. |
| 4 | + |
| 5 | +This project adheres to the [Contributor Covenant 1.2](http://contributor-covenant.org/version/1/2/0). |
| 6 | +By participating, you are expected to uphold this code. Please report unacceptable behavior to |
| 7 | + |
| 8 | + |
| 9 | +## Reporting issues |
| 10 | + |
| 11 | +Reporting issues are a great way to contribute to the project. We are perpetually grateful about a well-written, thorough bug report. |
| 12 | + |
| 13 | +Before raising a new issue, check the issues page to determine if it already contains the problem that you are facing. |
| 14 | + |
| 15 | +A good bug report shouldn't leave others needing to chase you for more information. Please be as detailed as possible. The following questions might serve as a template for writing a detailed |
| 16 | +report: |
| 17 | + |
| 18 | +- What were you trying to achieve? |
| 19 | +- What are the expected results? |
| 20 | +- What are the received results? |
| 21 | +- What are the steps to reproduce the issue? |
| 22 | +- In what environment did you encounter the issue? |
| 23 | + |
| 24 | +## Pull requests |
| 25 | + |
| 26 | +Good pull requests (e.g. patches, improvements, new features) are a fantastic help. They should remain focused in scope and avoid unrelated commits. |
| 27 | + |
| 28 | +**Please ask first** before embarking on any significant pull request (e.g. implementing new features, refactoring code etc.), otherwise you risk spending a lot of time working on something that the maintainers might not want to merge into the project. |
| 29 | + |
| 30 | +Please adhere to the coding conventions used throughout the project. For Golang based repos, if in doubt, consult the [Effective Go](https://golang.org/doc/effective_go.html) style guide. |
| 31 | + |
| 32 | +To contribute to the project, [fork](https://help.github.com/articles/fork-a-repo/) it, clone your fork repository, and configure the remotes: |
| 33 | + |
| 34 | +```bash |
| 35 | +git clone https://github.com/<your-username>/<repo-name>.git |
| 36 | +cd <repo-name> |
| 37 | +git remote add upstream https://github.com/absmach/<repo-name>.git |
| 38 | +``` |
| 39 | + |
| 40 | +If your cloned repository is behind the upstream commits, then get the latest changes from upstream: |
| 41 | + |
| 42 | +```bash |
| 43 | +git checkout main |
| 44 | +git pull --rebase upstream main |
| 45 | +``` |
| 46 | + |
| 47 | +Create a new topic branch from `main` using the naming convention `MG-[issue-number]` for magistrala related issues to help us keep track of your contribution scope. For other repositories, use the naming convention `AB-[issue-number]`: |
| 48 | + |
| 49 | +```bash |
| 50 | +git checkout -b AB-[issue-number] |
| 51 | +``` |
| 52 | + |
| 53 | +Commit your changes in logical chunks. When you are ready to commit, make sure to write a Good Commit Message™. Consult the [Erlang's contributing guide](https://github.com/erlang/otp/wiki/Writing-good-commit-messages) if you're unsure of what constitutes a Good Commit Message™. Use [interactive rebase](https://help.github.com/articles/about-git-rebase) to group your commits into logical units of work before making it public. |
| 54 | + |
| 55 | +Note that every commit you make must be signed. By signing off your work you indicate that you |
| 56 | +are accepting the [Developer Certificate of Origin](https://developercertificate.org/). |
| 57 | + |
| 58 | +Use your real name (sorry, no pseudonyms or anonymous contributions). If you set your `user.name` |
| 59 | +and `user.email` git configs, you can sign your commit automatically with `git commit -s`. |
| 60 | + |
| 61 | +Locally merge (or rebase) the upstream development branch into your topic branch: |
| 62 | + |
| 63 | +```bash |
| 64 | +git pull --rebase upstream main |
| 65 | +``` |
| 66 | + |
| 67 | +Push your topic branch up to your fork: |
| 68 | + |
| 69 | +```bash |
| 70 | +git push origin AB-[issue-number] |
| 71 | +``` |
| 72 | + |
| 73 | +[Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title |
| 74 | +and detailed description. |
0 commit comments