lily_website

🌿 Git Flow & Branching Strategy

⬅️ Back 🏠 Docs Root

We use a Scoped Branching Strategy combined with a 3-tier branch structure to ensure code stability and clear ownership in our monorepo.

🏷️ Branch Naming Convention (Scoped)

Since this is a monorepo, every branch MUST indicate which part of the system it affects.

Format: type/scope/description

1. Types

| Type | Description | |:β€”|:β€”| | feature | New functionality | | fix | Bug fix | | refactor | Code restructuring without behavior change | | chore | Maintenance, dependency updates, config changes | | docs | Documentation updates | | test | Adding or fixing tests |

2. Scopes

| Scope | Path | Description | |:β€”|:β€”|:β€”| | backend | src/backend-fastapi | Server-side logic | | bot | src/telegram_bot | Telegram Bot | | shared | src/shared | Shared code (DTOs, Utils) | | infra | docker/, k8s/ | DevOps, Docker, CI/CD | | docs | docs/ | Global documentation |

3. Examples


🌳 Branch Structure

1. develop πŸ› οΈ (Development)

2. main πŸ§ͺ (Staging / Pre-Release)

3. release πŸš€ (Production)


πŸ”„ Workflow

  1. New Task:
    • Create branch from develop: git checkout -b feature/bot/my-cool-feature develop.
    • Write code, commit.
    • Run local check before push: .\check_local.ps1 (Windows) or pwsh (Linux/Mac).
  2. Integration (Develop):
    • Push and open PR to develop.
    • GitHub Actions checks style and types.
    • Merge PR.
  3. Stabilization (Main):
    • When features are ready, open PR develop -> main.
    • GitHub Actions runs heavy tests.
    • If all OK β€” merge.
  4. Release (Release):
    • Open PR main -> release.
    • GitHub Actions verifies source is main.
    • After merge, magic begins: Docker build -> Push to GHCR -> VPS Update.