Contributing to Bifrost
Contributing to Bifrost
Section titled “Contributing to Bifrost”Thank you for your interest in contributing to Bifrost! This document provides guidelines for contributing to the project.
Development Setup
Section titled “Development Setup”Prerequisites
Section titled “Prerequisites”- Go 1.22 or later
- Make
- Docker (optional, for container builds)
- golangci-lint (for linting)
Getting Started
Section titled “Getting Started”-
Fork the repository
-
Clone your fork:
Terminal window git clone https://github.com/YOUR_USERNAME/bifrost-proxy.gitcd bifrost-proxy -
Install dependencies:
Terminal window go mod download -
Build the project:
Terminal window make build -
Run tests:
Terminal window make test
Code Style
Section titled “Code Style”Go Code
Section titled “Go Code”- 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
Commit Messages
Section titled “Commit Messages”- 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 #123Pull Request Process
Section titled “Pull Request Process”-
Create a feature branch from
main:Terminal window git checkout -b feature/your-feature-name -
Make your changes and commit them
-
Ensure all tests pass:
Terminal window make testmake 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
Testing
Section titled “Testing”- 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 ./...Reporting Issues
Section titled “Reporting Issues”- 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.)
Security Issues
Section titled “Security Issues”If you discover a security vulnerability, please email the maintainers instead of opening a public issue.
Code of Conduct
Section titled “Code of Conduct”- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Follow project maintainers’ decisions
License
Section titled “License”By contributing, you agree that your contributions will be licensed under the MIT License.
Questions?
Section titled “Questions?”Feel free to open an issue for questions or discussions about the project.