- Github account ( Naturally :p )
- A little understanding of glusterfs is appreciated as it would come handy while dealing with the TCs and library ops.
One time effort -
- Fork the repository.
- Clone it in your local system.
- Add an upstream remote to fetch latest changes.
git remote add upstream [email protected]:gluster/redant.git
- Fetch the latest changes.
git fetch upstream
. - Rebase it to the local clone.
git rebase upstream/main
Now, step 1-3 once done need not be repeated more than once as once they're done, you can just execute the fetch and rebase command to update your local with
remote upstream. [ Don't forget to update your forked upstream with these latest changes in the main
]
The following steps are to be done every time a new PR is being acted upon.
- Open an issue ( Bug or feature request ) detailing what is expected. Say the issue number is
XYZ
. - Run steps 4-5 mentioned in the One time effort.
- Checkout to a new branch for making changes.
git checkout -b issueXYZ origin/main
- Do the changes.
- Run the command
autopep8 -i <PATH_TO_THE_FILE>/<filename>.py
NOTE
Run pylint and flake8 to check and remove the errors.
To execute the same:
You can run the following command
tools/linting.sh
To know more about the script, go here.
flake8 <PATH_TO_THE_FILE>/<filename>.py
pylint -j 4 --rcfile=.pylintrc <PATH_TO_THE_FILE>/<filename>.py
- Add the changed files before commit.
git add <path-to-file(s)>
- Sign your commits with
git commit -s
. This will open an editor. Add the header/subject ( A one liner which will be the header for the PR ) followed by what was changed and why. Also add the lineUpdates: #XYZ
orFixes: #XYZ
depending on whether this PR will fix an issue raised or just update a long running issue. - Push the changes by running.
git push origin HEAD
Now, once the PR is opened, tag the reviewers and if the PR requires new changes follow the below steps,
- Fetch and rebase the local main.
- Checkout to the issue branch and rebase it to main.
git rebase origin/main
- Do the requested changes based on review comments.
- This time create a new commit by signing the additions.
git commit -s
. and if it is a small change, just rungit commit -s -m '<commit-msg>
. - Like the previous steps as followed for the first commit in a PR, add a basic description as to what is changed in this commit and add
Updates: #XYZ
- Push the change.
git push origin HEAD
.
Some prosaic rules,
- Atleast one vote is required to merge the PR.
- If there would be multiple changes to a PR, open it as a draft and activate it only when it is ready.
- Do address the review comments.
- Try as much as possible to not use the force push.
- Conscious languages to be followed. Let's be polite :)
- Contribution can also be done in terms of reviews, just keep point 5 in mind and also that it is the patch and not the person :p
- Have fun while coding...