Contributing
Learn how to contribute to the gTunnel project.
Getting Started
We welcome contributions to gTunnel! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
Ways to Contribute
- Report bugs and issues
- Suggest new features
- Submit code improvements
- Improve documentation
- Help with testing
Development Setup
Prerequisites
- Go 1.21 or later
- Git
- Docker (optional, for testing)
Clone Repository
git clone https://github.com/B-AJ-Amar/gTunnel.git
cd gTunnel
Build from Source
# Build client
go build -o bin/gtunnel-client ./cmd/client
# Build server
go build -o bin/gtunnel-server ./cmd/server
Run Tests
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run specific test
go test ./internal/client/...
Code Guidelines
Go Style
Follow standard Go conventions:
- Use
gofmtfor formatting - Follow effective Go guidelines
- Write comprehensive tests
- Add meaningful comments
Project Structure
gTunnel/
├── cmd/ # Command-line applications
│ ├── client/ # Client CLI
│ └── server/ # Server CLI
├── internal/ # Internal packages
│ ├── client/ # Client implementation
│ ├── server/ # Server implementation
│ └── shared/ # Shared utilities
├── pkg/ # Public packages
├── docs/ # Documentation
└── scripts/ # Build and deployment scripts
Submitting Changes
Before You Start
- Check existing issues and PRs
- Create an issue to discuss major changes
- Fork the repository
- Create a feature branch
Development Workflow
-
Create branch:
git checkout -b feature/your-feature-name -
Make changes:
- Write code following style guidelines
- Add tests for new functionality
- Update documentation as needed
-
Test changes:
go test ./...
go vet ./...
golangci-lint run -
Commit changes:
git add .
git commit -m "Add: brief description of changes" -
Push and create PR:
git push origin feature/your-feature-name
Pull Request Guidelines
- Use clear, descriptive titles
- Include detailed description of changes
- Reference related issues
- Ensure all tests pass
- Update documentation if needed
Reporting Issues
Bug Reports
Include the following information:
- gTunnel version
- Operating system
- Go version
- Steps to reproduce
- Expected vs actual behavior
- Error messages/logs
- Configuration files (remove sensitive data)
Feature Requests
- Clearly describe the proposed feature
- Explain the use case and benefits
- Provide examples if possible
- Consider implementation complexity
Documentation
Writing Documentation
- Use clear, concise language
- Include code examples
- Test all examples
- Follow existing documentation style
Documentation Structure
docs/
├── src/
│ ├── pages/ # Landing pages
│ └── components/ # React components
├── docs/ # Main documentation
├── blog/ # Blog posts
└── static/ # Static assets
Testing
Test Categories
- Unit Tests: Test individual functions/methods
- Integration Tests: Test component interactions
- End-to-End Tests: Test complete workflows
Writing Tests
func TestClientConnect(t *testing.T) {
// Arrange
client := NewClient(Config{...})
// Act
err := client.Connect()
// Assert
assert.NoError(t, err)
assert.True(t, client.IsConnected())
}
Running Tests
# Unit tests
go test ./internal/...
# Integration tests
go test -tags=integration ./test/...
# All tests
make test
Release Process
Version Numbers
gTunnel follows semantic versioning (SemVer):
- MAJOR.MINOR.PATCH
- Example: 1.2.3
Release Checklist
- Update version numbers
- Update CHANGELOG.md
- Run full test suite
- Build release binaries
- Create GitHub release
- Update documentation
- Announce release
Community
Communication Channels
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - General discussions
- Documentation - Project documentation
Code of Conduct
Please be respectful and constructive in all interactions. We follow the Go Community Code of Conduct.
Recognition
Contributors are recognized in:
- CONTRIBUTORS.md file
- Release notes
- Project documentation
Thank you for contributing to gTunnel!