How azure/draft works
Main Components Identification
The system should be divided into these major components:
a) Core Command Processing
• Root command handler (cmd/root.go)
• Individual command handlers (create, validate, setup-gh, etc.)
b) Template Processing System
• Template management (pkg/handlers/template.go)
• Template writers (pkg/templatewriter/)
• Variable extractors (pkg/handlers/variableextractors/)
c) Language Detection & Support
• Linguist package (pkg/linguist/)
• Language-specific handlers
d) Kubernetes Integration
• Deployment handlers (pkg/handlers/)
• Safeguards system (pkg/safeguards/)
• Manifest processors
Component Relationships
User Input -> Command Layer -> Processing Layer -> Output Generation
Detailed Component Breakdown
a) Command Layer (Blue components):
• Create command
• Generate-workflow command
• Setup-gh command
• Validate command
• Info command
• Update command
b) Processing Layer (Green components):
• Template processor
• Language detector
• Configuration manager
• Safeguards validator
c) Integration Layer (Orange components):
• GitHub workflow generator
• Kubernetes manifest generator
• Docker file generator
d) Output Layer (Purple components):
• File writers
• CLI output
• Validation results
Data Flow Representation
• User input flow
• Template processing flow
• Configuration validation flow
• File generation flow
External Integration Points
Connections with:
• Kubernetes clusters
• GitHub Actions
• Azure services
• Docker build system
Key Design Elements
• Template system (pkg/handlers/template.go)
• Language detection (pkg/linguist/)
• Safeguards system (pkg/safeguards/)
• Configuration management (pkg/config/)
Implementation Details
Specialized components for:
• Different deployment types (Helm, Kustomize, plain manifests)
• Language-specific processors
• Validation rules
• GitHub workflow generation
Layer organization
• Top: User interface/CLI
• Middle: Core processing
• Bottom: Output generation
• Right side: External integrations