|
| 1 | +# Contributing to Infobip Community |
| 2 | + |
| 3 | +✨✨ First off, thanks for taking the time to contribute! ✨✨ |
| 4 | + |
| 5 | +This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md). By participating, |
| 6 | +you are expected to uphold this code. Please report unacceptable behavior to [email protected]. |
| 7 | + |
| 8 | +The following is a set of guidelines for contributing to Infobip's SDKs or any other projects |
| 9 | +hosted in the [Infobip Organization](https://github.com/infobip-community) on GitHub. |
| 10 | +These are mostly guidelines, not rules. Use your best judgment, |
| 11 | +and feel free to propose changes to this document in a pull request. |
| 12 | + |
| 13 | +## 🚩 Issues |
| 14 | +How to report a bug? |
| 15 | + |
| 16 | +Bugs are tracked as [GitHub issues](https://docs.github.com/en/issues/tracking-your-work-with-issues/about-issues). After you've determined which repository your bug is related to, |
| 17 | +create an issue on that repository and provide the following information by filling in comment section. |
| 18 | + |
| 19 | +Explain the problem and include additional details to help maintainers reproduce the problem: |
| 20 | +* **Use a clear and descriptive title** for the issue to identify the problem. |
| 21 | +* **Describe the exact steps which reproduce the problem** in as many details as possible. |
| 22 | +* **Provide specific examples to demonstrate the steps**. |
| 23 | +* **Describe the behavior you observed after following the steps** |
| 24 | +* **Explain which behavior you expected to see instead and why.** |
| 25 | +* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens. |
| 26 | + |
| 27 | +## ℹ️ Asking for General Help |
| 28 | + |
| 29 | +The [Infobip website](https://www.infobip.com/docs/api) has a list of resources for getting programming help and more. |
| 30 | +For any question contributors are available at [[email protected]](mailto:[email protected]). |
| 31 | +Please use the issue tracker for bugs only! |
| 32 | + |
| 33 | +## ⬇️ Pull request |
| 34 | + |
| 35 | +### 🍴 Step 1: Fork |
| 36 | +Fork the project on GitHub and clone your fork locally. |
| 37 | +Example for Python SDK repository: |
| 38 | +```bash |
| 39 | +git clone https://github.com/<your username>/infobip-api-go-sdk.git |
| 40 | +cd infobip-api-go-sdk |
| 41 | +git remote add upstream https://github.com/infobip-community/infobip-api-go-sdk.git |
| 42 | +git fetch upstream |
| 43 | +``` |
| 44 | +### 🛠️ Step 2: Build |
| 45 | +Please run all the tests in the repository, all tests should pass. |
| 46 | +You can manually test by calling the included script from the root of the project: |
| 47 | +```bash |
| 48 | +bash scripts/run_tests.sh |
| 49 | +``` |
| 50 | + |
| 51 | +### 🌱 Step 3: Branch |
| 52 | +To keep your development environment organized, create local branches to hold your work. |
| 53 | +These should be branched directly off of the main branch. |
| 54 | + |
| 55 | +```bash |
| 56 | +git checkout -b my-branch -t upstream/main |
| 57 | +``` |
| 58 | + |
| 59 | +### 💻 Step 4: Code |
| 60 | +Please follow code structure and naming structure that is already in the repository. |
| 61 | +Please make sure that all tests and linters pass for all changes. You can check for that in the [GitHub Actions.](https://github.com/infobip-community/infobip-api-rust-sdk/actions) |
| 62 | +We mostly adhere to the [Rust API Guidelines Checklist](https://rust-lang.github.io/api-guidelines/checklist.html) for style and best practices. |
| 63 | +We use `rustfmt` to keep the code well-formatted. |
| 64 | + |
| 65 | +### ✅ Step 5: Commit |
| 66 | +It is recommended to keep your changes grouped logically within individual commits. |
| 67 | +Many contributors find it easier to review changes that are split across multiple commits. |
| 68 | +There is no limit to the number of commits in a pull request. |
| 69 | + |
| 70 | +```bash |
| 71 | +git add my/changed/files |
| 72 | +git commit |
| 73 | +``` |
| 74 | + |
| 75 | +Note that multiple commits get squashed when they are landed. |
| 76 | +A good commit message should describe what changed and why. |
| 77 | +Commit message should: |
| 78 | + |
| 79 | +* Contain a short description of the change (preferably 50 characters or less, and no more than 72 characters) |
| 80 | +* First letter should be capital and rest entirely in lowercase with the exception of proper nouns, acronyms, |
| 81 | + and the words that refer to code, like function/variable names |
| 82 | + |
| 83 | +#### ⚠️ Breaking Changes |
| 84 | + |
| 85 | +When a commit has a breaking change first line of commit text should be BREAKING CHANGE. |
| 86 | +Please take a look at [Cargo's guide on Semantic Versioning](https://doc.rust-lang.org/cargo/reference/semver.html) for more information. |
| 87 | + |
| 88 | +### 📌 Step 6: Rebase |
| 89 | +Once you have committed your changes, it is a good idea to use git rebase (not git merge) to synchronize your work with the main repository. |
| 90 | +```bash |
| 91 | +git fetch upstream |
| 92 | +git rebase upstream/main |
| 93 | +``` |
| 94 | + |
| 95 | +### 🧪 Step 7: Tests |
| 96 | +Bug fixes and features should always come with tests. Look at other tests to see how they should be structured. |
| 97 | +Before submitting your changes in a pull request, always run the full test suite |
| 98 | +```bash |
| 99 | +cargo test |
| 100 | +cargo fmt --check |
| 101 | +cargo clippy |
| 102 | +``` |
| 103 | +Make sure that no check reports issues and that all tests pass. Please do not submit patches that fail either check. |
| 104 | + |
| 105 | +### 🚀 Step 8: Push |
| 106 | +Once your commits are ready to go -- with passing tests and linting -- begin the process of opening a pull request by pushing your working branch to your fork on GitHub. |
| 107 | +```bash |
| 108 | +git push origin my-branch |
| 109 | +``` |
| 110 | + |
| 111 | +### 📬 Step 9: Opening the Pull Request |
| 112 | +From within GitHub, open new pull request. Add repository admins as reviewers. |
| 113 | +Your PR may be delayed in being merged as maintainers seek more information or clarify ambiguities. |
| 114 | + |
| 115 | +### 🤼 Step 10: Discuss and update |
| 116 | +You will probably get feedback or requests for changes to your pull request. |
| 117 | +This is a big part of the submission process so don't be discouraged! |
| 118 | +Some contributors may sign off on the pull request right away. |
| 119 | +Others may have detailed comments or feedback. |
| 120 | +This is a necessary part of the process in order to evaluate whether the changes are correct and necessary. |
| 121 | + |
| 122 | +To make changes to an existing pull request, make the changes to your local branch, |
| 123 | +add a new commit with those changes, and push those to your fork. GitHub will automatically update the pull request. |
| 124 | + |
| 125 | +```bash |
| 126 | +git add my/changed/files |
| 127 | +git commit |
| 128 | +git push origin my-branch |
| 129 | +``` |
| 130 | + |
| 131 | +Feel free to post a comment in the pull request to ping reviewers if you are awaiting an answer on something. |
| 132 | + |
| 133 | +### 🌍 Step 11: Landing |
| 134 | + |
| 135 | +In order to land, a pull request needs to be reviewed and approved by at least one repository Owner and pass CI. |
| 136 | +After that, if there are no objections from other contributors, the pull request can be merged. |
| 137 | + |
| 138 | +🎉🎊 Congratulations and thanks for your contribution! 🎊🎉 |
| 139 | + |
| 140 | +Every pull request is tested on the Continuous Integration (CI) system to confirm that it works. |
| 141 | +Ideally, the pull request will pass ("be green") on all of CI's tests. |
| 142 | +This means that all tests pass and there are no linting errors. |
| 143 | +However, it is not uncommon for the CI infrastructure itself to fail on specific platforms or for so-called "flaky" tests to fail ("be red"). |
| 144 | +Each CI failure must be manually inspected to determine the cause. |
| 145 | + |
| 146 | +## 📜 Code of Conduct |
| 147 | + |
| 148 | +This project and everyone participating in it is governed by the [Code of Conduct](CODE_OF_CONDUCT.md). |
| 149 | +By participating, you are expected to uphold this code. |
| 150 | +Please report unacceptable behavior to [[email protected]](mailto:[email protected]). |
| 151 | + |
| 152 | +## 📚 Further Reading |
| 153 | + |
| 154 | +For more in-depth guides on developing SDKs, see |
| 155 | +[Readme](README.md) and [Infobip's website](https://www.infobip.com/docs/api). |
0 commit comments