Contributing to Timoni: A Comprehensive Guide for Developers
Timoni is an Apache 2.0 licensed project that welcomes contributions via GitHub pull requests. In this guide, we’ll outline the steps for developers to get started with contributing to the project.
Prerequisites
Before you begin, ensure you have the following prerequisites installed:
- Go >= 1.21: Install Go from the official website
- cue >= 0.6: Install cue using
go get github.com/c-bata/cue/cmd/cue
- Make >= 4.4: Install make from your operating system’s package manager
Running the Test Suite
To run the test suite, use the following command:
make
You can also run manual tests using the locally built binary:
./bin/timoni <command>
Rendering the Docs Locally
To render the docs locally, follow these steps:
- Install the required packages:
python -m venv venv && source venv/bin/activate
pip install -r hack/mkdocs/requirements.txt
- Build and serve the docs:
mkdocs serve
By default, MKDocs will be served at http://127.0.0.1:8000
Acceptance Policy
To increase the chances of your pull request being accepted, follow these guidelines:
- Write a clear and concise requirement.
- Add tests for new code and old code.
- Ensure new code and tests follow the project’s conventions.
- Write a good commit message.
- Ensure all code builds on Linux, macOS, and Windows using plain
go build
. - Ensure code has appropriate test coverage and tests work with
go test
. - Adhere to Go Code Review Comments.
- Follow What’s in a name for naming conventions.
Committing Changes
When committing changes, follow these rules for good commit messages:
- Limit the subject to 50 characters and write it as a continuation of the sentence “If applied, this commit will …”
- Explain what and why in the body, if more than a trivial change; wrap it at 72 characters.
For more helpful advice on documenting your work, refer to this article.
Available Commands
Timoni has the following commands potentially available:
- Build:
make build
- Test:
make test
- Static analysis checks:
make cue-vet
- Install:
make install
- Push Redis OCI artifact:
make push-redis
- Format the codebase:
make fmt
- Remove unnecessary files:
make tidy
- Generate Go files:
make generate
- Generate documentation:
make docs
- Help information:
make help
- Build, test, and install:
make all
- Prepare documentation:
make prep-docs
- Set up environment for
envtest
:make setup-envtest
- Install
envtest
:make install-envtest
- Run a command using
ONESHELL
:make ONESHELL
(assuming it’s defined)
CI/CD Configurations
Timoni uses the following CI/CD configurations:
- GitHub Actions: .github/workflows/main.yml
- Travis CI: .travis.yml
These configurations help ensure that the project’s codebase remains stable and functional. When contributing, keep these configurations in mind to maintain the project’s integrity.