Contributing to Thanos
This guide outlines how to contribute to the Thanos project.
Setting up your development environment
- Fork the repository: Create a fork of the official Thanos repository on GitHub.
- Clone your fork: Clone your forked repository to your local machine.
- Install Go: Ensure you have Go installed. The project uses Go version 1.18 or later. https://go.dev/doc/install
- Install dependencies: Run
make install-tool-deps
to install necessary tools. - Run tests: Run
make test
to verify that your environment is set up correctly.
Finding issues to work on
- Browse the issue tracker: Find issues marked as “good first issue” or “help wanted” in the Thanos repository. https://github.com/thanos-io/thanos/issues
- Check the project roadmap: Review the project roadmap to identify areas where your contributions would be most valuable. https://github.com/thanos-io/thanos/projects
- Participate in discussions: Engage in discussions on GitHub issues and pull requests to understand the project’s needs and priorities.
Making contributions
- Create a new branch: Create a new branch from the
main
branch for your changes. - Implement your changes: Follow the project’s coding style and best practices.
- Write unit tests: Ensure your changes are covered by appropriate tests.
- Document your changes: Update relevant documentation to reflect your contributions.
- Submit a pull request: Create a pull request to the official Thanos repository, referencing the relevant issue.
Coding style and best practices
- Go: Adhere to the Go coding style guidelines. https://golang.org/doc/effective_go.html
- TypeScript: Follow the TypeScript style guide. https://www.typescriptlang.org/docs/handbook/style-guide.html
- JSONnet: Use the
make jsonnet-format
command to format JSONnet files. - Shell scripts: Run
make shell-lint
to check shell script syntax and formatting.
Building and testing your changes
- Building: Use
make
to build all Thanos components. - Testing: Run
make test
to execute unit and integration tests. - Docker images: Use
make docker
to build Docker images for Thanos. - End-to-end tests: Run
make test-e2e
for end-to-end testing.
Reviewing and merging your contributions
- Code review: Once your pull request is submitted, it will be reviewed by the project maintainers.
- Addressing feedback: Respond to comments and address any feedback provided during the review.
- Merging: Once your changes are approved, they will be merged into the
main
branch.
Getting help
- GitHub issues: Use the issue tracker to ask questions or report bugs. https://github.com/thanos-io/thanos/issues
- Community channels: Engage with the community on the Thanos Slack workspace. https://thanos.io/community/
Additional tips
- Start small: Begin by contributing small fixes or improvements to gain familiarity with the project.
- Be patient: The review process can take time, so be patient and responsive to feedback.
- Enjoy the process: Contributing to open-source projects is a rewarding experience.