Skip to main content

Git Standards

Branching — Trunk-Based Development

  • main is the single source of truth. Always deployable.
  • main is protected — no direct pushes. All changes merge via MR.
  • Feature branches named descriptively: feat/exam-results-page, fix/container-cleanup
  • Feature branches are short-lived (1-3 days max). Merge to main via MR.
  • No develop, staging, or release branches.

Branch Protection (GitLab Settings)

Configure under Settings > Repository > Protected branches for main:

  • Allowed to merge: Maintainers
  • Allowed to push: No one
  • Pipeline must succeed before merge

Releases

Cut from main using git tags: v0.1.0, v0.2.0, v1.0.0

Pre-release tags: v0.3.0-beta.1

Commit Messages — Conventional Commits

<type>(<scope>): <description>

[optional body]

Types: feat, fix, docs, refactor, test, chore, perf, style, ci

Scopes: backend, frontend, db, infra, admin, exams, labs, lessons

Examples:

feat(exams): add time limit display on exam attempt page
fix(backend): handle container not found during sandbox cleanup
refactor(admin): extract user management into separate component
test(backend): add exam verifier unit tests
ci: add GitLab CI pipeline with lint and test stages
chore(deps): upgrade SQLAlchemy to 2.0.36

CHANGELOG.md

Update ## [Unreleased] for every feature, fix, or notable change:

## [Unreleased]

### Added
- Laboratory attempt results page with per-task breakdown

### Fixed
- Container status not updating after stop

### Changed
- Increased sandbox container expiry from 24h to 48h

When cutting a release, rename [Unreleased] to [vX.Y.Z] — YYYY-MM-DD.

Pre-commit Hooks (Optional)

If configured, hooks run before each commit:

  • trailing-whitespace — remove trailing spaces
  • end-of-file-fixer — ensure files end with newline
  • check-merge-conflict — catch unresolved merge markers
  • detect-private-key — prevent committing SSH keys or secrets

Install:

pip install pre-commit
pre-commit install