Skip to main content

Contributing

How to Contribute

Atlas is a community project, we welcome contributions of all kinds and sizes!

Here are some ways in which you can help:

  • File well-written and descriptive bug reports or feature requests in the Issues page.
  • Tweet about your experience with Atlas on Twitter, don't forget to mention @atlasgo_io and link to atlasgo.io if you do.
  • Write educational content on your personal blog or websites such as dev.to or Medium. If you do, don't hesitate to reach out to us via Discord (link below) for help proof-reading your text and using our social-media channels for distributing it to readers.
  • Join our Discord Server to answer questions of other users and find out other ways in which you can contribute by talking to the community there!
  • Contribute bug-fixes or new features to the codebase.

Contributing code to Atlas

As we are still starting out, we don't have an official code-style or guidelines on composing your code. As general advice, read through the area of the code that you are modifying and try to keep your code similar to what others have written in the same place.

Code-generation

Some of the code in the Atlas repository is generated. The CI process verifies that all generated files are checked-in by running go generate ./... and then running git status --porcelain. Therefore, before committing changes to Atlas, please run:

go generate ./...

Linting

Your code will be linted using golangci-lint during CI. To install in locally, follow this guide.

To run it locally:

golangci-lint run

Formatting

Format your code using the standard fmt command:

go fmt ./...

Unit-tests

Your code should be covered in unit-tests, see the codebase for examples. To run tests:

go test ./...

Integration tests

Some features, especially those that interact directly with a database must be verified in an integration test. There is extensive infrastructure for integration tests under internal/integration/ that runs tests under a matrix of database dialect (Postres, MySQL, etc.) and versions. To run the integration tests, first use the docker-compose.yml file to spin up databases to test against:

cd internal/integration 
docker-compose up -d

Then run the tests, from with the integration directory:

go test ./...