Contributing
Guidelines for contributing to the SOCSuite project.
:::info [Proprietary project] Contributions are only possible for authorised team members. :::
Core Principles
- Quality > Speed — Take longer if needed, but keep it clean
- Security First — Security aspects have the highest priority
- No code without tests
- No code without documentation
Git Workflow
Branch Structure
main → Production-ready
└── develop → Main development branch
├── feature/TICKET-123-description
├── fix/TICKET-456-bugdescription
├── hotfix/critical-fix
└── refactor/improvementNew Feature
git checkout develop && git pull
git checkout -b feature/TICKET-123-feature-name
# Develop...
git add apps/api/internal/service/my_service.go
git commit -m "feat(cases): add timeline auto-correlation"
git push origin feature/TICKET-123-feature-name
# → Create Merge Request in GitLabCommit Conventions
| Prefix | Usage |
|---|---|
feat: | New feature |
fix: | Bug fix |
refactor: | Refactoring (no feature, no fix) |
test: | Add/change tests |
docs: | Documentation |
chore: | Build, tooling, dependencies |
Format: feat(scope): short description (max 50 characters, imperative, no period)
Code Standards
Go
// ✅ CORRECT: Context, error wrapping, interfaces
func (s *UserService) GetUser(ctx context.Context, id string) (*User, error) {
if id == "" {
return nil, ErrInvalidUserID
}
user, err := s.repo.FindByID(ctx, id)
if err != nil {
return nil, fmt.Errorf("find user %s: %w", id, err)
}
return user, nil
}Mandatory Go rules:
- Context as first parameter (never nil)
- Handle and wrap all errors with
%w - No unused variables/parameters
- Close resources (defer)
- No DB access in handler (only via service)
TypeScript / React
// ✅ Typed props, named export, functional component
interface UserProfileProps {
user: User;
}
export function UserProfile({ user }: UserProfileProps) {
if (!user) return <EmptyState />;
return <Card><CardTitle>{user.email}</CardTitle></Card>;
}Mandatory frontend rules:
- All props typed (Interface/Type)
- Prefer named exports
- Always validate user input with Zod
- No
dangerouslySetInnerHTMLwithout sanitization - No JWT in localStorage
Lint Configuration
# Run lint
make lint # Go
pnpm lint # Frontend
# Auto-fix
pnpm lint:fixConfiguration files:
| File | Purpose |
|---|---|
golangci.yml | Go lint rules |
prettier.json | Code formatting (2 spaces, semicolons, trailing commas) |
eslint.config.js | TypeScript/JavaScript |
PR Checklist
Before the Merge Request:
- Code compiles without errors
- All tests green (
go test ./.../pnpm test) - Lint without errors
- Type checking without errors
- New feature has tests (≥80% coverage)
- New endpoint declared in
orchestrator/meta/endpoints.yaml - Audit logging for write operations
-
CHANGELOG.mdupdated (for features)
What is Never Committed
:::error [Forbidden in Git]
.envfiles (only.env.example)node_modules/,dist/,vendor/- Secrets as literals in code
*.bak,*.old,*.disabledfiles :::
See Also
- Test Strategy — Test pyramid, coverage goals, best practices
- Dev Setup — Development environment and lint configuration
- API Reference — Endpoints and Swagger UI