Thank you for your interest in contributing to codeQ! This guide will help you get started.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Making Changes
- Testing
- Documentation
- Submitting Changes
We are committed to providing a welcoming and inclusive environment. Please be respectful and constructive in all interactions.
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/codeq.git cd codeq -
Add upstream remote:
git remote add upstream https://github.com/osvaldoandrade/codeq.git
- Go: Version specified in
go.mod(check withgo version) - Git: For version control
go mod downloadgo build -o codeq ./cmd/codeq
./codeq --helpTest the CLI code (does not require private dependencies):
go test ./cmd/codeq/...Test all public packages:
go test ./pkg/...Note: Tests in internal/ may require private server-side dependencies and are not required for CLI contributions.
codeq/
├── cmd/codeq/ # CLI application entry point
├── pkg/ # Public Go packages
│ ├── app/ # Application wiring
│ ├── config/ # Configuration management
│ └── domain/ # Domain models
├── internal/ # Private packages (server-side)
│ ├── controllers/ # HTTP request handlers
│ ├── middleware/ # Auth, logging, etc.
│ ├── repository/ # Data access layer
│ └── services/ # Business logic
├── docs/ # Technical specification
├── wiki/ # User-facing documentation
├── helm/ # Kubernetes deployment
└── npm/ # NPM package wrapper
Use descriptive branch names:
feature/add-priority-sortingfix/claim-timeout-bugdocs/update-api-reference
Follow conventional commits format:
<type>(<scope>): <subject>
<body>
<footer>
Types: feat, fix, docs, style, refactor, test, chore
Example:
feat(cli): add --format json flag to task create
Allows JSON output for scripting and automation.
Closes #123
- Follow standard Go formatting (
gofmt,goimports) - Write clear, self-documenting code
- Add comments for complex logic
- Keep functions focused and concise
Go imports must be organized in the following order (with blank lines separating groups):
- Standard library imports (e.g.,
fmt,context,io) - External dependency imports (e.g.,
github.com,golang.org) - Internal imports (e.g.,
codeq/pkg,codeq/internal)
Example:
import (
"context"
"fmt"
"github.com/go-redis/redis/v8"
"github.com/prometheus/client_golang/prometheus"
"codeq/internal/repository"
"codeq/pkg/domain"
)Use goimports -w to automatically format and organize imports:
goimports -w ./...Write unit tests for new functionality:
go test ./pkg/domain/... -vIntegration tests are in pkg/app/integration_test.go:
go test ./pkg/app/... -vNote: integration tests open a Pebble store under t.TempDir(); no external process is required.
Test the CLI locally:
# Build
go build -o codeq ./cmd/codeq
# Initialize config
./codeq init
# Test against local server
./codeq --base-url http://localhost:8080 task create \
--event TEST_EVENT \
--payload '{"test": true}'codeQ includes a comprehensive load testing framework to validate performance and catch regressions:
Run k6 load tests (requires Docker Compose):
# Start codeQ and dependencies
docker compose \
-f deploy/docker-compose/local-dev/compose.yaml \
-f deploy/docker-compose/local-dev/compose.override.yaml \
up -d
# Run a sustained throughput scenario
docker compose \
-f deploy/docker-compose/local-dev/compose.yaml \
-f deploy/docker-compose/local-dev/compose.override.yaml \
--profile loadtest run --rm k6 run /scripts/01_sustained_throughput.js
# Run with custom parameters
RATE=1000 DURATION=10m WORKER_VUS=200 \
docker compose \
-f deploy/docker-compose/local-dev/compose.yaml \
-f deploy/docker-compose/local-dev/compose.override.yaml \
--profile loadtest run --rm k6 run /scripts/01_sustained_throughput.jsRun Go benchmarks (fast, in-memory):
go test ./internal/bench -bench . -benchtime=30sSee docs/26-load-testing.md and loadtest/README.md for comprehensive documentation on all load testing scenarios and performance benchmarking.
Documentation is critical! Please update relevant docs when making changes:
- Adding a feature: Update
docs/, wiki pages, and README - Changing CLI: Update
wiki/CLI.mdand command help text - API changes: Update
docs/04-http-api.md - Configuration: Update
docs/14-configuration.md
Follow the Diátaxis framework:
- Tutorials: Learning-oriented, hands-on lessons
- How-to guides: Problem-oriented, practical steps
- Technical reference: Information-oriented, precise descriptions
- Explanation: Understanding-oriented, clarification
Use:
- Active voice
- Plain English
- Progressive disclosure (high-level first, details second)
- Code examples with expected output
/docs/: Technical specifications (architecture, API, internals)/wiki/: User-facing guides (getting started, tutorials, use cases)README.md: Project overview, quick start- Code comments: Implementation details, rationale
-
Update your branch:
git fetch upstream git rebase upstream/main
-
Push to your fork:
git push origin your-branch-name
-
Create a Pull Request on GitHub
-
Fill out the PR template with:
- Clear description of changes
- Motivation and context
- Testing performed
- Documentation updates
- Screenshots (if UI changes)
- Code compiles and tests pass
- Changes are focused and scoped
- Code follows style guidelines
- Documentation is updated
- No breaking changes (or clearly documented)
- Commit history is clean
Your PR will trigger automated checks:
- Release workflow: Tests CLI build
- Static workflow: Deploys documentation preview
Ensure all checks pass before requesting review.
- Open an issue for bugs or feature requests
- Check existing discussions for questions
Thank you for contributing! 🎉