Thank you for your interest in contributing to Bifrost! This document provides guidelines for contributing to the project.
- Go 1.22 or later
- Make
- Docker (optional, for container builds)
- golangci-lint (for linting)
-
Fork the repository
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/bifrost-proxy.git cd bifrost-proxy -
Install dependencies:
go mod download
-
Build the project:
make build
-
Run tests:
make test
- Follow the Effective Go guidelines
- Run
gofmton all code - Use
golangci-lintfor static analysis - Write meaningful commit messages
- Add tests for new functionality
- Keep functions focused and small
- Document exported functions and types
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
Example:
Add rate limiting per user
- Implement token bucket algorithm
- Add configuration options for limits
- Include tests for edge cases
Fixes #123
-
Create a feature branch from
main:git checkout -b feature/your-feature-name
-
Make your changes and commit them
-
Ensure all tests pass:
make test make lint -
Push to your fork and create a pull request
-
Fill out the pull request template with relevant information
-
Wait for review and address any feedback
- Write unit tests for all new code
- Aim for >80% code coverage
- Use table-driven tests where appropriate
- Mock external dependencies
Run tests with coverage:
go test -cover ./...- Check if the issue already exists
- Use the issue templates when available
- Provide clear reproduction steps
- Include relevant logs and configuration
- Specify your environment (OS, Go version, etc.)
If you discover a security vulnerability, please report it through GitHub Security Advisories instead of opening a public issue.
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Follow project maintainers' decisions
By contributing, you agree that your contributions will be licensed under the MIT License.
Feel free to open an issue for questions or discussions about the project.