edge-connect-client/apply-todo.md
Waldemar 8bfcd07ea4 feat(apply): Implement resource management with parallel deployment and rollback
Phase 3 Complete: Resource Management
- Add EdgeConnectResourceManager with deployment execution
- Implement app creation with manifest file processing
- Support parallel instance deployment across multiple cloudlets
- Handle network configuration conversion to SecurityRules
- Add comprehensive rollback functionality for failed deployments
- Include detailed logging and progress tracking
- Create extensive test coverage with mock scenarios

Features:
- Parallel deployment with configurable limits
- Intelligent rollback in reverse order
- Manifest file reading and hash calculation
- Network rule conversion and validation
- Deployment progress tracking and logging
- Comprehensive error handling with detailed messages

Testing:
- 16 test scenarios covering success/failure cases
- Mock client interfaces for reliable testing
- Rollback testing with failure scenarios
- Configuration conversion validation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 16:46:34 +02:00

3.6 KiB

EdgeConnect Apply Command - Implementation Todo List

Current Status: Phase 3 Complete - Ready for Phase 4

Phase 1: Configuration Foundation COMPLETED

  • Step 1.1: Create sdk/internal/config/types.go with EdgeConnectConfig structs
  • Step 1.2: Implement YAML unmarshaling and validation in sdk/internal/config/parser.go
  • Step 1.3: Add comprehensive field validation methods
  • Step 1.4: Create sdk/internal/config/parser_test.go with full test coverage
  • Step 1.5: Test config parsing with example EdgeConnectConfig.yaml

Phase 2: Deployment Planning COMPLETED

  • Step 2.1: Create deployment plan types in sdk/internal/apply/types.go
  • Step 2.2: Implement Planner interface in sdk/internal/apply/planner.go
  • Step 2.3: Add state comparison logic (existing vs desired)
  • Step 2.4: Create deployment summary generation
  • Step 2.5: Add comprehensive tests in sdk/internal/apply/planner_test.go

Phase 3: Resource Management COMPLETED

  • Step 3.1: Create ResourceManager in sdk/internal/apply/manager.go
  • Step 3.2: Implement app creation with manifest file handling
  • Step 3.3: Add instance deployment across multiple cloudlets
  • Step 3.4: Handle network configuration application
  • Step 3.5: Add rollback functionality for failed deployments
  • Step 3.6: Create manager tests in sdk/internal/apply/manager_test.go

Phase 4: CLI Command Implementation

  • Step 4.1: Create basic apply command in cmd/apply.go
  • Step 4.2: Add file flag handling and validation
  • Step 4.3: Implement deployment execution flow
  • Step 4.4: Add progress reporting during deployment
  • Step 4.5: Integrate with root command in cmd/root.go
  • Step 4.6: Add --dry-run flag support

Phase 5: Testing & Polish

  • Step 5.1: Create integration tests in cmd/apply_test.go
  • Step 5.2: Test error scenarios and rollback behavior
  • Step 5.3: Add example configurations in examples/apply/
  • Step 5.4: Create user documentation
  • Step 5.5: Performance testing for large deployments

Phase 6: Advanced Features

  • Step 6.1: Implement manifest file hash tracking in annotations
  • Step 6.2: Add intelligent update detection
  • Step 6.3: Create deployment status tracking
  • Step 6.4: Add environment variable substitution support
  • Step 6.5: Implement configuration validation enhancements

Dependencies & Prerequisites

  • Existing SDK in sdk/edgeconnect/
  • Cobra CLI framework already integrated
  • Viper configuration already setup
  • Example EdgeConnectConfig.yaml available

Risks & Mitigation

  • Risk: Complex nested YAML validation
    • Mitigation: Use struct tags and dedicated validation functions
  • Risk: Parallel deployment complexity
    • Mitigation: Use goroutines with proper error handling and rollback
  • Risk: Large manifest files
    • Mitigation: Stream file reading and hash calculation

Success Criteria

  • Single command deploys complex applications across multiple cloudlets
  • Configuration validation provides helpful error messages
  • Failed deployments rollback gracefully
  • Parallel deployments complete 70% faster than sequential
  • Integration tests cover all major scenarios
  • Code follows existing CLI patterns and conventions

Ready to Begin Implementation

All planning is complete. The implementation can now proceed phase by phase with each step building incrementally on the previous work.