|
| 1 | +<div class="toc"> |
| 2 | +<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
| 3 | +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
| 4 | + |
| 5 | +- [How to open a GitHub issue & file a bug report](#how-to-open-a-github-issue--file-a-bug-report) |
| 6 | + - [Working on a new feature or filing a bug report](#working-on-a-new-feature-or-filing-a-bug-report) |
| 7 | + - [Working on an existing feature](#working-on-an-existing-feature) |
| 8 | +- [How to open a GitHub Pull Request](#how-to-open-a-github-pull-request) |
| 9 | + - [What is a Pull Request (PR)?](#what-is-a-pull-request-pr) |
| 10 | + - [What to know before opening a PR](#what-to-know-before-opening-a-pr) |
| 11 | + - [Opening issues before PRs](#opening-issues-before-prs) |
| 12 | + - [Draft PRs](#draft-prs) |
| 13 | + - [PRs should be a reasonable length](#prs-should-be-a-reasonable-length) |
| 14 | + - [Code style](#code-style) |
| 15 | + - [Formatting and Type Checking](#### Formatting and Type Checking) |
| 16 | +- [How to open a PR and contribute code to Rasa Open Source](#how-to-open-a-pr-and-contribute-code-to-rasa-open-source) |
| 17 | + - [1. Forking the Rasa Repository](#1-forking-the-rasa-repository) |
| 18 | + - [2. Cloning the Forked Repository Locally](#2-cloning-the-forked-repository-locally) |
| 19 | + - [3. Update your Forked Repository](#3-update-your-forked-repository) |
| 20 | + - [4. Implement your code contribution](#4-implement-your-code-contribution) |
| 21 | + - [5. Push changes to your forked repository on GitHub](#5-push-changes-to-your-forked-repository-on-github) |
| 22 | + - [6. Opening the Pull Request on Rasa Open Source](#6-opening-the-pull-request-on-rasa-open-source) |
| 23 | + - [7. Signing the Contributor Licence Agreement (CLA)](#7-signing-the-contributor-licence-agreement-cla) |
| 24 | + - [8. Merging your PR and the final steps of your contribution](#8-merging-your-pr-and-the-final-steps-of-your-contribution) |
| 25 | + - [9. Share your contributions with the world!](#9-share-your-contributions-with-the-world) |
| 26 | + - [10. Non-code contributions](#10-non-code-contributions) |
| 27 | + |
| 28 | +<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 29 | +</div> |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## How to open a GitHub issue & file a bug report |
| 34 | + |
| 35 | +### Working on a new feature or fixing a bug |
| 36 | + |
| 37 | +If you would like to add a new feature or fix an existing bug, we prefer that you open a new issue on the Rasa repository before creating a pull request. |
| 38 | + |
| 39 | +It’s important to note that when opening an issue, you should first do a quick search of existing issues to make sure your suggestion hasn’t already been added as an issue. |
| 40 | +If your issue doesn’t already exist, and you’re ready to create a new one, make sure to state what you would like to implement, improve or bugfix. We have provided templates to make this process easier for you. |
| 41 | + |
| 42 | +**To open a Github issue, go to the RasaHQ repository, select “Issues”, “New Issue” then “Feature Request” or “Bug Report” and fill out the template.** |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +The Rasa team will then get in touch with you to discuss if the proposed feature aligns with the company's roadmap, and we will guide you along the way in shaping the proposed feature so that it could be merged to the Rasa codebase. |
| 47 | + |
| 48 | +### Working on an existing feature |
| 49 | + |
| 50 | +If you want to contribute code, but don't know what to work on, check out the Rasa contributors board to find existing open issues. |
| 51 | + |
| 52 | +The issues are handpicked by the Rasa team to have labels which correspond to the difficulty/estimated time needed to resolve the issue. |
| 53 | + |
| 54 | +**To work on an existing issue, go to the contributor project board, add a comment stating you would like to work on it and include any solutions you may already have in mind.** |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +Someone from Rasa will then assign that issue to you and help you along the way. |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## How to open a GitHub Pull Request |
| 63 | + |
| 64 | +### What is a Pull Request (PR)? |
| 65 | + |
| 66 | +This is how the GitHub team defines a PR: |
| 67 | + |
| 68 | +> “Pull requests let you tell others about changes you’ve pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.” |
| 69 | +
|
| 70 | +This process is used by both Rasa team members and Rasa contributors to make changes and improvements to Rasa Open Source. |
| 71 | + |
| 72 | +### What to know before opening a PR |
| 73 | + |
| 74 | +#### Opening issues before PRs |
| 75 | + |
| 76 | +We usually recommend opening an issue before a pull request if there isn’t already an issue for the problem you’d like to solve. This helps facilitate a discussion before deciding on an implementation. See How to open a GitHub issue & file a bug report. |
| 77 | + |
| 78 | +#### Draft PRs |
| 79 | + |
| 80 | +If you're ready to get some quick initial feedback from the Rasa team, you can create a draft pull request. |
| 81 | + |
| 82 | +#### PRs should be a reasonable length |
| 83 | + |
| 84 | +If your PR is greater than 500 lines, please consider splitting it into multiple smaller contributions. |
| 85 | + |
| 86 | +#### Code style |
| 87 | + |
| 88 | +To ensure a standardized code style we recommend using formatter black. To ensure our type annotations are correct we also suggest using the type checker pytype. |
| 89 | + |
| 90 | +#### Formatting and Type Checking |
| 91 | + |
| 92 | +If you want to automatically format your code on every commit, you can use pre-commit. Just install it via `pip install pre-commit` and execute `pre-commit install` in the root folder. This will add a hook to the repository, which reformats files on every commit. |
| 93 | + |
| 94 | +If you want to set it up manually, install black via `pip install -r requirements-dev.txt.` To reformat files execute `make formatter`. |
| 95 | + |
| 96 | +If you want to check types on the codebase, install pytype using `pip install -r requirements-dev.txt`. To check the types execute `make types`. |
| 97 | + |
| 98 | +The CI/CD tests that we run can be found in the [continous-integration.yml](https://github.com/RasaHQ/rasa/blob/master/.github/workflows/continous-integration.yml) file. |
| 99 | + |
| 100 | +--- |
| 101 | + |
| 102 | +## How to open a PR and contribute code to Rasa Open Source |
| 103 | + |
| 104 | +#### 1. Forking the Rasa Repository |
| 105 | + |
| 106 | +Head to Rasa repository and click ‘Fork’. Forking a repository creates you a copy of the project which you can edit and use to propose changes to the original project. |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +Once you fork it, a copy of the Rasa repository will appear inside your GitHub repository list. |
| 111 | + |
| 112 | +#### 2. Cloning the Forked Repository Locally |
| 113 | + |
| 114 | +To make changes to your copy of the Rasa repository, clone the repository on your local machine. To do that, run the following command in your terminal: |
| 115 | + |
| 116 | +``` |
| 117 | +git clone https://github.com/your_github_username/rasa.git |
| 118 | +``` |
| 119 | + |
| 120 | +The link to the repository can be found after clicking Clone or download button as shown in the image below: |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | +Note: this assumes you have git installed on your local machine. If not, check out the [following guide](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) to learn how to install it. |
| 125 | + |
| 126 | +#### 3. Update your Forked Repository |
| 127 | + |
| 128 | +Before you make any changes to your cloned repository, make sure you have the latest version of the original Rasa repository. To do that, run the following commands in your terminal: |
| 129 | + |
| 130 | +``` |
| 131 | +cd rasa |
| 132 | +git remote add upstream git://github.com/RasaHQ/rasa.git |
| 133 | +git pull upstream master |
| 134 | +``` |
| 135 | + |
| 136 | +This will update the local copy of the Rasa repository to the latest version. |
| 137 | + |
| 138 | +#### 4. Implement your code contribution |
| 139 | + |
| 140 | +At this point, you are good to make changes to the files in the local directory of your project. |
| 141 | + |
| 142 | +Alternatively, you can create a new branch which will contain the implementation of your contribution. To do that, run: |
| 143 | + |
| 144 | +``` |
| 145 | +git checkout -b name-of-your-new-branch |
| 146 | +``` |
| 147 | + |
| 148 | +#### 5. Push changes to your forked repository on GitHub |
| 149 | + |
| 150 | +Once you are happy with the changes you made in the local files, push them to the forked repository on GitHub. To do that, run the following commands: |
| 151 | + |
| 152 | +``` |
| 153 | +git add . |
| 154 | +git commit -m ‘fixed a bug’ |
| 155 | +git push origin name-of-your-new-branch |
| 156 | +``` |
| 157 | + |
| 158 | +This will create a new branch on your forked Rasa repository, and now you’re ready to create a Pull Request with your proposed changes! |
| 159 | + |
| 160 | +#### 6. Opening the Pull Request on Rasa Open Source |
| 161 | + |
| 162 | +Head to the forked repository and click on a _Compare & pull_ request button. |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | +This will open a window where you can choose the repository and branch you would like to propose your changes to, as well as specific details of your contribution. In the top panel menu choose the following details: |
| 167 | + |
| 168 | +- Base repository: RasaHQ/rasa |
| 169 | +- Base branch: master |
| 170 | +- Head repository: your_github_username/rasa |
| 171 | +- Head branch: name-of-your-new-branch |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | +Next, make sure to update the pull request card with as many details about your contribution as possible. _Proposed changes_ section should contain the details of what has been fixed/implemented, and Status should reflect the status of your contributions. Any reasonable change (not like a typo) should include a changelog entry, a bug fix should have a test, a new feature should have documentation, etc. |
| 176 | + |
| 177 | +If you are ready to get feedback on your contribution from the Rasa team, tick the _made PR ready for code review_ and _allow edits from maintainers_ box. |
| 178 | + |
| 179 | +Once you are happy with everything, click the _Create pull request_ button. This will create a Pull Request with your proposed changes. |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | +#### 7. Signing the Contributor Licence Agreement (CLA) |
| 184 | + |
| 185 | +To merge your contributions to the Rasa codebase, you will have to sign a Contributor License Agreement (CLA). |
| 186 | + |
| 187 | +It is necessary for us to know that you agree for your code to be included into the Rasa codebase and allow us to use it in our later releases. You can find a detailed Rasa Contributor Licence Agreement [here](https://cla-assistant.io/RasaHQ/rasa). |
| 188 | + |
| 189 | +#### 8. Merging your PR and the final steps of your contribution |
| 190 | + |
| 191 | +Once you sign the CLA, a member from the Rasa team will get in touch with you with the feedback on your contribution. In some cases, contributions are accepted right away, but often, you may be asked to make some edits/improvements. Don’t worry if you are asked to change something - it’s a completely normal part of software development. |
| 192 | + |
| 193 | +If you have been requested to make changes to your contribution, head back to the local copy of your repository on your machine, implement the changes and push them to your contribution branch by repeating instructions from step 5. Your pull request will automatically be updated with the changes you pushed. Once you've implemented all of the suggested changes, tag the person who first reviewed your contribution by mentioning them in the comments of your PR to ask them to take another look. |
| 194 | +Finally, if your contribution is accepted, the Rasa team member will merge it to the Rasa codebase. |
| 195 | + |
| 196 | +#### 9. Share your contributions with the world! |
| 197 | + |
| 198 | +Contributing to open source can take a lot of time and effort, so you should be proud of the great work you have done! |
| 199 | +Let the world know that you have become a contributor to the Rasa open source project by posting about it on your social media (make sure to tag @RasaHQ as well), mention the contribution on your CV and get ready to get some really cool [Rasa contributor swag](https://blog.rasa.com/announcing-the-rasa-contributor-program/)! |
| 200 | + |
| 201 | +#### 10. Non-code contributions |
| 202 | + |
| 203 | +Contributing doesn’t start and end with code. You can support the project by planning community events, creating tutorials, helping fellow community members find answers to their questions or translating documentation and news. Every contribution matters! You can find more details [on our website](https://rasa.com/community/contribute/). |
0 commit comments