Welcome and thank you for considering contributing to Gorse!
Reading and following these guidelines will help us make the contribution process easy and effective for everyone involved. It also communicates that you agree to respect the time of the developers managing and developing these open source projects. In return, we will reciprocate that respect by addressing your issue, assessing changes, and helping you finalize your pull requests.
These following installations are required:
Go (>= 1.18): Since Go features from 1.18 are used in Gorse, the version of the compiler must be greater than 1.18. GoLand or Visual Studio Code is highly recommended as the IDE to develop Gorse.
Docker Compose: Multiple databases are required for unit tests. It's convenient to manage databases on Docker Compose.
cd storage
docker compose up -d
If you need import sample data, download the SQL file github.sql and import to the MySQL instance.
# Download sample data.
wget https://cdn.gorse.io/example/github.sql
# Import sample data.
mysql -h 127.0.0.1 -u gorse -pgorse_pass gorse < github.sql
go run cmd/gorse-in-one/main.go --config config/config.toml
go run cmd/gorse-master/main.go --config config/config.toml
go run cmd/gorse-worker/main.go
go run cmd/gorse-server/main.go
Most logics in Gorse are covered by unit tests. Run unit tests by the following command:
go test -v ./...
The default database URLs are directed to these databases in storage/docker-compose.yml
. Test databases could be overrode by setting following environment variables:
Environment Value | Default Value |
---|---|
MYSQL_URI |
mysql://root:password@tcp(127.0.0.1:3306)/ |
POSTGRES_URI |
postgres://gorse:gorse_pass@127.0.0.1/ |
MONGO_URI |
mongodb://root:password@127.0.0.1:27017/ |
REDIS_URI |
redis://127.0.0.1:6379/ |
For example, use TiDB as a test database by:
MYSQL_URI=mysql://root:password@tcp(127.0.0.1:4000)/ go test -v ./...
You can start by finding an existing issue with the help wanted label in the Gorse repository. These issues are well suited for new contributors. Issues can be claimed by publishing an /assign
comment.
To contribute to the Gorse code base, please follow the workflow as defined in this section.
This is a rough outline of what a contributor's workflow looks like. Thanks for your contributions!
Join us in the Discord and post your question in the #developers
channel.