Commit ff80d7d
committed
refactor: prepare commands for Phase 5 state management integration
This commit completes Subtask 1 of Phase 5: Preparatory Refactoring.
Changes:
- Refactor ProvisionCommand structure:
* Extract 5 helper methods from execute() for better clarity
* Organize methods: public interface first, then private helpers
* Remove confusing 'Phase' terminology from comments
* Methods: render_opentofu_templates, create_instance, get_instance_info,
render_ansible_templates, wait_for_readiness
- Remove redundant SshCredentials field:
* Pass ssh_credentials as parameter to execute() instead
* Update all callers (E2E tests)
- Add error context extraction helpers:
* extract_failed_step() to identify which step failed
* extract_opentofu_step() for OpenTofu-specific error context
* Add 6 unit tests for error extraction
- Add Phase 5 integration markers:
* TODO(Phase 5) comments in ProvisionCommand and ConfigureCommand
* Document where state transitions will be integrated
- Setup repository infrastructure:
* Create RepositoryFactory for environment-specific repository creation
* Add repository_factory field to Services container
* Extract REPOSITORY_LOCK_TIMEOUT_SECS constant (30 seconds)
* Add 5 tests for RepositoryFactory (4 unit + 1 integration)
- Code quality improvements:
* Add 'clonable' to project-words.txt
* Add missing backticks in documentation
* Run rustfmt for consistent formatting
All 703 tests passing, all linters passing.
Ready for Phase 5 Subtasks 2-4.1 parent 8d8ef9a commit ff80d7d
File tree
7 files changed
+538
-39
lines changed- src
- application/commands
- e2e/tasks/virtual_machine
- infrastructure/persistence
7 files changed
+538
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
23 | 32 | | |
24 | 33 | | |
| 34 | + | |
| 35 | + | |
25 | 36 | | |
26 | 37 | | |
27 | 38 | | |
| |||
49 | 60 | | |
50 | 61 | | |
51 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
52 | 67 | | |
53 | 68 | | |
54 | 69 | | |
55 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
56 | 76 | | |
57 | 77 | | |
58 | 78 | | |
| |||
0 commit comments