Contributing Guidelines
Thank you for your interest in contributing to RUSEON Core! We welcome bug fixes, performance improvements, documentation updates, and new features from the community.
Development & Git Workflow
We follow a structured branch and PR model:
- Fork the Repository: Create your fork on GitHub and clone it locally.
- Create a Topic Branch: Branch off from
devusing the formatfeat/feature-nameorfix/issue-description. - Discuss First: For architectural changes or new APIs, open an Issue to align on design before writing large PRs.
- Implement with Tests: All Go code must include unit tests with
-racevalidation. - Format & Lint: Run
golangci-lint runandcd web && npm run lint. - Submit a Pull Request: Target the
devbranch for all PRs.
Conventional Commits Standard
We enforce the Conventional Commits specification:
text
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]Allowed Commit Types:
| Type | When to Use | Example |
|---|---|---|
feat | Adding a new capability or API | feat(webrtc): add whep audio track negotiation |
fix | Correcting a bug or runtime defect | fix(recorder): prevent file descriptor leak on disk full |
perf | Optimizing CPU, memory, or I/O | perf(buffer): eliminate cloneBytes allocation in hot path |
docs | Documentation and comments only | docs(api): document query parameters for /api/v1/archive |
test | Adding or updating test suites | test(e2e): add Testcontainers test for H.265 stream |
refactor | Code restructuring without behavior change | refactor(db): isolate badger transaction helpers |
chore | Dependency bumps, CI updates, configs | chore(deps): upgrade pion/webrtc to v4 |
Coding Standards & Best Practices
Go Code Guidelines:
- Zero Allocations on the Hot Path: Avoid allocating slices or structs in
WriteFrameand media broadcasting loops. - Context Propagation: Pass
context.Contextas the first argument in long-running functions and API handlers. - Defensive Error Handling: Always check and wrap errors (
fmt.Errorf("action: %w", err)). Never discard errors silently. - Concurrency Safety: Protect shared state using
sync.RWMutexor atomic primitives (sync/atomic). Always test withgo test -race.
Frontend Guidelines:
- Write idiomatic TypeScript with strict type checking (
noImplicitAny). - Keep components modular and reusable under
web/src/components/. - Validate user inputs with clear visual feedback.