%%{init: {"theme": "neutral"} }%%
flowchart TB
subgraph "Source Control"
M[main branch] --> FA[feature/alpha/*]
M --> FB[feature/beta/*]
M --> FG[feature/gamma/*]
end
subgraph "CI/CD Pipeline"
FA --> |trigger| BA[Build alpha]
FB --> |trigger| BB[Build beta]
FG --> |trigger| BG[Build gamma]
BA --> TA[Test alpha]
BB --> TB[Test beta]
BG --> TG[Test gamma]
TA --> DA[Deploy alpha]
TB --> DB[Deploy beta]
TG --> DG[Deploy gamma]
end
subgraph "Environments"
DA --> EA[alpha.dandilion.ai]
DB --> EB[beta.dandilion.ai]
DG --> EG[gamma.dandilion.ai]
EA --> LB[Load Balancer/API Gateway]
EB --> LB
EG --> LB
LB --> C[Clients]
end
classDef source fill:#e3f2fd,stroke:#1565c0
classDef feature fill:#f3e5f5,stroke:#4a148c
classDef pipeline fill:#e8f5e9,stroke:#2e7d32
classDef deploy fill:#fff3e0,stroke:#ef6c00
class M,VA,VB,VG,VX source
class FA,FB,FG,FX feature
class BA,BB,BG,BX,TA,TB,TG,TX,DA,DB,DG,DX pipeline
class EA,EB,EG,EX,LB,C deploy
This document outlines the architecture and processes for managing multiple variants of dandilion.ai application. The system supports parallel development and deployment of different variants (alpha, beta, gamma) while maintaining code consistency and deployment isolation.
- Primary source of truth for core application code
- Contains shared components and base functionality
- All variant-specific branches originate from main
feature/alpha: Alpha variant branchfeature/beta: Beta variant branchfeaturegamma: Gamma variant branch
- Variant branches must be kept in sync with main for core updates
- Variant-specific features should not be merged back to main
- Each variant branch should have protected status requiring reviews
feature/alpha/* - For alpha variant features
feature/beta/* - For beta variant features
feature/gamma/* - For gamma variant features
- Alpha variant: alpha.dandilion.ai
- Beta variant: beta.dandilion.ai
- Gamma variant: gamma.dandilion.ai
- Create feature branches from respective variant branches
- Implement feature flags for variant-specific functionality
- Maintain separate configuration sets per variant
- Regular integration testing with variant branch
Each variant has an independent build pipeline:
- Triggered on commits to variant branches
- Uses variant-specific configurations
- Generates isolated artifacts per variant
Automated testing phases per variant:
- Unit tests
- Integration tests
- Variant-specific acceptance tests
- Performance benchmarks
- Security scans
- Build verification
- Test suite execution
- Environment configuration validation
- Rolling deployment
- Health checks
- Traffic routing updates
- Production:
- Alpha: alpha.app.com
- Beta: beta.app.com
- Gamma: gamma.app.com
- Route traffic based on domain
- Health check monitoring
- SSL termination
- Rate limiting per variant
- Custom header handling
-
Resource Isolation
- Separate compute resources per variant
- Isolated database instances/schemas
- Variant-specific caching layers
-
Monitoring & Observability
- Variant-tagged metrics
- Separate logging streams
- Custom dashboards per variant
- Variant-specific alerts
-
Security
- Separate SSL certificates
- Variant-specific access controls
- Independent security groups
- Isolated credentials
-
Code Review & Approval
- Feature branch review
- Variant branch merge approval
- Configuration validation
-
Release Process
- Version tagging
- Release notes generation
- Deployment schedule coordination
- Rollback planning
- Maintain clear variant boundaries
- Regular synchronization with main
- Comprehensive documentation
- Automated testing coverage
- Environment-specific configs
- Secure credential storage
- Feature flag management
- Documentation requirements
- Progressive rollouts
- Automated rollback capability
- Health check verification
- Traffic shifting controls
This document outlines the setup and usage of pre-commit hooks for enforcing branch naming conventions in the dandilion.ai multi-variant project. The pre-commit hook ensures consistent branch naming across all variants (alpha, beta, gamma) and prevents commits with invalid branch names.
- Python 3.x
- Git
- pip (Python package manager)
pip install pre-commit# Navigate to your project root
cd your-project-directory
# Install pre-commit in your git hooks
pre-commit installCreate this file in your project root:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: local
hooks:
- id: branch-name
name: Check branch naming convention
entry: python scripts/check_branch_name.py
language: python
pass_filenames: false
stages: [commit]Create scripts/check_branch_name.py:
mkdir -p scripts
touch scripts/check_branch_name.py
chmod +x scripts/check_branch_name.py-
Feature Branches
Pattern: feature/[variant]/[feature-name] Example: feature/alpha/user-authentication -
Hotfix Branches
Pattern: hotfix/[variant]/[fix-name] Example: hotfix/beta/login-issue -
Bugfix Branches
Pattern: bugfix/[variant]/[bug-name] Example: bugfix/gamma/memory-leak -
Release Branches
Pattern: release/[variant]/X.Y.Z Example: release/alpha/1.2.3 -
Variant Branches
Pattern: dandilion.ai-[variant] Example: dandilion.ai-alpha -
Main Branch
Pattern: main
- Use lowercase letters and numbers
- Use hyphens (-) for word separation
- No underscores or special characters
- Variant must be one of: alpha, beta, gamma
- Feature names should be descriptive and concise
# Create a feature branch
git checkout -b feature/alpha/user-auth
# Create a hotfix branch
git checkout -b hotfix/beta/login-fix
# Create a bugfix branch
git checkout -b bugfix/gamma/memory-leak-
The hook runs automatically before each commit
-
Validates the current branch name
-
If invalid:
- Displays error message with allowed formats
- Prevents commit
-
If valid:
- Allows commit to proceed
When a branch name is invalid, you'll see:
Invalid branch name: [your-branch-name]
Allowed branch name formats:
- feature/[variant]/[feature-name] (e.g., feature/alpha/user-auth)
- hotfix/[variant]/[fix-name] (e.g., hotfix/beta/login-fix)
- bugfix/[variant]/[bug-name] (e.g., bugfix/gamma/memory-leak)
- release/[variant]/X.Y.Z (e.g., release/alpha/1.2.3)
- dandilion.ai-[variant] (e.g., dandilion.ai-alpha)
- main
where [variant] must be one of: alpha, beta, gamma
- Hook Not Running
# Verify hook installation
ls -la .git/hooks/pre-commit
# Reinstall if needed
pre-commit install- Python Script Permission Issues
# Add execution permissions
chmod +x scripts/check_branch_name.py- Pre-commit Not Found
# Verify pre-commit installation
pre-commit --version
# Reinstall if needed
pip install pre-commitIn emergency situations, you can bypass the hook:
git commit --no-verify -m "Your message"Note: This should be used sparingly and only in exceptional circumstances.
# Update pre-commit to latest version
pip install --upgrade pre-commit
# Update hook repositories
pre-commit autoupdateTo add or modify branch patterns:
- Edit the
patternsdictionary inscripts/check_branch_name.py - Update documentation to reflect new patterns
- Test changes with various branch names
-
Branch Naming
- Use descriptive, meaningful names
- Keep names concise but clear
- Follow the established pattern strictly
-
Commit Process
- Create branch with valid name before starting work
- Verify branch name before making commits
- Review error messages carefully if commit is rejected
-
Team Collaboration
- Share this documentation with new team members
- Include branch naming in code review checklist
- Maintain consistency across all team members
Thank you. Super clear document and it all makes sense to me.