Before starting make sure you have a GitHub account.
To send your contributions follow these steps:
-
Write an issue for your idea if it doesn't exist here.
-
Clone your fork:
git clone https://github.com/{your-username}/reprebot.git
Owners can clone the repository directly instead of fork it.
-
Set up the development environment:
- Install Python.
- Install Git.
- Install pip.
- Install virtualenv.
- Create a virtual
environment inside your cloned repository:
python3 -m venv env
. - Activate the virtual
environment. On Windows, run
env\Scripts\activate
, and on Linux runsource env/bin/activate
. - Install the dependencies:
pip install -r requirements.txt
. - Run the unit tests:
pytest test/unit/src
-
Create a branch with the following naming convention:
reprebot-<your-github-username>
For example if your GitHub username is
happy-cat
, name your branchreprebot-happy-cat
.Create and switch to your branch:
git checkout -b <your-branch-name>
-
Code your idea. Make sure you run the unit tests each time and that they pass.
-
Commit your changes locally.
Use the following convention for your commit messages:
reprebot/[type]: #[issue-number] [title] [body]
For the type of your commit use any of the following depending on what've you implemented:
feat
: if it's a new feature or enhancement in performancefix
: if it's a fix to a bugrefac
: if it's a refactoring of some kindstyle
: if it's related to code style onlytest
: if it's adding or improving tests
Here's an example of a commit message:
reprebot/feat: #19 define the llm client class - define the `LLMClient` class - use `LLMClient` class in `app` module
-
Rebase onto the
main
branch.Do this only if there are changes in the
main
branch.# Switch to the 'main' branch git checkout main # Pull latest changes from the 'main' branch git pull # Switch to your branch branch git checkout <your-branch-name> # Rebase your branch branch onto 'main' git rebase main
Fix any conflict that might arise during the rebase.
-
Push your changes to your branch.
git push --set-upstream origin <your-branch-name>
-
Wait for the pipelines to succeed.
-
Create a pull request from your fork to reprebot.
If you're an owner, create the PR from your branch instead.
Note
Make sure your PR are only 1 commit ahead of reprebot main
branch.
Sometimes you make a commit and realize something needs to change. In that case
use git commit --amend
when you're finished with your changes. If you already
pushed the commit to your branch, you don't need to use
git push --set-upstream origin <your-branch-name>
but just git push -f
. You
can do this as many times as you need to make sure the build pipeline succeeds
before creating your PR.