Thank you for your interest in contributing to Tracker! This document provides guidelines and instructions for contributing.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Contribution Workflow
- Coding Standards
- Testing Guidelines
- Documentation
- Community
This project adheres to a code of conduct. By participating, you are expected to uphold this code:
- Be respectful and inclusive
- Be collaborative and constructive
- Focus on what is best for the community
- Show empathy towards other community members
Before creating bug reports, please check existing issues. When creating a bug report, include:
- Clear title and description
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Screenshots if applicable
- Environment details (OS, Go version, etc.)
Use the bug report template:
**Describe the bug**
A clear description of what the bug is.
**To Reproduce**
Steps to reproduce:
1. Go to '...'
2. Click on '...'
3. See error
**Expected behavior**
What you expected to happen.
**Environment:**
- OS: [e.g. Ubuntu 22.04]
- Go version: [e.g. 1.23]
- Tracker version: [e.g. 1.0.0]Feature suggestions are welcome! Please:
- Check existing feature requests first
- Provide clear use cases for the feature
- Explain why this would be useful
- Consider alternatives you've thought about
We actively welcome pull requests:
- Fork the repo and create your branch from
main - Make your changes
- Add tests for new functionality
- Ensure tests pass
- Update documentation
- Submit a pull request
See the Development Guide for detailed setup instructions.
Quick start:
# Clone your fork
git clone https://github.com/YOUR_USERNAME/tracker.git
cd tracker
# Install dependencies
go mod download
cd web && npm install
# Run tests
go test ./...
cd web && npm test
# Start development
go run main.go serv # Backend
cd web && npm run dev # Frontend- Look for issues labeled
good first issueorhelp wanted - Comment on the issue to let others know you're working on it
- If no issue exists, create one first to discuss the change
# Fork on GitHub, then:
git clone https://github.com/YOUR_USERNAME/tracker.git
cd tracker
git remote add upstream https://github.com/BananaOps/tracker.git
# Create a branch
git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description- Write clear, concise commit messages
- Follow coding standards
- Add tests for new features
- Update documentation
# Run all tests
go test ./...
cd web && npm test
# Run linters
golangci-lint run
cd web && npm run lint
# Test manually
go run main.go servFollow Conventional Commits:
# Format: <type>(<scope>): <description>
git commit -m "feat(api): add new endpoint for events"
git commit -m "fix(ui): correct date formatting in timeline"
git commit -m "docs: update installation guide"
git commit -m "test: add tests for catalog service"Types:
feat: New featurefix: Bug fixdocs: Documentationtest: Testsrefactor: Code refactoringperf: Performance improvementchore: Maintenance tasksci: CI/CD changes
# Push to your fork
git push origin feature/your-feature-name
# Create PR on GitHub
# Fill in the PR template
# Link related issues with "Fixes #123"- Address review comments promptly
- Push additional commits to the same branch
- Be open to feedback
- Keep discussions professional
- Follow Effective Go
- Use
gofmtfor formatting - Run
golangci-lintbefore committing - Write clear comments for exported functions
- Keep functions small and focused
- Use meaningful variable names
Example:
// GetEventByID retrieves an event by its unique identifier.
// Returns ErrNotFound if the event doesn't exist.
func (s *EventService) GetEventByID(ctx context.Context, id string) (*Event, error) {
if id == "" {
return nil, ErrInvalidID
}
event, err := s.repo.FindByID(ctx, id)
if err != nil {
return nil, fmt.Errorf("failed to get event: %w", err)
}
return event, nil
}- Use TypeScript for type safety
- Follow React best practices
- Use functional components and hooks
- Keep components small and reusable
- Use Tailwind CSS for styling
- Run ESLint before committing
Example:
interface EventCardProps {
event: Event;
onSelect?: (event: Event) => void;
}
export function EventCard({ event, onSelect }: EventCardProps) {
const handleClick = () => {
onSelect?.(event);
};
return (
<div
onClick={handleClick}
className="p-4 rounded-lg border hover:shadow-lg transition-shadow"
>
<h3 className="text-lg font-semibold">{event.title}</h3>
<p className="text-gray-600">{event.message}</p>
</div>
);
}- Use clear, descriptive field names
- Add comments for all messages and fields
- Follow protobuf style guide
- Version your APIs appropriately
func TestEventService_CreateEvent(t *testing.T) {
// Arrange
ctx := context.Background()
repo := &mockEventRepository{}
service := NewEventService(repo)
event := &Event{
Title: "Test Event",
Type: EventTypeDeployment,
}
// Act
result, err := service.CreateEvent(ctx, event)
// Assert
require.NoError(t, err)
assert.NotEmpty(t, result.ID)
assert.Equal(t, event.Title, result.Title)
}describe('EventCard', () => {
it('renders event title and message', () => {
const event = {
id: '1',
title: 'Test Event',
message: 'Test message',
};
render(<EventCard event={event} />);
expect(screen.getByText('Test Event')).toBeInTheDocument();
expect(screen.getByText('Test message')).toBeInTheDocument();
});
it('calls onSelect when clicked', () => {
const onSelect = jest.fn();
const event = { id: '1', title: 'Test' };
render(<EventCard event={event} onSelect={onSelect} />);
fireEvent.click(screen.getByText('Test'));
expect(onSelect).toHaveBeenCalledWith(event);
});
});- Aim for >80% code coverage
- Test edge cases and error conditions
- Write integration tests for critical paths
- Mock external dependencies
- Document all exported functions and types
- Use clear, concise comments
- Include examples where helpful
- Keep documentation up to date
- Update relevant docs in
/docs - Add examples for new features
- Update README if needed
- Include screenshots for UI changes
- Update OpenAPI/Swagger specs
- Document request/response formats
- Include example requests
- Note breaking changes
Before submitting your PR, ensure:
- Code follows project style guidelines
- Tests pass locally (
go test ./...,npm test) - Linters pass (
golangci-lint run,npm run lint) - New code has tests
- Documentation is updated
- Commit messages follow conventional commits
- PR description explains the changes
- Related issues are linked
- 🐛 GitHub Issues - Bug reports and feature requests
- 💬 GitHub Discussions - Questions and ideas
- 📖 Documentation - Guides and references
Contributors are automatically recognized in this file and the README. Thank you for your contributions!
By contributing to Tracker, you agree that your contributions will be licensed under the Apache 2.0 License.
Feel free to ask questions in GitHub Discussions or open an issue.
Thank you for contributing to Tracker! 🚀