2020-03-24 17:51:06 -04:00
# MinIO Contribution Guide [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io) [![Docker Pulls](https://img.shields.io/docker/pulls/minio/minio.svg?maxAge=604800)](https://hub.docker.com/r/minio/minio/)
2015-05-27 21:41:14 -04:00
2019-04-09 14:39:42 -04:00
``MinIO`` community welcomes your contribution. To make the process as seamless as possible, we recommend you read this contribution guide.
2017-09-18 14:02:45 -04:00
## Development Workflow
2019-04-09 14:39:42 -04:00
Start by forking the MinIO GitHub repository, make changes in a branch and then send a pull request. We encourage pull requests to discuss code changes. Here are the steps in details:
2015-05-27 21:41:14 -04:00
2019-04-09 14:39:42 -04:00
### Setup your MinIO GitHub Repository
2022-02-11 19:51:25 -05:00
2019-04-09 14:39:42 -04:00
Fork [MinIO upstream ](https://github.com/minio/minio/fork ) source repository to your own personal repository. Copy the URL of your MinIO fork (you will need it for the `git clone` command below).
2017-09-18 14:02:45 -04:00
2014-12-29 19:35:56 -05:00
```sh
2022-02-11 19:51:25 -05:00
git clone https://github.com/minio/minio
go install -v
ls /go/bin/minio
2014-12-29 19:35:56 -05:00
```
2017-09-18 14:02:45 -04:00
### Set up git remote as ``upstream``
2022-02-11 19:51:25 -05:00
2015-02-18 17:35:49 -05:00
```sh
2019-04-04 16:36:31 -04:00
$ cd minio
2015-05-11 19:23:10 -04:00
$ git remote add upstream https://github.com/minio/minio
2015-02-18 17:35:49 -05:00
$ git fetch upstream
$ git merge upstream/master
...
```
2017-09-18 14:02:45 -04:00
### Create your feature branch
2022-02-11 19:51:25 -05:00
2017-09-18 14:02:45 -04:00
Before making code changes, make sure you create a separate branch for these changes
```
2022-02-11 19:51:25 -05:00
git checkout -b my-new-feature
2017-09-18 14:02:45 -04:00
```
2019-04-09 14:39:42 -04:00
### Test MinIO server changes
2022-02-11 19:51:25 -05:00
2017-09-18 14:02:45 -04:00
After your code changes, make sure
2019-04-09 14:39:42 -04:00
- To add test cases for the new code. If you have questions about how to do it, please ask on our [Slack ](https://slack.min.io ) channel.
2017-09-18 14:02:45 -04:00
- To run `make verifiers`
- To squash your commits into a single commit. `git rebase -i` . It's okay to force update your pull request.
2019-07-19 09:40:39 -04:00
- To run `make test` and `make build` completes.
2017-09-18 14:02:45 -04:00
### Commit changes
2022-02-11 19:51:25 -05:00
2017-09-18 14:02:45 -04:00
After verification, commit your changes. This is a [great post ](https://chris.beams.io/posts/git-commit/ ) on how to write useful commit messages
```
2022-02-11 19:51:25 -05:00
git commit -am 'Add some feature'
2017-09-18 14:02:45 -04:00
```
### Push to the branch
2022-02-11 19:51:25 -05:00
2017-09-18 14:02:45 -04:00
Push your locally committed changes to the remote origin (your fork)
2022-02-11 19:51:25 -05:00
2017-09-18 14:02:45 -04:00
```
2022-02-11 19:51:25 -05:00
git push origin my-new-feature
2017-09-18 14:02:45 -04:00
```
### Create a Pull Request
2022-02-11 19:51:25 -05:00
2017-09-18 14:02:45 -04:00
Pull requests can be created via GitHub. Refer to [this document ](https://help.github.com/articles/creating-a-pull-request/ ) for detailed steps on how to create a pull request. After a Pull Request gets peer reviewed and approved, it will be merged.
## FAQs
2022-02-11 19:51:25 -05:00
2021-08-17 12:20:10 -04:00
### How does ``MinIO`` manage dependencies?
2022-02-11 19:51:25 -05:00
2019-04-09 14:39:42 -04:00
``MinIO`` uses `go mod` to manage its dependencies.
2022-02-11 19:51:25 -05:00
2019-04-02 21:28:39 -04:00
- Run `go get foo/bar` in the source folder to add the dependency to `go.mod` file.
2017-09-18 14:02:45 -04:00
To remove a dependency
2022-02-11 19:51:25 -05:00
2019-04-02 21:28:39 -04:00
- Edit your code and remove the import reference.
- Run `go mod tidy` in the source folder to remove dependency from `go.mod` file.
2017-09-18 14:02:45 -04:00
2019-04-09 14:39:42 -04:00
### What are the coding guidelines for MinIO?
2022-02-11 19:51:25 -05:00
2019-04-09 14:39:42 -04:00
``MinIO`` is fully conformant with Golang style. Refer: [Effective Go ](https://github.com/golang/go/wiki/CodeReviewComments ) article from Golang project. If you observe offending code, please feel free to send a pull request or ping us on [Slack ](https://slack.min.io ).